Class: ActiveMerchant::Billing::FirstPayXmlGateway
- Includes:
- FirstPayCommon
- Defined in:
- lib/active_merchant/billing/gateways/first_pay/first_pay_xml.rb
Constant Summary
Constants inherited from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
- #authorize(money, payment, options = {}) ⇒ Object
- #capture(money, authorization, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ FirstPayXmlGateway
constructor
Creates a new FirstPayXmlGateway.
- #purchase(money, payment, options = {}) ⇒ Object
- #refund(money, authorization, options = {}) ⇒ Object
- #scrub(transcript) ⇒ Object
- #void(authorization, options = {}) ⇒ Object
Methods included from FirstPayCommon
included, #supports_scrubbing?
Methods inherited from Gateway
#add_field_to_post_if_present, #add_fields_to_post_if_present, #card_brand, card_brand, #generate_unique_id, inherited, #supported_countries, supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #supports_scrubbing?, #test?
Methods included from CreditCardFormatting
#expdate, #format, #strftime_yyyymm
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
#initialize(options = {}) ⇒ FirstPayXmlGateway
Creates a new FirstPayXmlGateway
The gateway requires two values for connection to be passed in the options
hash
Options
-
:gateway_id
– FirstPay’s gateway_id (REQUIRED) -
:transaction_center_id
– FirstPay’s transaction_center_id or processorId (REQUIRED) Otherwise, perform transactions against the production server.
21 22 23 24 |
# File 'lib/active_merchant/billing/gateways/first_pay/first_pay_xml.rb', line 21 def initialize( = {}) requires!(, :gateway_id, :transaction_center_id) super end |
Instance Method Details
#authorize(money, payment, options = {}) ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/active_merchant/billing/gateways/first_pay/first_pay_xml.rb', line 36 def (money, payment, = {}) post = {} add_invoice(post, money, ) add_payment(post, payment, ) add_address(post, payment, ) add_customer_data(post, ) commit('auth', post) end |
#capture(money, authorization, options = {}) ⇒ Object
46 47 48 49 50 |
# File 'lib/active_merchant/billing/gateways/first_pay/first_pay_xml.rb', line 46 def capture(money, , = {}) post = {} add_reference(post, 'settle', money, ) commit('settle', post) end |
#purchase(money, payment, options = {}) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/active_merchant/billing/gateways/first_pay/first_pay_xml.rb', line 26 def purchase(money, payment, = {}) post = {} add_invoice(post, money, ) add_payment(post, payment, ) add_address(post, payment, ) add_customer_data(post, ) commit('sale', post) end |
#refund(money, authorization, options = {}) ⇒ Object
52 53 54 55 56 |
# File 'lib/active_merchant/billing/gateways/first_pay/first_pay_xml.rb', line 52 def refund(money, , = {}) post = {} add_reference(post, 'credit', money, ) commit('credit', post) end |
#scrub(transcript) ⇒ Object
64 65 66 67 68 69 |
# File 'lib/active_merchant/billing/gateways/first_pay/first_pay_xml.rb', line 64 def scrub(transcript) transcript. gsub(%r((gateway_id)[^<]*(</FIELD>))i, '\1[FILTERED]\2'). gsub(%r((card_number)[^<]*(</FIELD>))i, '\1[FILTERED]\2'). gsub(%r((cvv2)[^<]*(</FIELD>))i, '\1[FILTERED]\2') end |
#void(authorization, options = {}) ⇒ Object
58 59 60 61 62 |
# File 'lib/active_merchant/billing/gateways/first_pay/first_pay_xml.rb', line 58 def void(, = {}) post = {} add_reference(post, 'void', nil, ) commit('void', post) end |