activemerchant 1.79.2 → 1.80.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +33 -0
- data/README.md +10 -2
- data/lib/active_merchant.rb +1 -1
- data/lib/active_merchant/billing/check.rb +4 -4
- data/lib/active_merchant/billing/compatibility.rb +1 -1
- data/lib/active_merchant/billing/credit_card.rb +21 -21
- data/lib/active_merchant/billing/credit_card_formatting.rb +2 -2
- data/lib/active_merchant/billing/credit_card_methods.rb +2 -2
- data/lib/active_merchant/billing/gateway.rb +13 -13
- data/lib/active_merchant/billing/gateways/adyen.rb +31 -15
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +22 -22
- data/lib/active_merchant/billing/gateways/authorize_net.rb +72 -72
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -3
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +3 -3
- data/lib/active_merchant/billing/gateways/axcessms.rb +51 -51
- data/lib/active_merchant/billing/gateways/balanced.rb +29 -29
- data/lib/active_merchant/billing/gateways/bank_frick.rb +3 -3
- data/lib/active_merchant/billing/gateways/banwire.rb +8 -8
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +5 -5
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +6 -6
- data/lib/active_merchant/billing/gateways/be2bill.rb +2 -2
- data/lib/active_merchant/billing/gateways/beanstream.rb +1 -1
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +69 -69
- data/lib/active_merchant/billing/gateways/blue_pay.rb +19 -19
- data/lib/active_merchant/billing/gateways/blue_snap.rb +42 -42
- data/lib/active_merchant/billing/gateways/bogus.rb +10 -10
- data/lib/active_merchant/billing/gateways/borgun.rb +10 -10
- data/lib/active_merchant/billing/gateways/bpoint.rb +1 -1
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +2 -2
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +94 -94
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +1 -1
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +39 -39
- data/lib/active_merchant/billing/gateways/cams.rb +12 -12
- data/lib/active_merchant/billing/gateways/card_connect.rb +38 -13
- data/lib/active_merchant/billing/gateways/card_stream.rb +116 -116
- data/lib/active_merchant/billing/gateways/cardknox.rb +7 -7
- data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
- data/lib/active_merchant/billing/gateways/cashnet.rb +10 -10
- data/lib/active_merchant/billing/gateways/cc5.rb +3 -5
- data/lib/active_merchant/billing/gateways/cecabank.rb +6 -6
- data/lib/active_merchant/billing/gateways/cenpos.rb +36 -36
- data/lib/active_merchant/billing/gateways/checkout.rb +5 -5
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +31 -31
- data/lib/active_merchant/billing/gateways/clearhaus.rb +5 -5
- data/lib/active_merchant/billing/gateways/commercegate.rb +6 -6
- data/lib/active_merchant/billing/gateways/conekta.rb +24 -19
- data/lib/active_merchant/billing/gateways/creditcall.rb +41 -41
- data/lib/active_merchant/billing/gateways/credorax.rb +104 -103
- data/lib/active_merchant/billing/gateways/culqi.rb +25 -25
- data/lib/active_merchant/billing/gateways/cyber_source.rb +65 -65
- data/lib/active_merchant/billing/gateways/data_cash.rb +4 -4
- data/lib/active_merchant/billing/gateways/dibs.rb +24 -24
- data/lib/active_merchant/billing/gateways/digitzs.rb +35 -35
- data/lib/active_merchant/billing/gateways/ebanx.rb +26 -26
- data/lib/active_merchant/billing/gateways/efsnet.rb +10 -10
- data/lib/active_merchant/billing/gateways/elavon.rb +5 -5
- data/lib/active_merchant/billing/gateways/element.rb +35 -35
- data/lib/active_merchant/billing/gateways/epay.rb +4 -4
- data/lib/active_merchant/billing/gateways/evo_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway.rb +65 -65
- data/lib/active_merchant/billing/gateways/eway_managed.rb +11 -11
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +31 -31
- data/lib/active_merchant/billing/gateways/exact.rb +12 -12
- data/lib/active_merchant/billing/gateways/ezic.rb +13 -13
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +24 -24
- data/lib/active_merchant/billing/gateways/federated_canada.rb +3 -3
- data/lib/active_merchant/billing/gateways/first_giving.rb +16 -16
- data/lib/active_merchant/billing/gateways/first_pay.rb +7 -4
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +71 -71
- data/lib/active_merchant/billing/gateways/flo2cash.rb +12 -12
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
- data/lib/active_merchant/billing/gateways/forte.rb +26 -16
- data/lib/active_merchant/billing/gateways/garanti.rb +10 -12
- data/lib/active_merchant/billing/gateways/global_collect.rb +88 -88
- data/lib/active_merchant/billing/gateways/global_transport.rb +4 -4
- data/lib/active_merchant/billing/gateways/hdfc.rb +33 -33
- data/lib/active_merchant/billing/gateways/hps.rb +28 -28
- data/lib/active_merchant/billing/gateways/iats_payments.rb +26 -26
- data/lib/active_merchant/billing/gateways/inspire.rb +15 -15
- data/lib/active_merchant/billing/gateways/instapay.rb +4 -4
- data/lib/active_merchant/billing/gateways/ipp.rb +17 -17
- data/lib/active_merchant/billing/gateways/iridium.rb +207 -207
- data/lib/active_merchant/billing/gateways/iveri.rb +8 -8
- data/lib/active_merchant/billing/gateways/jetpay.rb +134 -134
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +141 -141
- data/lib/active_merchant/billing/gateways/komoju.rb +15 -15
- data/lib/active_merchant/billing/gateways/kushki.rb +31 -37
- data/lib/active_merchant/billing/gateways/latitude19.rb +64 -64
- data/lib/active_merchant/billing/gateways/linkpoint.rb +22 -22
- data/lib/active_merchant/billing/gateways/litle.rb +4 -4
- data/lib/active_merchant/billing/gateways/mastercard.rb +3 -3
- data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +28 -28
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +9 -9
- data/lib/active_merchant/billing/gateways/merchant_one.rb +6 -6
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +24 -24
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +49 -49
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +36 -36
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +4 -4
- data/lib/active_merchant/billing/gateways/mercury.rb +28 -28
- data/lib/active_merchant/billing/gateways/metrics_global.rb +7 -7
- data/lib/active_merchant/billing/gateways/micropayment.rb +31 -31
- data/lib/active_merchant/billing/gateways/migs.rb +11 -9
- data/lib/active_merchant/billing/gateways/modern_payments.rb +1 -1
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +16 -16
- data/lib/active_merchant/billing/gateways/monei.rb +5 -5
- data/lib/active_merchant/billing/gateways/moneris.rb +26 -26
- data/lib/active_merchant/billing/gateways/moneris_us.rb +81 -37
- data/lib/active_merchant/billing/gateways/money_movers.rb +3 -3
- data/lib/active_merchant/billing/gateways/mundipagg.rb +1 -1
- data/lib/active_merchant/billing/gateways/nab_transact.rb +6 -6
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +3 -3
- data/lib/active_merchant/billing/gateways/netaxept.rb +15 -15
- data/lib/active_merchant/billing/gateways/netbanx.rb +2 -2
- data/lib/active_merchant/billing/gateways/netbilling.rb +1 -1
- data/lib/active_merchant/billing/gateways/netpay.rb +5 -5
- data/lib/active_merchant/billing/gateways/nmi.rb +18 -18
- data/lib/active_merchant/billing/gateways/ogone.rb +22 -22
- data/lib/active_merchant/billing/gateways/omise.rb +3 -3
- data/lib/active_merchant/billing/gateways/openpay.rb +6 -4
- data/lib/active_merchant/billing/gateways/opp.rb +4 -4
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +2 -2
- data/lib/active_merchant/billing/gateways/orbital.rb +61 -61
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +4 -4
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +5 -5
- data/lib/active_merchant/billing/gateways/pagarme.rb +27 -27
- data/lib/active_merchant/billing/gateways/pago_facil.rb +8 -8
- data/lib/active_merchant/billing/gateways/pay_conex.rb +25 -25
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +32 -32
- data/lib/active_merchant/billing/gateways/pay_hub.rb +29 -29
- data/lib/active_merchant/billing/gateways/pay_junction.rb +7 -7
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +30 -30
- data/lib/active_merchant/billing/gateways/pay_secure.rb +4 -4
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +15 -15
- data/lib/active_merchant/billing/gateways/payeezy.rb +5 -5
- data/lib/active_merchant/billing/gateways/payex.rb +4 -4
- data/lib/active_merchant/billing/gateways/payflow.rb +7 -7
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +23 -22
- data/lib/active_merchant/billing/gateways/payflow_express.rb +2 -2
- data/lib/active_merchant/billing/gateways/payment_express.rb +40 -37
- data/lib/active_merchant/billing/gateways/paymentez.rb +11 -3
- data/lib/active_merchant/billing/gateways/paymill.rb +115 -115
- data/lib/active_merchant/billing/gateways/paypal.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +1 -1
- data/lib/active_merchant/billing/gateways/payscout.rb +1 -1
- data/lib/active_merchant/billing/gateways/paystation.rb +14 -14
- data/lib/active_merchant/billing/gateways/payu_in.rb +43 -43
- data/lib/active_merchant/billing/gateways/payu_latam.rb +41 -41
- data/lib/active_merchant/billing/gateways/payway.rb +6 -6
- data/lib/active_merchant/billing/gateways/pin.rb +7 -7
- data/lib/active_merchant/billing/gateways/plugnpay.rb +62 -62
- data/lib/active_merchant/billing/gateways/pro_pay.rb +123 -123
- data/lib/active_merchant/billing/gateways/psigate.rb +16 -16
- data/lib/active_merchant/billing/gateways/psl_card.rb +13 -13
- data/lib/active_merchant/billing/gateways/qbms.rb +52 -52
- data/lib/active_merchant/billing/gateways/quantum.rb +5 -5
- data/lib/active_merchant/billing/gateways/quickbooks.rb +10 -10
- data/lib/active_merchant/billing/gateways/quickpay.rb +1 -1
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +11 -11
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +3 -3
- data/lib/active_merchant/billing/gateways/qvalent.rb +55 -55
- data/lib/active_merchant/billing/gateways/realex.rb +16 -15
- data/lib/active_merchant/billing/gateways/redsys.rb +128 -121
- data/lib/active_merchant/billing/gateways/s5.rb +5 -5
- data/lib/active_merchant/billing/gateways/safe_charge.rb +16 -16
- data/lib/active_merchant/billing/gateways/sage.rb +20 -20
- data/lib/active_merchant/billing/gateways/sage_pay.rb +32 -32
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +11 -11
- data/lib/active_merchant/billing/gateways/secure_net.rb +19 -19
- data/lib/active_merchant/billing/gateways/secure_pay.rb +5 -5
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +7 -7
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +9 -9
- data/lib/active_merchant/billing/gateways/securion_pay.rb +12 -12
- data/lib/active_merchant/billing/gateways/skip_jack.rb +28 -28
- data/lib/active_merchant/billing/gateways/smart_ps.rb +31 -31
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +3 -3
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +1 -1
- data/lib/active_merchant/billing/gateways/stripe.rb +63 -63
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +5 -5
- data/lib/active_merchant/billing/gateways/telr.rb +26 -26
- data/lib/active_merchant/billing/gateways/trans_first.rb +28 -28
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +224 -224
- data/lib/active_merchant/billing/gateways/transact_pro.rb +7 -7
- data/lib/active_merchant/billing/gateways/transnational.rb +1 -1
- data/lib/active_merchant/billing/gateways/trexle.rb +5 -5
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +38 -38
- data/lib/active_merchant/billing/gateways/usa_epay.rb +3 -3
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +37 -37
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +3 -3
- data/lib/active_merchant/billing/gateways/vanco.rb +25 -25
- data/lib/active_merchant/billing/gateways/verifi.rb +40 -40
- data/lib/active_merchant/billing/gateways/viaklix.rb +5 -5
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +64 -36
- data/lib/active_merchant/billing/gateways/webpay.rb +8 -8
- data/lib/active_merchant/billing/gateways/wepay.rb +25 -25
- data/lib/active_merchant/billing/gateways/wirecard.rb +26 -26
- data/lib/active_merchant/billing/gateways/worldpay.rb +15 -15
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +42 -42
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +17 -17
- data/lib/active_merchant/billing/model.rb +2 -2
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +1 -1
- data/lib/active_merchant/billing/rails.rb +1 -1
- data/lib/active_merchant/connection.rb +10 -8
- data/lib/active_merchant/country.rb +1 -1
- data/lib/active_merchant/net_http_ssl_connection.rb +1 -0
- data/lib/active_merchant/network_connection_retries.rb +12 -12
- data/lib/active_merchant/post_data.rb +1 -1
- data/lib/active_merchant/posts_data.rb +1 -1
- data/lib/active_merchant/version.rb +1 -1
- data/lib/certs/cacert.pem +37 -0
- data/lib/support/gateway_support.rb +2 -2
- data/lib/support/ssl_verify.rb +5 -5
- data/lib/support/ssl_version.rb +7 -7
- metadata +3 -7
- data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +0 -246
- data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +0 -13
- data/lib/active_merchant/billing/gateways/ideal/ideal_response.rb +0 -29
- data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +0 -66
|
@@ -15,19 +15,19 @@ module ActiveMerchant #:nodoc:
|
|
|
15
15
|
DECLINED = 'The transaction was declined'
|
|
16
16
|
|
|
17
17
|
ACTIONS = {
|
|
18
|
-
purchase:
|
|
19
|
-
purchase_echeck:
|
|
20
|
-
refund:
|
|
21
|
-
refund_echeck:
|
|
22
|
-
void:
|
|
18
|
+
purchase: 'CCSale',
|
|
19
|
+
purchase_echeck: 'ACHDebit',
|
|
20
|
+
refund: 'CreditCardCredit',
|
|
21
|
+
refund_echeck: 'ACHVoidTransaction',
|
|
22
|
+
void: 'CreditCardAutoRefundorVoid',
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
ENDPOINTS = {
|
|
26
|
-
purchase:
|
|
27
|
-
purchase_echeck:
|
|
28
|
-
refund:
|
|
29
|
-
refund_echeck:
|
|
30
|
-
void:
|
|
26
|
+
purchase: 'creditcard.asmx',
|
|
27
|
+
purchase_echeck: 'checkverifyws/checkverifyws.asmx',
|
|
28
|
+
refund: 'creditcard.asmx',
|
|
29
|
+
refund_echeck: 'checkverifyws/checkverifyws.asmx',
|
|
30
|
+
void: 'creditcard.asmx'
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
def initialize(options = {})
|
|
@@ -55,7 +55,7 @@ module ActiveMerchant #:nodoc:
|
|
|
55
55
|
add_pair(post, :TransID, transaction_id)
|
|
56
56
|
add_pair(post, :RefID, options[:order_id], required: true)
|
|
57
57
|
|
|
58
|
-
commit((payment_type ==
|
|
58
|
+
commit((payment_type == 'check' ? :refund_echeck : :refund), post)
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
def void(authorization, options={})
|
|
@@ -93,8 +93,8 @@ module ActiveMerchant #:nodoc:
|
|
|
93
93
|
add_pair(post, :Address, address[:address1], required: true)
|
|
94
94
|
add_pair(post, :ZipCode, address[:zip], required: true)
|
|
95
95
|
else
|
|
96
|
-
add_pair(post, :Address,
|
|
97
|
-
add_pair(post, :ZipCode,
|
|
96
|
+
add_pair(post, :Address, '', required: true)
|
|
97
|
+
add_pair(post, :ZipCode, '', required: true)
|
|
98
98
|
end
|
|
99
99
|
end
|
|
100
100
|
|
|
@@ -103,8 +103,8 @@ module ActiveMerchant #:nodoc:
|
|
|
103
103
|
add_pair(post, :PONumber, options[:invoice], required: true)
|
|
104
104
|
add_pair(post, :SaleTaxAmount, amount(options[:tax] || 0))
|
|
105
105
|
add_pair(post, :TaxIndicator, 0)
|
|
106
|
-
add_pair(post, :PaymentDesc, options[:description] ||
|
|
107
|
-
add_pair(post, :CompanyName, options[:company_name] ||
|
|
106
|
+
add_pair(post, :PaymentDesc, options[:description] || '', required: true)
|
|
107
|
+
add_pair(post, :CompanyName, options[:company_name] || '', required: true)
|
|
108
108
|
end
|
|
109
109
|
|
|
110
110
|
def add_payment(post, payment)
|
|
@@ -125,11 +125,11 @@ module ActiveMerchant #:nodoc:
|
|
|
125
125
|
def add_echeck(post, payment)
|
|
126
126
|
add_pair(post, :TransRoute, payment.routing_number, required: true)
|
|
127
127
|
add_pair(post, :BankAccountNo, payment.account_number, required: true)
|
|
128
|
-
add_pair(post, :BankAccountType, add_or_use_default(payment.account_type,
|
|
129
|
-
add_pair(post, :CheckType, add_or_use_default(payment.account_holder_type,
|
|
128
|
+
add_pair(post, :BankAccountType, add_or_use_default(payment.account_type, 'Checking'), required: true)
|
|
129
|
+
add_pair(post, :CheckType, add_or_use_default(payment.account_holder_type, 'Personal'), required: true)
|
|
130
130
|
add_pair(post, :Name, payment.name, required: true)
|
|
131
|
-
add_pair(post, :ProcessDate, Time.now.strftime(
|
|
132
|
-
add_pair(post, :Description,
|
|
131
|
+
add_pair(post, :ProcessDate, Time.now.strftime('%m%d%y'), required: true)
|
|
132
|
+
add_pair(post, :Description, '', required: true)
|
|
133
133
|
end
|
|
134
134
|
|
|
135
135
|
def add_or_use_default(payment_data, default_value)
|
|
@@ -141,7 +141,7 @@ module ActiveMerchant #:nodoc:
|
|
|
141
141
|
return unless action == :purchase
|
|
142
142
|
|
|
143
143
|
UNUSED_CREDIT_CARD_FIELDS.each do |f|
|
|
144
|
-
post[f] =
|
|
144
|
+
post[f] = ''
|
|
145
145
|
end
|
|
146
146
|
end
|
|
147
147
|
|
|
@@ -156,7 +156,7 @@ module ActiveMerchant #:nodoc:
|
|
|
156
156
|
response = {}
|
|
157
157
|
|
|
158
158
|
xml = REXML::Document.new(data)
|
|
159
|
-
root = REXML::XPath.first(xml,
|
|
159
|
+
root = REXML::XPath.first(xml, '*')
|
|
160
160
|
|
|
161
161
|
if root.nil?
|
|
162
162
|
response[:message] = data.to_s.strip
|
|
@@ -183,7 +183,7 @@ module ActiveMerchant #:nodoc:
|
|
|
183
183
|
end
|
|
184
184
|
|
|
185
185
|
def authorization_from(response)
|
|
186
|
-
if response[:status] ==
|
|
186
|
+
if response[:status] == 'APPROVED'
|
|
187
187
|
"#{response[:trans_id]}|check"
|
|
188
188
|
else
|
|
189
189
|
"#{response[:trans_id]}|creditcard"
|
|
@@ -192,13 +192,13 @@ module ActiveMerchant #:nodoc:
|
|
|
192
192
|
|
|
193
193
|
def success_from(response)
|
|
194
194
|
case response[:status]
|
|
195
|
-
when
|
|
195
|
+
when 'Authorized'
|
|
196
196
|
true
|
|
197
|
-
when
|
|
197
|
+
when 'Voided'
|
|
198
198
|
true
|
|
199
|
-
when
|
|
199
|
+
when 'APPROVED'
|
|
200
200
|
true
|
|
201
|
-
when
|
|
201
|
+
when 'VOIDED'
|
|
202
202
|
true
|
|
203
203
|
else
|
|
204
204
|
false
|
|
@@ -219,7 +219,7 @@ module ActiveMerchant #:nodoc:
|
|
|
219
219
|
params[:MerchantID] = @options[:login]
|
|
220
220
|
params[:RegKey] = @options[:password]
|
|
221
221
|
|
|
222
|
-
request = params.collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join(
|
|
222
|
+
request = params.collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
|
|
223
223
|
request
|
|
224
224
|
end
|
|
225
225
|
|
|
@@ -233,7 +233,7 @@ module ActiveMerchant #:nodoc:
|
|
|
233
233
|
end
|
|
234
234
|
|
|
235
235
|
def split_authorization(authorization)
|
|
236
|
-
authorization.split(
|
|
236
|
+
authorization.split('|')
|
|
237
237
|
end
|
|
238
238
|
end
|
|
239
239
|
end
|
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
require
|
|
1
|
+
require 'nokogiri'
|
|
2
2
|
|
|
3
3
|
module ActiveMerchant #:nodoc:
|
|
4
4
|
module Billing #:nodoc:
|
|
5
5
|
class TransFirstTransactionExpressGateway < Gateway
|
|
6
|
-
self.display_name =
|
|
7
|
-
self.homepage_url =
|
|
6
|
+
self.display_name = 'TransFirst Transaction Express'
|
|
7
|
+
self.homepage_url = 'http://transactionexpress.com/'
|
|
8
8
|
|
|
9
|
-
self.test_url =
|
|
10
|
-
self.live_url =
|
|
9
|
+
self.test_url = 'https://ws.cert.transactionexpress.com/portal/merchantframework/MerchantWebServices-v1?wsdl'
|
|
10
|
+
self.live_url = 'https://ws.transactionexpress.com/portal/merchantframework/MerchantWebServices-v1?wsdl'
|
|
11
11
|
|
|
12
|
-
self.supported_countries = [
|
|
13
|
-
self.default_currency =
|
|
12
|
+
self.supported_countries = ['US']
|
|
13
|
+
self.default_currency = 'USD'
|
|
14
14
|
self.money_format = :cents
|
|
15
15
|
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club]
|
|
16
16
|
|
|
17
|
-
V1_NAMESPACE =
|
|
18
|
-
SOAPENV_NAMESPACE =
|
|
19
|
-
AUTHORIZATION_FIELD_SEPARATOR =
|
|
17
|
+
V1_NAMESPACE = 'http://postilion/realtime/merchantframework/xsd/v1/'
|
|
18
|
+
SOAPENV_NAMESPACE = 'http://schemas.xmlsoap.org/soap/envelope/'
|
|
19
|
+
AUTHORIZATION_FIELD_SEPARATOR = '|'
|
|
20
20
|
|
|
21
21
|
APPROVAL_CODES = %w(00 10)
|
|
22
22
|
|
|
23
23
|
RESPONSE_MESSAGES = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
24
|
+
'00' => 'Approved',
|
|
25
|
+
'01' => 'Refer to card issuer',
|
|
26
|
+
'02' => 'Refer to card issuer, special condition',
|
|
27
|
+
'03' => 'Invalid merchant',
|
|
28
|
+
'04' => 'Pick-up card',
|
|
29
|
+
'05' => 'Do not honor',
|
|
30
|
+
'06' => 'Error',
|
|
31
|
+
'07' => 'Pick-up card, special condition',
|
|
32
|
+
'08' => 'Honor with identification',
|
|
33
|
+
'09' => 'Request in progress',
|
|
34
|
+
'10' => 'Approved, partial authorization',
|
|
35
|
+
'11' => 'VIP Approval',
|
|
36
|
+
'12' => 'Invalid transaction',
|
|
37
|
+
'13' => 'Invalid amount',
|
|
38
|
+
'14' => 'Invalid card number',
|
|
39
|
+
'15' => 'No such issuer',
|
|
40
|
+
'16' => 'Approved, update track 3',
|
|
41
|
+
'17' => 'Customer cancellation',
|
|
42
|
+
'18' => 'Customer dispute',
|
|
43
|
+
'19' => 'Re-enter transaction',
|
|
44
|
+
'20' => 'Invalid response',
|
|
45
|
+
'21' => 'No action taken',
|
|
46
|
+
'22' => 'Suspected malfunction',
|
|
47
|
+
'23' => 'Unacceptable transaction fee',
|
|
48
|
+
'24' => 'File update not supported',
|
|
49
|
+
'25' => 'Unable to locate record',
|
|
50
|
+
'26' => 'Duplicate record',
|
|
51
|
+
'27' => 'File update field edit error',
|
|
52
|
+
'28' => 'File update file locked',
|
|
53
|
+
'29' => 'File update failed',
|
|
54
|
+
'30' => 'Format error',
|
|
55
|
+
'31' => 'Bank not supported',
|
|
56
|
+
'33' => 'Expired card, pick-up',
|
|
57
|
+
'34' => 'Suspected fraud, pick-up',
|
|
58
|
+
'35' => 'Contact acquirer, pick-up',
|
|
59
|
+
'36' => 'Restricted card, pick-up',
|
|
60
|
+
'37' => 'Call acquirer security, pick-up',
|
|
61
|
+
'38' => 'PIN tries exceeded, pick-up',
|
|
62
|
+
'39' => 'No credit account',
|
|
63
|
+
'40' => 'Function not supported',
|
|
64
|
+
'41' => 'Lost card, pick-up',
|
|
65
|
+
'42' => 'No universal account',
|
|
66
|
+
'43' => 'Stolen card, pick-up',
|
|
67
|
+
'44' => 'No investment account',
|
|
68
|
+
'45' => 'Account closed',
|
|
69
|
+
'46' => 'Identification required',
|
|
70
|
+
'47' => 'Identification cross-check required',
|
|
71
|
+
'48' => 'No customer record',
|
|
72
|
+
'49' => 'Reserved for future Realtime use',
|
|
73
|
+
'50' => 'Reserved for future Realtime use',
|
|
74
|
+
'51' => 'Not sufficient funds',
|
|
75
|
+
'52' => 'No checking account',
|
|
76
|
+
'53' => 'No savings account',
|
|
77
|
+
'54' => 'Expired card',
|
|
78
|
+
'55' => 'Incorrect PIN',
|
|
79
|
+
'56' => 'No card record',
|
|
80
|
+
'57' => 'Transaction not permitted to cardholder',
|
|
81
|
+
'58' => 'Transaction not permitted on terminal',
|
|
82
|
+
'59' => 'Suspected fraud',
|
|
83
|
+
'60' => 'Contact acquirer',
|
|
84
|
+
'61' => 'Exceeds withdrawal limit',
|
|
85
|
+
'62' => 'Restricted card',
|
|
86
|
+
'63' => 'Security violation',
|
|
87
|
+
'64' => 'Original amount incorrect',
|
|
88
|
+
'65' => 'Exceeds withdrawal frequency',
|
|
89
|
+
'66' => 'Call acquirer security',
|
|
90
|
+
'67' => 'Hard capture',
|
|
91
|
+
'68' => 'Response received too late',
|
|
92
|
+
'69' => 'Advice received too late (the response from a request was received too late )',
|
|
93
|
+
'70' => 'Reserved for future use',
|
|
94
|
+
'71' => 'Reserved for future Realtime use',
|
|
95
|
+
'72' => 'Reserved for future Realtime use',
|
|
96
|
+
'73' => 'Reserved for future Realtime use',
|
|
97
|
+
'74' => 'Reserved for future Realtime use',
|
|
98
|
+
'75' => 'PIN tries exceeded',
|
|
99
|
+
'76' => 'Reversal: Unable to locate previous message (no match on Retrieval Reference Number)/ Reserved for future Realtime use',
|
|
100
|
+
'77' => 'Previous message located for a repeat or reversal, but repeat or reversal data is inconsistent with original message/ Intervene, bank approval required',
|
|
101
|
+
'78' => 'Invalid/non-existent account – Decline (MasterCard specific)/ Intervene, bank approval required for partial amount',
|
|
102
|
+
'79' => 'Already reversed (by Switch)/ Reserved for client-specific use (declined)',
|
|
103
|
+
'80' => 'No financial Impact (Reserved for declined debit)/ Reserved for client-specific use (declined)',
|
|
104
|
+
'81' => 'PIN cryptographic error found by the Visa security module during PIN decryption/ Reserved for client-specific use (declined)',
|
|
105
|
+
'82' => 'Incorrect CVV/ Reserved for client-specific use (declined)',
|
|
106
|
+
'83' => 'Unable to verify PIN/ Reserved for client-specific use (declined)',
|
|
107
|
+
'84' => 'Invalid Authorization Life Cycle – Decline (MasterCard) or Duplicate Transaction Detected (Visa)/ Reserved for client-specific use (declined)',
|
|
108
|
+
'85' => 'No reason to decline a request for Account Number Verification or Address Verification/ Reserved for client-specific use (declined)',
|
|
109
|
+
'86' => 'Cannot verify PIN/ Reserved for client-specific use (declined)',
|
|
110
|
+
'87' => 'Reserved for client-specific use (declined)',
|
|
111
|
+
'88' => 'Reserved for client-specific use (declined)',
|
|
112
|
+
'89' => 'Reserved for client-specific use (declined)',
|
|
113
|
+
'90' => 'Cut-off in progress',
|
|
114
|
+
'91' => 'Issuer or switch inoperative',
|
|
115
|
+
'92' => 'Routing error',
|
|
116
|
+
'93' => 'Violation of law',
|
|
117
|
+
'94' => 'Duplicate Transmission (Integrated Debit and MasterCard)',
|
|
118
|
+
'95' => 'Reconcile error',
|
|
119
|
+
'96' => 'System malfunction',
|
|
120
|
+
'97' => 'Reserved for future Realtime use',
|
|
121
|
+
'98' => 'Exceeds cash limit',
|
|
122
|
+
'99' => 'Reserved for future Realtime use',
|
|
123
|
+
'1106' => 'Reserved for future Realtime use',
|
|
124
|
+
'0A' => 'Reserved for future Realtime use',
|
|
125
|
+
'A0' => 'Reserved for future Realtime use',
|
|
126
|
+
'A1' => 'ATC not incremented',
|
|
127
|
+
'A2' => 'ATC limit exceeded',
|
|
128
|
+
'A3' => 'ATC configuration error',
|
|
129
|
+
'A4' => 'CVR check failure',
|
|
130
|
+
'A5' => 'CVR configuration error',
|
|
131
|
+
'A6' => 'TVR check failure',
|
|
132
|
+
'A7' => 'TVR configuration error',
|
|
133
|
+
'A8' => 'Reserved for future Realtime use',
|
|
134
|
+
'B1' => 'Surcharge amount not permitted on Visa cards or EBT Food Stamps/ Reserved for future Realtime use',
|
|
135
|
+
'B2' => 'Surcharge amount not supported by debit network issuer/ Reserved for future Realtime use',
|
|
136
|
+
'C1' => 'Unacceptable PIN',
|
|
137
|
+
'C2' => 'PIN Change failed',
|
|
138
|
+
'C3' => 'PIN Unblock failed',
|
|
139
|
+
'D1' => 'MAC Error',
|
|
140
|
+
'E1' => 'Prepay error',
|
|
141
|
+
'N1' => 'Network Error within the TXP platform',
|
|
142
|
+
'N0' => 'Force STIP/ Reserved for client-specific use (declined)',
|
|
143
|
+
'N3' => 'Cash service not available/ Reserved for client-specific use (declined)',
|
|
144
|
+
'N4' => 'Cash request exceeds Issuer limit/ Reserved for client-specific use (declined)',
|
|
145
|
+
'N5' => 'Ineligible for re-submission/ Reserved for client-specific use (declined)',
|
|
146
|
+
'N7' => 'Decline for CVV2 failure/ Reserved for client-specific use (declined)',
|
|
147
|
+
'N8' => 'Transaction amount exceeds preauthorized approval amount/ Reserved for client-specific use (declined)',
|
|
148
|
+
'P0' => 'Approved; PVID code is missing, invalid, or has expired',
|
|
149
|
+
'P1' => 'Declined; PVID code is missing, invalid, or has expired/ Reserved for client-specific use (declined)',
|
|
150
|
+
'P2' => 'Invalid biller Information/ Reserved for client-specific use (declined)/ Reserved for client-specific use (declined)',
|
|
151
|
+
'R0' => 'The transaction was declined or returned, because the cardholder requested that payment of a specific recurring or installment payment transaction be stopped/ Reserved for client-specific use (declined)',
|
|
152
|
+
'R1' => 'The transaction was declined or returned, because the cardholder requested that payment of all recurring or installment payment transactions for a specific merchant account be stopped/ Reserved for client-specific use (declined)',
|
|
153
|
+
'Q1' => 'Card Authentication failed/ Reserved for client-specific use (declined)',
|
|
154
|
+
'XA' => 'Forward to Issuer/ Reserved for client-specific use (declined)',
|
|
155
|
+
'XD' => 'Forward to Issuer/ Reserved for client-specific use (declined)',
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
EXTENDED_RESPONSE_MESSAGES = {
|
|
159
|
-
|
|
159
|
+
'B40K' => 'Declined Post – Credit linked to unextracted settle transaction'
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
TRANSACTION_CODES = {
|
|
@@ -290,14 +290,14 @@ module ActiveMerchant #:nodoc:
|
|
|
290
290
|
|
|
291
291
|
MultiResponse.run do |r|
|
|
292
292
|
r.process { commit(:store, store_customer_request) }
|
|
293
|
-
return r unless r.success? && r.params[
|
|
294
|
-
customer_id = r.params[
|
|
293
|
+
return r unless r.success? && r.params['custId']
|
|
294
|
+
customer_id = r.params['custId']
|
|
295
295
|
|
|
296
296
|
store_payment_method_request = build_xml_payment_storage_request do |doc|
|
|
297
|
-
doc[
|
|
297
|
+
doc['v1'].cust do
|
|
298
298
|
add_customer_id(doc, customer_id)
|
|
299
|
-
doc[
|
|
300
|
-
doc[
|
|
299
|
+
doc['v1'].pmt do
|
|
300
|
+
doc['v1'].type 0 # add
|
|
301
301
|
add_credit_card(doc, payment_method)
|
|
302
302
|
end
|
|
303
303
|
end
|
|
@@ -322,11 +322,11 @@ module ActiveMerchant #:nodoc:
|
|
|
322
322
|
private
|
|
323
323
|
|
|
324
324
|
CURRENCY_CODES = Hash.new{|h,k| raise ArgumentError.new("Unsupported currency: #{k}")}
|
|
325
|
-
CURRENCY_CODES[
|
|
325
|
+
CURRENCY_CODES['USD'] = '840'
|
|
326
326
|
|
|
327
327
|
def headers
|
|
328
328
|
{
|
|
329
|
-
|
|
329
|
+
'Content-Type' => 'text/xml'
|
|
330
330
|
}
|
|
331
331
|
end
|
|
332
332
|
|
|
@@ -349,8 +349,8 @@ module ActiveMerchant #:nodoc:
|
|
|
349
349
|
response,
|
|
350
350
|
error_code: error_code_from(succeeded, response),
|
|
351
351
|
authorization: authorization_from(action, response),
|
|
352
|
-
avs_result: AVSResult.new(code: response[
|
|
353
|
-
cvv_result: CVVResult.new(response[
|
|
352
|
+
avs_result: AVSResult.new(code: response['avsRslt']),
|
|
353
|
+
cvv_result: CVVResult.new(response['secRslt']),
|
|
354
354
|
test: test?
|
|
355
355
|
)
|
|
356
356
|
end
|
|
@@ -363,7 +363,7 @@ module ActiveMerchant #:nodoc:
|
|
|
363
363
|
response = {}
|
|
364
364
|
doc = Nokogiri::XML(xml).remove_namespaces!
|
|
365
365
|
|
|
366
|
-
doc.css(
|
|
366
|
+
doc.css('Envelope Body *').each do |node|
|
|
367
367
|
# node.name is more readable, but uniq_name is occasionally necessary
|
|
368
368
|
uniq_name = [node.parent.name, node.name].join('_')
|
|
369
369
|
response[uniq_name] = node.text
|
|
@@ -374,37 +374,37 @@ module ActiveMerchant #:nodoc:
|
|
|
374
374
|
end
|
|
375
375
|
|
|
376
376
|
def success_from(response)
|
|
377
|
-
fault = response[
|
|
378
|
-
approved_transaction = APPROVAL_CODES.include?(response[
|
|
379
|
-
found_contact = response[
|
|
377
|
+
fault = response['Fault']
|
|
378
|
+
approved_transaction = APPROVAL_CODES.include?(response['rspCode'])
|
|
379
|
+
found_contact = response['FndRecurrProfResponse']
|
|
380
380
|
|
|
381
381
|
return !fault && (approved_transaction || found_contact)
|
|
382
382
|
end
|
|
383
383
|
|
|
384
384
|
def error_code_from(succeeded, response)
|
|
385
385
|
return if succeeded
|
|
386
|
-
response[
|
|
386
|
+
response['errorCode'] || response['rspCode']
|
|
387
387
|
end
|
|
388
388
|
|
|
389
389
|
def message_from(succeeded, response)
|
|
390
|
-
return
|
|
390
|
+
return 'Succeeded' if succeeded
|
|
391
391
|
|
|
392
|
-
if response[
|
|
393
|
-
code = response[
|
|
394
|
-
extended_code = response[
|
|
392
|
+
if response['rspCode']
|
|
393
|
+
code = response['rspCode']
|
|
394
|
+
extended_code = response['extRspCode']
|
|
395
395
|
|
|
396
396
|
message = RESPONSE_MESSAGES[code]
|
|
397
397
|
extended = EXTENDED_RESPONSE_MESSAGES[extended_code]
|
|
398
|
-
ach_response = response[
|
|
398
|
+
ach_response = response['achResponse']
|
|
399
399
|
|
|
400
400
|
[message, extended, ach_response].compact.join('. ')
|
|
401
401
|
else
|
|
402
|
-
response[
|
|
402
|
+
response['faultstring']
|
|
403
403
|
end
|
|
404
404
|
end
|
|
405
405
|
|
|
406
406
|
def authorization_from(action, response)
|
|
407
|
-
authorization = response[
|
|
407
|
+
authorization = response['tranNr'] || response['pmtId']
|
|
408
408
|
|
|
409
409
|
# guard so we don't return something like "purchase|"
|
|
410
410
|
return unless authorization
|
|
@@ -435,35 +435,35 @@ module ActiveMerchant #:nodoc:
|
|
|
435
435
|
|
|
436
436
|
# -- request methods ---------------------------------------------------
|
|
437
437
|
def build_xml_transaction_request
|
|
438
|
-
build_xml_request(
|
|
438
|
+
build_xml_request('SendTranRequest') do |doc|
|
|
439
439
|
yield doc
|
|
440
440
|
end
|
|
441
441
|
end
|
|
442
442
|
|
|
443
443
|
def build_xml_payment_storage_request
|
|
444
|
-
build_xml_request(
|
|
444
|
+
build_xml_request('UpdtRecurrProfRequest') do |doc|
|
|
445
445
|
yield doc
|
|
446
446
|
end
|
|
447
447
|
end
|
|
448
448
|
|
|
449
449
|
def build_xml_payment_update_request
|
|
450
450
|
merchant_product_type = 5 # credit card
|
|
451
|
-
build_xml_request(
|
|
451
|
+
build_xml_request('UpdtRecurrProfRequest', merchant_product_type) do |doc|
|
|
452
452
|
yield doc
|
|
453
453
|
end
|
|
454
454
|
end
|
|
455
455
|
|
|
456
456
|
def build_xml_payment_search_request
|
|
457
|
-
build_xml_request(
|
|
457
|
+
build_xml_request('FndRecurrProfRequest') do |doc|
|
|
458
458
|
yield doc
|
|
459
459
|
end
|
|
460
460
|
end
|
|
461
461
|
|
|
462
462
|
def build_xml_request(wrapper, merchant_product_type=nil)
|
|
463
|
-
Nokogiri::XML::Builder.new(encoding:
|
|
464
|
-
xml[
|
|
465
|
-
xml[
|
|
466
|
-
xml[
|
|
463
|
+
Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
|
|
464
|
+
xml['soapenv'].Envelope('xmlns:soapenv' => SOAPENV_NAMESPACE) do
|
|
465
|
+
xml['soapenv'].Body do
|
|
466
|
+
xml['v1'].send(wrapper, 'xmlns:v1' => V1_NAMESPACE) do
|
|
467
467
|
add_merchant(xml)
|
|
468
468
|
yield(xml)
|
|
469
469
|
end
|
|
@@ -483,38 +483,38 @@ module ActiveMerchant #:nodoc:
|
|
|
483
483
|
end
|
|
484
484
|
|
|
485
485
|
def add_merchant(doc, product_type=nil)
|
|
486
|
-
doc[
|
|
487
|
-
doc[
|
|
488
|
-
doc[
|
|
489
|
-
doc[
|
|
490
|
-
doc[
|
|
486
|
+
doc['v1'].merc do
|
|
487
|
+
doc['v1'].id @options[:gateway_id]
|
|
488
|
+
doc['v1'].regKey @options[:reg_key]
|
|
489
|
+
doc['v1'].inType '1'
|
|
490
|
+
doc['v1'].prodType product_type if product_type
|
|
491
491
|
end
|
|
492
492
|
end
|
|
493
493
|
|
|
494
494
|
def add_amount(doc, money)
|
|
495
|
-
doc[
|
|
495
|
+
doc['v1'].reqAmt amount(money)
|
|
496
496
|
end
|
|
497
497
|
|
|
498
498
|
def add_order_number(doc, options)
|
|
499
499
|
return unless options[:order_id]
|
|
500
500
|
|
|
501
|
-
doc[
|
|
502
|
-
doc[
|
|
501
|
+
doc['v1'].authReq {
|
|
502
|
+
doc['v1'].ordNr options[:order_id]
|
|
503
503
|
}
|
|
504
504
|
end
|
|
505
505
|
|
|
506
506
|
def add_credit_card(doc, payment_method)
|
|
507
|
-
doc[
|
|
508
|
-
doc[
|
|
509
|
-
doc[
|
|
510
|
-
doc[
|
|
507
|
+
doc['v1'].card {
|
|
508
|
+
doc['v1'].pan payment_method.number
|
|
509
|
+
doc['v1'].sec payment_method.verification_value if payment_method.verification_value?
|
|
510
|
+
doc['v1'].xprDt expiration_date(payment_method)
|
|
511
511
|
}
|
|
512
512
|
end
|
|
513
513
|
|
|
514
514
|
def add_echeck(doc, payment_method)
|
|
515
|
-
doc[
|
|
516
|
-
doc[
|
|
517
|
-
doc[
|
|
515
|
+
doc['v1'].achEcheck {
|
|
516
|
+
doc['v1'].bankRtNr payment_method.routing_number
|
|
517
|
+
doc['v1'].acctNr payment_method.account_number
|
|
518
518
|
}
|
|
519
519
|
end
|
|
520
520
|
|
|
@@ -525,60 +525,60 @@ module ActiveMerchant #:nodoc:
|
|
|
525
525
|
end
|
|
526
526
|
|
|
527
527
|
def add_pan(doc, payment_method)
|
|
528
|
-
doc[
|
|
529
|
-
doc[
|
|
528
|
+
doc['v1'].card do
|
|
529
|
+
doc['v1'].pan payment_method.number
|
|
530
530
|
end
|
|
531
531
|
end
|
|
532
532
|
|
|
533
533
|
def add_contact(doc, fullname, options)
|
|
534
|
-
doc[
|
|
535
|
-
doc[
|
|
536
|
-
doc[
|
|
537
|
-
doc[
|
|
534
|
+
doc['v1'].contact do
|
|
535
|
+
doc['v1'].fullName fullname
|
|
536
|
+
doc['v1'].coName options[:company_name] if options[:company_name]
|
|
537
|
+
doc['v1'].title options[:title] if options[:title]
|
|
538
538
|
|
|
539
539
|
if (billing_address = options[:billing_address])
|
|
540
540
|
if billing_address[:phone]
|
|
541
|
-
doc[
|
|
542
|
-
doc[
|
|
543
|
-
doc[
|
|
541
|
+
doc['v1'].phone do
|
|
542
|
+
doc['v1'].type (options[:phone_number_type] || '4')
|
|
543
|
+
doc['v1'].nr billing_address[:phone].gsub(/\D/, '')
|
|
544
544
|
end
|
|
545
545
|
end
|
|
546
|
-
doc[
|
|
547
|
-
doc[
|
|
548
|
-
doc[
|
|
549
|
-
doc[
|
|
550
|
-
doc[
|
|
551
|
-
doc[
|
|
546
|
+
doc['v1'].addrLn1 billing_address[:address1] if billing_address[:address1]
|
|
547
|
+
doc['v1'].addrLn2 billing_address[:address2] if billing_address[:address2]
|
|
548
|
+
doc['v1'].city billing_address[:city] if billing_address[:city]
|
|
549
|
+
doc['v1'].state billing_address[:state] if billing_address[:state]
|
|
550
|
+
doc['v1'].zipCode billing_address[:zip] if billing_address[:zip]
|
|
551
|
+
doc['v1'].ctry 'US'
|
|
552
552
|
end
|
|
553
553
|
|
|
554
|
-
doc[
|
|
555
|
-
doc[
|
|
556
|
-
doc[
|
|
554
|
+
doc['v1'].email options[:email] if options[:email]
|
|
555
|
+
doc['v1'].type options[:contact_type] if options[:contact_type]
|
|
556
|
+
doc['v1'].stat options[:contact_stat] if options[:contact_stat]
|
|
557
557
|
|
|
558
558
|
if (shipping_address = options[:shipping_address])
|
|
559
|
-
doc[
|
|
560
|
-
doc[
|
|
561
|
-
doc[
|
|
562
|
-
doc[
|
|
563
|
-
doc[
|
|
564
|
-
doc[
|
|
565
|
-
doc[
|
|
566
|
-
doc[
|
|
567
|
-
doc[
|
|
559
|
+
doc['v1'].ship do
|
|
560
|
+
doc['v1'].fullName fullname
|
|
561
|
+
doc['v1'].addrLn1 shipping_address[:address1] if shipping_address[:address1]
|
|
562
|
+
doc['v1'].addrLn2 shipping_address[:address2] if shipping_address[:address2]
|
|
563
|
+
doc['v1'].city shipping_address[:city] if shipping_address[:city]
|
|
564
|
+
doc['v1'].state shipping_address[:state] if shipping_address[:state]
|
|
565
|
+
doc['v1'].zipCode shipping_address[:zip] if shipping_address[:zip]
|
|
566
|
+
doc['v1'].phone shipping_address[:phone].gsub(/\D/, '') if shipping_address[:phone]
|
|
567
|
+
doc['v1'].email shipping_address[:email] if shipping_address[:email]
|
|
568
568
|
end
|
|
569
569
|
end
|
|
570
570
|
end
|
|
571
571
|
end
|
|
572
572
|
|
|
573
573
|
def add_name(doc, payment_method)
|
|
574
|
-
doc[
|
|
575
|
-
doc[
|
|
574
|
+
doc['v1'].contact do
|
|
575
|
+
doc['v1'].fullName payment_method.name
|
|
576
576
|
end
|
|
577
577
|
end
|
|
578
578
|
|
|
579
579
|
def add_original_transaction_data(doc, authorization)
|
|
580
|
-
doc[
|
|
581
|
-
doc[
|
|
580
|
+
doc['v1'].origTranData do
|
|
581
|
+
doc['v1'].tranNr authorization
|
|
582
582
|
end
|
|
583
583
|
end
|
|
584
584
|
|
|
@@ -586,21 +586,21 @@ module ActiveMerchant #:nodoc:
|
|
|
586
586
|
options[:contact_type] = 1 # recurring
|
|
587
587
|
options[:contact_stat] = 1 # active
|
|
588
588
|
|
|
589
|
-
doc[
|
|
590
|
-
doc[
|
|
589
|
+
doc['v1'].cust do
|
|
590
|
+
doc['v1'].type 0 # add
|
|
591
591
|
add_contact(doc, fullname, options)
|
|
592
592
|
end
|
|
593
593
|
end
|
|
594
594
|
|
|
595
595
|
def add_customer_id(doc, customer_id)
|
|
596
|
-
doc[
|
|
597
|
-
doc[
|
|
596
|
+
doc['v1'].contact do
|
|
597
|
+
doc['v1'].id customer_id
|
|
598
598
|
end
|
|
599
599
|
end
|
|
600
600
|
|
|
601
601
|
def add_wallet_id(doc, wallet_id)
|
|
602
|
-
doc[
|
|
603
|
-
doc[
|
|
602
|
+
doc['v1'].recurMan do
|
|
603
|
+
doc['v1'].id wallet_id
|
|
604
604
|
end
|
|
605
605
|
end
|
|
606
606
|
end
|