Class: ActiveMerchant::Billing::PayflowExpressGateway

Inherits:
Gateway
  • Object
show all
Includes:
PayflowCommonAPI, PaypalExpressCommon
Defined in:
lib/active_merchant/billing/gateways/payflow_express.rb

Overview

General Parameters

The following parameters are supported for #setup_authorization, #setup_purchase, #authorize and #purchase 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:

The following parameters are currently supported.

:ip

(opt) Customer IP Address

:order_id

(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 #”

:description

(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.

:billing_address

(opt) See ActiveMerchant::Billing::Gateway for details

:shipping_address

(opt) See ActiveMerchant::Billing::Gateway for details

:currency

(req) Currency of transaction, will be set to USD by default for PayFlow Express if not specified

:email

(opt) Email of buyer; used to pre-fill PayPal login screen

:payer_id

(opt) Unique PayPal buyer account identification number, as returned by details_for request

:token

(req for #authorize & #purchase) Token returned by setup transaction

:no_shipping

(opt) Boolean for whether or not to display shipping address to buyer

:address_override

(opt) Boolean. If true, display shipping address passed by parameters, rather than shipping address on file with PayPal

:allow_note

(opt) Boolean for permitting buyer to add note during checkout. Note contents can be retrieved with details_for transaction

:return_url

(req) URL to which the buyer’s browser is returned after choosing to pay.

:cancel_return_url

(req) URL to which the buyer is returned if the buyer cancels the order.

:notify_url

(opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.

:comment

(opt) Comment field which will be reported to Payflow backend (at manager.paypal.com) as Comment1

:comment2

(opt) Comment field which will be reported to Payflow backend (at manager.paypal.com) as Comment2

:discount

(opt) Total discounts in cents

Line Items

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

:items

(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

Name of line item

:description

Description of line item

:amount

Line Item Amount in Cents (as Integer)

:quantity

Line Item Quantity (default to 1 if left blank)

Customization of Payment Page

:page_style

(opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.

:header_image

(opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.

:background_color

(opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.

Additional options for old Checkout Experience, being phased out in 2010 and 2011

:header_background_color

(opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.

:header_border_color

(opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.

Direct Known Subclasses

PayflowExpressUkGateway

Constant Summary

Constants included from PayflowCommonAPI

ActiveMerchant::Billing::PayflowCommonAPI::CARD_MAPPING, ActiveMerchant::Billing::PayflowCommonAPI::CVV_CODE, ActiveMerchant::Billing::PayflowCommonAPI::TRANSACTIONS, ActiveMerchant::Billing::PayflowCommonAPI::XMLNS

Constants inherited from Gateway

Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods included from PaypalExpressCommon

included, #redirect_url, #redirect_url_for

Methods included from PayflowCommonAPI

#capture, included, #initialize, #void

Methods inherited from Gateway

#add_field_to_post_if_present, #add_fields_to_post_if_present, card_brand, #card_brand, #generate_unique_id, inherited, #initialize, #scrub, supported_countries, #supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #supports_scrubbing?, #test?

Methods included from CreditCardFormatting

#expdate, #format

Methods included from PostsData

included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request

Instance Method Details

#authorize(money, options = {}) ⇒ Object


69
70
71
72
73
# File 'lib/active_merchant/billing/gateways/payflow_express.rb', line 69

def authorize(money, options = {})
  requires!(options, :token, :payer_id)
  request = build_sale_or_authorization_request('Authorization', money, options)
  commit(request, options)
end

#credit(money, identification, options = {}) ⇒ Object


86
87
88
89
# File 'lib/active_merchant/billing/gateways/payflow_express.rb', line 86

def credit(money, identification, options = {})
  ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
  refund(money, identification, options)
end

#details_for(token) ⇒ Object


105
106
107
108
# File 'lib/active_merchant/billing/gateways/payflow_express.rb', line 105

def details_for(token)
  request = build_get_express_details_request(token)
  commit(request, options)
end

#purchase(money, options = {}) ⇒ Object


75
76
77
78
79
# File 'lib/active_merchant/billing/gateways/payflow_express.rb', line 75

def purchase(money, options = {})
  requires!(options, :token, :payer_id)
  request = build_sale_or_authorization_request('Sale', money, options)
  commit(request, options)
end

#refund(money, identification, options = {}) ⇒ Object


81
82
83
84
# File 'lib/active_merchant/billing/gateways/payflow_express.rb', line 81

def refund(money, identification, options = {})
  request = build_reference_request(:credit, money, identification, options)
  commit(request, options)
end

#setup_authorization(money, options = {}) ⇒ Object


91
92
93
94
95
96
# File 'lib/active_merchant/billing/gateways/payflow_express.rb', line 91

def setup_authorization(money, options = {})
  requires!(options, :return_url, :cancel_return_url)

  request = build_setup_express_sale_or_authorization_request('Authorization', money, options)
  commit(request, options)
end

#setup_purchase(money, options = {}) ⇒ Object


98
99
100
101
102
103
# File 'lib/active_merchant/billing/gateways/payflow_express.rb', line 98

def setup_purchase(money, options = {})
  requires!(options, :return_url, :cancel_return_url)

  request = build_setup_express_sale_or_authorization_request('Sale', money, options)
  commit(request, options)
end