.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "PayflowPro 3pm" .TH PayflowPro 3pm "2022-06-30" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Business::OnlinePayment::PayflowPro \- Payflow Pro backend for Business::OnlinePayment .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Business::OnlinePayment; \& \& my $tx = new Business::OnlinePayment( \& \*(AqPayflowPro\*(Aq, \& \*(Aqvendor\*(Aq => \*(Aqyour_vendor\*(Aq, \& \*(Aqpartner\*(Aq => \*(Aqyour_partner\*(Aq, \& \*(Aqclient_certification_id\*(Aq => \*(AqGuidUpTo32Chars\*(Aq, \& ); \& \& # See the module documentation for details of content() \& $tx\->content( \& type => \*(AqVISA\*(Aq, \& action => \*(AqNormal Authorization\*(Aq, \& description => \*(AqBusiness::OnlinePayment::PayflowPro test\*(Aq, \& amount => \*(Aq49.95\*(Aq, \& invoice_number => \*(Aq100100\*(Aq, \& customer_id => \*(Aqjsk\*(Aq, \& name => \*(AqJason Kohles\*(Aq, \& address => \*(Aq123 Anystreet\*(Aq, \& city => \*(AqAnywhere\*(Aq, \& state => \*(AqGA\*(Aq, \& zip => \*(Aq30004\*(Aq, \& email => \*(Aqivan\-payflowpro@420.am\*(Aq, \& card_number => \*(Aq4111111111111111\*(Aq, \& expiration => \*(Aq12/09\*(Aq, \& cvv2 => \*(Aq123\*(Aq, \& order_number => \*(Aqstring\*(Aq, \& request_id => \*(Aqunique_identifier_for_transaction\*(Aq, \& ); \& \& $tx\->submit(); \& \& if ( $tx\->is_success() ) { \& print( \& "Card processed successfully: ", $tx\->authorization, "\en", \& "order number: ", $tx\->order_number, "\en", \& "CVV2 response: ", $tx\->cvv2_response, "\en", \& "AVS code: ", $tx\->avs_code, "\en", \& ); \& } \& else { \& my $info = ""; \& $info = " (CVV2 mismatch)" if ( $tx\->result_code == 114 ); \& \& print( \& "Card was rejected: ", $tx\->error_message, $info, "\en", \& "order number: ", $tx\->order_number, "\en", \& ); \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module is a back end driver that implements the interface specified by Business::OnlinePayment to support payment handling via the PayPal's Payflow Pro Internet payment solution. .PP See Business::OnlinePayment for details on the interface this modules supports. .SH "Standard methods" .IX Header "Standard methods" .IP "\fBset_defaults()\fR" 4 .IX Item "set_defaults()" This method sets the 'server' attribute to 'payflowpro.paypal.com' and the port attribute to '443'. This method also sets up the \&\*(L"Module specific methods\*(R" described below. .IP "\fBsubmit()\fR" 4 .IX Item "submit()" .SH "Unofficial methods" .IX Header "Unofficial methods" This module provides the following methods which are not officially part of the standard Business::OnlinePayment interface (as of 3.00_06) but are nevertheless supported by multiple gateways modules and expected to be standardized soon: .IP "\fBorder_number()\fR" 4 .IX Item "order_number()" .PD 0 .IP "\fBavs_code()\fR" 4 .IX Item "avs_code()" .IP "\fBcvv2_response()\fR" 4 .IX Item "cvv2_response()" .PD .SH "Module specific methods" .IX Header "Module specific methods" This module provides the following methods which are not currently part of the standard Business::OnlinePayment interface: .SS "\fBclient_certification_id()\fP" .IX Subsection "client_certification_id()" This gets/sets the X\-VPS-VITCLIENTCERTIFICATION-ID which is \s-1REQUIRED\s0 and defaults to \*(L"ClientCertificationIdNotSet\*(R". This is described in Website Payments Pro \s-1HTTPS\s0 Interface Developer's Guide as follows: .PP "A random globally unique identifier (\s-1GUID\s0) that is currently required. This requirement will be removed in the future. At this time, you can send any alpha-numeric \s-1ID\s0 up to 32 characters in length. .PP \&\s-1NOTE:\s0 Once you have created this \s-1ID,\s0 do not change it. Use the same \s-1ID\s0 for every transaction." .SS "\fBclient_timeout()\fP" .IX Subsection "client_timeout()" Timeout value, in seconds, after which this transaction should be aborted. Defaults to 45, the value recommended by the Website Payments Pro \s-1HTTPS\s0 Interface Developer's Guide. .SS "\fBdebug()\fP" .IX Subsection "debug()" Enable or disble debugging. The value specified here will also set \&\f(CW$Business::OnlinePayment::HTTPS::DEBUG\fR in \fBsubmit()\fR to aid in troubleshooting problems. .SS "\fBexpdate_mmyy()\fP" .IX Subsection "expdate_mmyy()" The \fBexpdate_mmyy()\fR method takes a single scalar argument (typically the value in \f(CW$content\fR{expiration}) and attempts to parse and format and put the date in \s-1MMYY\s0 format as required by PayflowPro specification. If unable to parse the expiration date simply leave it as is and let the PayflowPro system attempt to handle it as-is. .SS "\fBrequest_id()\fP" .IX Subsection "request_id()" It is recommended that you specify your own unique request_id for each transaction in \f(CW%content\fR. A request_id is \s-1REQUIRED\s0 by the PayflowPro processor. If a request_id is not set, then Digest::MD5 is used to attempt to generate a request_id for a transaction. .SS "Deprecated methods" .IX Subsection "Deprecated methods" The following methods are deprecated and may be removed in a future release. Values for vendor and partner should now be set as arguments to Business::OnlinePayment\->\fBnew()\fR. The value for cert_path was used to support passing a path to PFProAPI.pm (a Perl module/SDK from Verisign/Paypal) which is no longer used. .IP "\fBvendor()\fR" 4 .IX Item "vendor()" .PD 0 .IP "\fBpartner()\fR" 4 .IX Item "partner()" .IP "\fBcert_path()\fR" 4 .IX Item "cert_path()" .IP "\fBcvv2_code()\fR" 4 .IX Item "cvv2_code()" .PD .SH "Settings" .IX Header "Settings" The following default settings exist: .IP "server" 4 .IX Item "server" payflowpro.paypal.com or pilot\-payflowpro.paypal.com if \&\fBtest_transaction()\fR is \s-1TRUE\s0 .IP "port" 4 .IX Item "port" 443 .SH "Handling of content(%content)" .IX Header "Handling of content(%content)" The following rules apply to content(%content) data: .SS "action" .IX Subsection "action" If 'action' matches one of the following keys it is replaced by the right hand side value: .PP .Vb 5 \& \*(Aqnormal authorization\*(Aq => \*(AqS\*(Aq, # Sale transaction \& \*(Aqcredit\*(Aq => \*(AqC\*(Aq, # Credit (refund) \& \*(Aqauthorization only\*(Aq => \*(AqA\*(Aq, # Authorization \& \*(Aqpost authorization\*(Aq => \*(AqD\*(Aq, # Delayed Capture \& \*(Aqvoid\*(Aq => \*(AqV\*(Aq, .Ve .PP If 'action' is 'C', 'D' or 'V' and 'order_number' is not set then \&'amount', 'card_number' and 'expiration' must be set. .SS "type" .IX Subsection "type" If 'type' matches one of the following keys it is replaced by the right hand side value: .PP .Vb 5 \& \*(Aqvisa\*(Aq => \*(AqC\*(Aq, \& \*(Aqmastercard\*(Aq => \*(AqC\*(Aq, \& \*(Aqamerican express\*(Aq => \*(AqC\*(Aq, \& \*(Aqdiscover\*(Aq => \*(AqC\*(Aq, \& \*(Aqcc\*(Aq => \*(AqC\*(Aq, .Ve .PP The value of 'type' is used to set \fBtransaction_type()\fR. Currently this module only supports a \fBtransaction_type()\fR of 'C' any other values will cause \fBCarp::croak()\fR to be called in \fBsubmit()\fR. .PP Note: Payflow Pro supports multiple credit card types, including: American Express/Optima, Diners Club, Discover/Novus, Enroute, \s-1JCB,\s0 MasterCard and Visa. .SH "Setting Payflow Pro parameters from content(%content)" .IX Header "Setting Payflow Pro parameters from content(%content)" The following rules are applied to map data to Payflow Pro parameters from content(%content): .PP .Vb 10 \& # PFP param => $content{} \& VENDOR => $self\->vendor ? \e( $self\->vendor ) : \*(Aqlogin\*(Aq, \& PARTNER => \e( $self\->partner ), \& USER => \*(Aqlogin\*(Aq, \& PWD => \*(Aqpassword\*(Aq, \& TRXTYPE => \*(Aqaction\*(Aq, \& TENDER => \*(Aqtype\*(Aq, \& ORIGID => \*(Aqorder_number\*(Aq, \& COMMENT1 => \*(Aqdescription\*(Aq, \& COMMENT2 => \*(Aqinvoice_number\*(Aq, \& \& ACCT => \*(Aqcard_number\*(Aq, \& CVV2 => \*(Aqcvv2\*(Aq, \& EXPDATE => \e( $month.$year ), # MM/YY from \*(Aqexpiration\*(Aq \& AMT => \*(Aqamount\*(Aq, \& \& FIRSTNAME => \*(Aqfirst_name\*(Aq, \& LASTNAME => \*(Aqlast_name\*(Aq, \& NAME => \*(Aqname\*(Aq, \& EMAIL => \*(Aqemail\*(Aq, \& COMPANYNAME => \*(Aqcompany\*(Aq, \& STREET => \*(Aqaddress\*(Aq, \& CITY => \*(Aqcity\*(Aq, \& STATE => \*(Aqstate\*(Aq, \& ZIP => \e$zip, # \*(Aqzip\*(Aq with non\-alphanumerics removed \& COUNTRY => \*(Aqcountry\*(Aq, \& \& # As of 8/18/2009: CUSTCODE appears to be cut off at 18 \& # characters and isn\*(Aqt currently reportable. Consider storing \& # local customer ids in the COMMENT1/2 fields as a workaround. \& CUSTCODE => \*(Aqcustomer_id\*(Aq, \& \& SHIPTOFIRSTNAME => \*(Aqship_first_name\*(Aq, \& SHIPTOLASTNAME => \*(Aqship_last_name\*(Aq, \& SHIPTOSTREET => \*(Aqship_address\*(Aq, \& SHIPTOCITY => \*(Aqship_city\*(Aq, \& SHIPTOSTATE => \*(Aqship_state\*(Aq, \& SHIPTOZIP => \*(Aqship_zip\*(Aq, \& SHIPTOCOUNTRY => \*(Aqship_country\*(Aq, .Ve .PP The required Payflow Pro parameters for credit card transactions are: .PP .Vb 1 \& TRXTYPE TENDER PARTNER VENDOR USER PWD ORIGID .Ve .SH "Mapping Payflow Pro transaction responses to object methods" .IX Header "Mapping Payflow Pro transaction responses to object methods" The following methods provides access to the transaction response data resulting from a Payflow Pro request (after \fBsubmit()\fR) is called: .SS "\fBorder_number()\fP" .IX Subsection "order_number()" This \fBorder_number()\fR method returns the \s-1PNREF\s0 field, also known as the PayPal Reference \s-1ID,\s0 which is a unique number that identifies the transaction. .SS "\fBresult_code()\fP" .IX Subsection "result_code()" The \fBresult_code()\fR method returns the \s-1RESULT\s0 field, which is the numeric return code indicating the outcome of the attempted transaction. .PP A \s-1RESULT\s0 of 0 (zero) indicates the transaction was approved and \&\fBis_success()\fR will return '1' (one/TRUE). Any other \s-1RESULT\s0 value indicates a decline or error and \fBis_success()\fR will return '0' (zero/FALSE). .SS "\fBerror_message()\fP" .IX Subsection "error_message()" The \fBerror_message()\fR method returns the \s-1RESPMSG\s0 field, which is a response message returned with the transaction result. .SS "\fBauthorization()\fP" .IX Subsection "authorization()" The \fBauthorization()\fR method returns the \s-1AUTHCODE\s0 field, which is the approval code obtained from the processing network. .SS "\fBavs_code()\fP" .IX Subsection "avs_code()" The \fBavs_code()\fR method returns a combination of the \s-1AVSADDR\s0 and \s-1AVSZIP\s0 fields from the transaction result. The value in avs_code is as follows: .PP .Vb 5 \& Y \- Address and ZIP match \& A \- Address matches but not ZIP \& Z \- ZIP matches but not address \& N \- no match \& undef \- AVS values not available .Ve .SS "\fBcvv2_response()\fP" .IX Subsection "cvv2_response()" The \fBcvv2_response()\fR method returns the \s-1CVV2MATCH\s0 field, which is a response message returned with the transaction result. .SH "COMPATIBILITY" .IX Header "COMPATIBILITY" As of 0.07, this module communicates with the Payflow gateway directly and no longer requires the Payflow Pro \s-1SDK\s0 or other download. Thanks to Phil Lobbes for this great work and Josh Rosenbaum for additional enhancements and bug fixes. .SH "AUTHORS" .IX Header "AUTHORS" Ivan Kohler .PP Phil Lobbes .PP Based on Business::OnlinePayment::AuthorizeNet written by Jason Kohles. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBperl\fR\|(1), Business::OnlinePayment, Carp, and the PayPal Integration Center Payflow Pro resources at