The following parameters are supported for #, #, # and # transactions. I’ve read in the docs that they recommend you pass the exact same parameters to both setup and authorize/purchase.
This information was gleaned from a mix of:
PayFlow documentation
for key value pairs: Express Checkout for Payflow Pro (PDF)
previous ActiveMerchant code
trial & error
The following parameters are currently supported.
(opt) Customer IP Address
(opt) An order or invoice number. This will be passed through to the Payflow backend at manager.paypal.com, and show up as “Supplier Reference #“
(opt) Order description, shown to buyer (after redirected to PayPal). If Order Line Items are used (see below), then the description is suppressed. This will not be passed through to the Payflow backend.
(opt) See ActiveMerchant::Billing::Gateway for details
(opt) See ActiveMerchant::Billing::Gateway for details
(req) Currency of transaction, will be set to USD by default for PayFlow Express if not specified
(opt) Email of buyer; used to pre-fill PayPal login screen
(opt) Unique PayPal buyer account identification number, as returned by details_for request
(opt) Boolean for whether or not to display shipping address to buyer
(opt) Boolean. If true, display shipping address passed by parameters, rather than shipping address on file with PayPal
(opt) Boolean for permitting buyer to add note during checkout. Note contents can be retrieved with details_for transaction
(req) URL to which the buyer’s browser is returned after choosing to pay.
(req) URL to which the buyer is returned if the buyer cancels the order.
(opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.
(opt) Comment field which will be reported to Payflow backend (at manager.paypal.com) as Comment1
(opt) Comment field which will be reported to Payflow backend (at manager.paypal.com) as Comment2
Support for order line items is available, but has to be enabled on the PayFlow backend. This is what I was told by Todd Sieber at Technical Support:
You will need to call Payflow Support at 1-888-883-9770, choose option #2. Request that they update your account in “Pandora” under Product Settings >> PayPal Mark and update the Features Bitmap to 1111111111111112. This is 15 ones and a two.
See here for the forum discussion (requires login to x.com
(opt) Array of Order Line Items hashes. These are shown to the buyer after redirect to PayPal.
The following keys are supported for line items:
Name of line item
Description of line item
Line Item Amount in Cents (as Integer)
Line Item Quantity (default to 1 if left blank)
(opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.
(opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.
(opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.
(opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.
(opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.
# File lib/active_merchant/billing/gateways/payflow_express.rb, line 88 88: def credit(money, identification, options = {}) 89: deprecated CREDIT_DEPRECATION_MESSAGE 90: refund(money, identification, options) 91: end
# File lib/active_merchant/billing/gateways/payflow_express.rb, line 107 107: def details_for(token) 108: request = build_get_express_details_request(token) 109: commit(request, options) 110: end
# File lib/active_merchant/billing/gateways/payflow_express.rb, line 77 77: def purchase(money, options = {}) 78: requires!(options, :token, :payer_id) 79: request = build_sale_or_authorization_request('Sale', money, options) 80: commit(request, options) 81: end
# File lib/active_merchant/billing/gateways/payflow_express.rb, line 83 83: def refund(money, identification, options = {}) 84: request = build_reference_request(:credit, money, identification, options) 85: commit(request, options) 86: end
# File lib/active_merchant/billing/gateways/payflow_express.rb, line 100 100: def setup_purchase(money, options = {}) 101: requires!(options, :return_url, :cancel_return_url) 102: 103: request = build_setup_express_sale_or_authorization_request('Sale', money, options) 104: commit(request, options) 105: end
# File lib/active_merchant/billing/gateways/payflow_express.rb, line 149 149: def add_pay_data(xml, money, options) 150: xml.tag! 'PayData' do 151: xml.tag! 'Invoice' do 152: xml.tag! 'CustIP', options[:ip] unless options[:ip].blank? 153: xml.tag! 'InvNum', options[:order_id] unless options[:order_id].blank? 154: # Description field will be shown to buyer, unless line items are also being supplied (then only line items are shown). 155: xml.tag! 'Description', options[:description] unless options[:description].blank? 156: # Comment, Comment2 should make it to the backend at manager.paypal.com, as with Payflow credit card transactions 157: # but that doesn't seem to work (yet?). See: https://www.x.com/thread/51908?tstart=0 158: xml.tag! 'Comment', options[:comment] unless options[:comment].nil? 159: xml.tag!('ExtData', 'Name'=> 'COMMENT2', 'Value'=> options[:comment2]) unless options[:comment2].nil? 160: 161: billing_address = options[:billing_address] || options[:address] 162: add_address(xml, 'BillTo', billing_address, options) if billing_address 163: add_address(xml, 'ShipTo', options[:shipping_address], options) if options[:shipping_address] 164: 165: # Note: To get order line-items to show up with Payflow Express, this feature has to be enabled on the backend. 166: # Call Support at 888 883 9770, press 2. Then request that they update your account in "Pandora" under Product Settings >> PayPal 167: # Mark and update the Features Bitmap to 1111111111111112. This is 15 ones and a two. 168: # See here for the forum discussion: https://www.x.com/message/206214#206214 169: items = options[:items] || [] 170: items.each_with_index do |item, index| 171: xml.tag! 'ExtData', 'Name' => "L_DESC#{index}", 'Value' => item[:description] 172: xml.tag! 'ExtData', 'Name' => "L_COST#{index}", 'Value' => amount(item[:amount]) 173: xml.tag! 'ExtData', 'Name' => "L_QTY#{index}", 'Value' => item[:quantity] || '1' 174: xml.tag! 'ExtData', 'Name' => "L_NAME#{index}", 'Value' => item[:name] 175: # Note: An ItemURL is supported in Paypal Express (different API), but not PayFlow Express, as far as I can tell. 176: # L_URLn nor L_ITEMURLn seem to work 177: end 178: if items.any? 179: xml.tag! 'ExtData', 'Name' => 'CURRENCY', 'Value' => options[:currency] || currency(money) 180: xml.tag! 'ExtData', 'Name' => "ITEMAMT", 'Value' => amount(money) 181: end 182: 183: xml.tag! 'TotalAmt', amount(money), 'Currency' => options[:currency] || currency(money) 184: end 185: 186: xml.tag! 'Tender' do 187: add_paypal_details(xml, options) 188: end 189: end 190: end
# File lib/active_merchant/billing/gateways/payflow_express.rb, line 192 192: def add_paypal_details(xml, options) 193: xml.tag! 'PayPal' do 194: xml.tag! 'EMail', options[:email] unless options[:email].blank? 195: xml.tag! 'ReturnURL', options[:return_url] unless options[:return_url].blank? 196: xml.tag! 'CancelURL', options[:cancel_return_url] unless options[:cancel_return_url].blank? 197: xml.tag! 'NotifyURL', options[:notify_url] unless options[:notify_url].blank? 198: xml.tag! 'PayerID', options[:payer_id] unless options[:payer_id].blank? 199: xml.tag! 'Token', options[:token] unless options[:token].blank? 200: xml.tag! 'NoShipping', options[:no_shipping] ? '1' : '0' 201: xml.tag! 'AddressOverride', options[:address_override] ? '1' : '0' 202: xml.tag! 'ButtonSource', application_id.to_s.slice(0,32) unless application_id.blank? 203: 204: # Customization of the payment page 205: xml.tag! 'PageStyle', options[:page_style] unless options[:page_style].blank? 206: xml.tag! 'HeaderImage', options[:header_image] unless options[:header_image].blank? 207: xml.tag! 'PayflowColor', options[:background_color] unless options[:background_color].blank? 208: # Note: HeaderImage and PayflowColor apply to both the new (as of 2010) and the old checkout experience 209: # HeaderBackColor and HeaderBorderColor apply only to the old checkout experience which is being phased out. 210: xml.tag! 'HeaderBackColor', options[:header_background_color] unless options[:header_background_color].blank? 211: xml.tag! 'HeaderBorderColor', options[:header_border_color] unless options[:header_border_color].blank? 212: xml.tag! 'ExtData', 'Name' => 'ALLOWNOTE', 'Value' => options[:allow_note] 213: end 214: end
# File lib/active_merchant/billing/gateways/payflow_express.rb, line 113 113: def build_get_express_details_request(token) 114: xml = Builder::XmlMarkup.new :indent => 2 115: xml.tag! 'GetExpressCheckout' do 116: xml.tag! 'Authorization' do 117: xml.tag! 'PayData' do 118: xml.tag! 'Tender' do 119: xml.tag! 'PayPal' do 120: xml.tag! 'Token', token 121: end 122: end 123: end 124: end 125: end 126: xml.target! 127: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.