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
|
@@ -120,8 +120,8 @@ module ActiveMerchant #:nodoc:
|
|
|
120
120
|
end
|
|
121
121
|
|
|
122
122
|
ext_data = Nokogiri::HTML.parse(response[:extdata])
|
|
123
|
-
response[:approved_amount] = ext_data.xpath(
|
|
124
|
-
response[:balance_due] = ext_data.xpath(
|
|
123
|
+
response[:approved_amount] = ext_data.xpath('//approvedamount').text
|
|
124
|
+
response[:balance_due] = ext_data.xpath('//balancedue').text
|
|
125
125
|
|
|
126
126
|
response
|
|
127
127
|
end
|
|
@@ -146,7 +146,7 @@ module ActiveMerchant #:nodoc:
|
|
|
146
146
|
post[:TransType] = action
|
|
147
147
|
post[:ExtData] = "<TermType>#{@options[:term_type]}</TermType>"
|
|
148
148
|
|
|
149
|
-
post.merge(params).map { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join(
|
|
149
|
+
post.merge(params).map { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
|
|
150
150
|
end
|
|
151
151
|
|
|
152
152
|
def url
|
|
@@ -154,7 +154,7 @@ module ActiveMerchant #:nodoc:
|
|
|
154
154
|
end
|
|
155
155
|
|
|
156
156
|
def success_from(response)
|
|
157
|
-
response[:result] ==
|
|
157
|
+
response[:result] == '0' || response[:result] == '200'
|
|
158
158
|
end
|
|
159
159
|
|
|
160
160
|
def message_from(response)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
require
|
|
1
|
+
require 'nokogiri'
|
|
2
2
|
|
|
3
3
|
module ActiveMerchant #:nodoc:
|
|
4
4
|
module Billing #:nodoc:
|
|
5
5
|
class HdfcGateway < Gateway
|
|
6
|
-
self.display_name =
|
|
7
|
-
self.homepage_url =
|
|
6
|
+
self.display_name = 'HDFC'
|
|
7
|
+
self.homepage_url = 'http://www.hdfcbank.com/sme/sme-details/merchant-services/guzh6m0i'
|
|
8
8
|
|
|
9
|
-
self.test_url =
|
|
10
|
-
self.live_url =
|
|
9
|
+
self.test_url = 'https://securepgtest.fssnet.co.in/pgway/servlet/'
|
|
10
|
+
self.live_url = 'https://securepg.fssnet.co.in/pgway/servlet/'
|
|
11
11
|
|
|
12
|
-
self.supported_countries = [
|
|
13
|
-
self.default_currency =
|
|
12
|
+
self.supported_countries = ['IN']
|
|
13
|
+
self.default_currency = 'INR'
|
|
14
14
|
self.money_format = :dollars
|
|
15
15
|
self.supported_cardtypes = [:visa, :master, :discover, :diners_club]
|
|
16
16
|
|
|
@@ -25,7 +25,7 @@ module ActiveMerchant #:nodoc:
|
|
|
25
25
|
add_payment_method(post, payment_method)
|
|
26
26
|
add_customer_data(post, options)
|
|
27
27
|
|
|
28
|
-
commit(
|
|
28
|
+
commit('purchase', post)
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def authorize(amount, payment_method, options={})
|
|
@@ -34,7 +34,7 @@ module ActiveMerchant #:nodoc:
|
|
|
34
34
|
add_payment_method(post, payment_method)
|
|
35
35
|
add_customer_data(post, options)
|
|
36
36
|
|
|
37
|
-
commit(
|
|
37
|
+
commit('authorize', post)
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def capture(amount, authorization, options={})
|
|
@@ -43,7 +43,7 @@ module ActiveMerchant #:nodoc:
|
|
|
43
43
|
add_reference(post, authorization)
|
|
44
44
|
add_customer_data(post, options)
|
|
45
45
|
|
|
46
|
-
commit(
|
|
46
|
+
commit('capture', post)
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
def refund(amount, authorization, options={})
|
|
@@ -52,22 +52,22 @@ module ActiveMerchant #:nodoc:
|
|
|
52
52
|
add_reference(post, authorization)
|
|
53
53
|
add_customer_data(post, options)
|
|
54
54
|
|
|
55
|
-
commit(
|
|
55
|
+
commit('refund', post)
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
private
|
|
59
59
|
|
|
60
60
|
CURRENCY_CODES = Hash.new{|h,k| raise ArgumentError.new("Unsupported currency for HDFC: #{k}")}
|
|
61
|
-
CURRENCY_CODES[
|
|
62
|
-
CURRENCY_CODES[
|
|
63
|
-
CURRENCY_CODES[
|
|
64
|
-
CURRENCY_CODES[
|
|
65
|
-
CURRENCY_CODES[
|
|
66
|
-
CURRENCY_CODES[
|
|
67
|
-
CURRENCY_CODES[
|
|
68
|
-
CURRENCY_CODES[
|
|
69
|
-
CURRENCY_CODES[
|
|
70
|
-
CURRENCY_CODES[
|
|
61
|
+
CURRENCY_CODES['AED'] = '784'
|
|
62
|
+
CURRENCY_CODES['AUD'] = '036'
|
|
63
|
+
CURRENCY_CODES['CAD'] = '124'
|
|
64
|
+
CURRENCY_CODES['EUR'] = '978'
|
|
65
|
+
CURRENCY_CODES['GBP'] = '826'
|
|
66
|
+
CURRENCY_CODES['INR'] = '356'
|
|
67
|
+
CURRENCY_CODES['OMR'] = '512'
|
|
68
|
+
CURRENCY_CODES['QAR'] = '634'
|
|
69
|
+
CURRENCY_CODES['SGD'] = '702'
|
|
70
|
+
CURRENCY_CODES['USD'] = '840'
|
|
71
71
|
|
|
72
72
|
def add_invoice(post, amount, options)
|
|
73
73
|
post[:amt] = amount(amount)
|
|
@@ -127,14 +127,14 @@ EOA
|
|
|
127
127
|
end
|
|
128
128
|
|
|
129
129
|
def fix_xml(xml)
|
|
130
|
-
xml.gsub(/&(?!(?:amp|quot|apos|lt|gt);)/,
|
|
130
|
+
xml.gsub(/&(?!(?:amp|quot|apos|lt|gt);)/, '&')
|
|
131
131
|
end
|
|
132
132
|
|
|
133
133
|
ACTIONS = {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
'purchase' => '1',
|
|
135
|
+
'refund' => '2',
|
|
136
|
+
'authorize' => '4',
|
|
137
|
+
'capture' => '5',
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
def commit(action, post)
|
|
@@ -164,13 +164,13 @@ EOA
|
|
|
164
164
|
end
|
|
165
165
|
|
|
166
166
|
def url(action)
|
|
167
|
-
endpoint =
|
|
167
|
+
endpoint = 'TranPortalXMLServlet'
|
|
168
168
|
(test? ? test_url : live_url) + endpoint
|
|
169
169
|
end
|
|
170
170
|
|
|
171
171
|
def success_from(result)
|
|
172
172
|
case result
|
|
173
|
-
when
|
|
173
|
+
when 'CAPTURED', 'APPROVED', 'NOT ENROLLED', 'ENROLLED'
|
|
174
174
|
true
|
|
175
175
|
else
|
|
176
176
|
false
|
|
@@ -179,23 +179,23 @@ EOA
|
|
|
179
179
|
|
|
180
180
|
def message_from(succeeded, response)
|
|
181
181
|
if succeeded
|
|
182
|
-
|
|
182
|
+
'Succeeded'
|
|
183
183
|
else
|
|
184
|
-
(response[:error_text] || response[:result] ||
|
|
184
|
+
(response[:error_text] || response[:result] || 'Unable to read error message').split('-').last
|
|
185
185
|
end
|
|
186
186
|
end
|
|
187
187
|
|
|
188
188
|
def authorization_from(request, response)
|
|
189
|
-
[response[:tranid], request[:member]].join(
|
|
189
|
+
[response[:tranid], request[:member]].join('|')
|
|
190
190
|
end
|
|
191
191
|
|
|
192
192
|
def split_authorization(authorization)
|
|
193
|
-
tranid, member = authorization.split(
|
|
193
|
+
tranid, member = authorization.split('|')
|
|
194
194
|
[tranid, member]
|
|
195
195
|
end
|
|
196
196
|
|
|
197
197
|
def escape(string, max_length=250)
|
|
198
|
-
return
|
|
198
|
+
return '' unless string
|
|
199
199
|
if max_length
|
|
200
200
|
string = string[0...max_length]
|
|
201
201
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require
|
|
1
|
+
require 'nokogiri'
|
|
2
2
|
|
|
3
3
|
module ActiveMerchant #:nodoc:
|
|
4
4
|
module Billing #:nodoc:
|
|
@@ -117,7 +117,7 @@ module ActiveMerchant #:nodoc:
|
|
|
117
117
|
xml.hps :CardData do
|
|
118
118
|
if card_or_token.respond_to?(:number)
|
|
119
119
|
if card_or_token.track_data
|
|
120
|
-
xml.tag!(
|
|
120
|
+
xml.tag!('hps:TrackData', 'method'=>'swipe') do
|
|
121
121
|
xml.text! card_or_token.track_data
|
|
122
122
|
end
|
|
123
123
|
if options[:encryption_type]
|
|
@@ -202,7 +202,7 @@ module ActiveMerchant #:nodoc:
|
|
|
202
202
|
|
|
203
203
|
doc = Nokogiri::XML(raw)
|
|
204
204
|
doc.remove_namespaces!
|
|
205
|
-
if(header = doc.xpath(
|
|
205
|
+
if(header = doc.xpath('//Header').first)
|
|
206
206
|
header.elements.each do |node|
|
|
207
207
|
if (node.elements.size == 0)
|
|
208
208
|
response[node.name] = node.text
|
|
@@ -213,13 +213,13 @@ module ActiveMerchant #:nodoc:
|
|
|
213
213
|
end
|
|
214
214
|
end
|
|
215
215
|
end
|
|
216
|
-
if(transaction = doc.xpath(
|
|
216
|
+
if(transaction = doc.xpath('//Transaction/*[1]').first)
|
|
217
217
|
transaction.elements.each do |node|
|
|
218
218
|
response[node.name] = node.text
|
|
219
219
|
end
|
|
220
220
|
end
|
|
221
|
-
if(fault = doc.xpath(
|
|
222
|
-
response[
|
|
221
|
+
if(fault = doc.xpath('//Fault/Reason/Text').first)
|
|
222
|
+
response['Fault'] = fault.text
|
|
223
223
|
end
|
|
224
224
|
|
|
225
225
|
response
|
|
@@ -250,22 +250,22 @@ module ActiveMerchant #:nodoc:
|
|
|
250
250
|
|
|
251
251
|
def successful?(response)
|
|
252
252
|
(
|
|
253
|
-
(response[
|
|
254
|
-
((response[
|
|
253
|
+
(response['GatewayRspCode'] == '0') &&
|
|
254
|
+
((response['RspCode'] || '00') == '00' || response['RspCode'] == '85')
|
|
255
255
|
)
|
|
256
256
|
end
|
|
257
257
|
|
|
258
258
|
def message_from(response)
|
|
259
|
-
if(response[
|
|
260
|
-
response[
|
|
261
|
-
elsif(response[
|
|
262
|
-
if(response[
|
|
263
|
-
issuer_message(response[
|
|
259
|
+
if(response['Fault'])
|
|
260
|
+
response['Fault']
|
|
261
|
+
elsif(response['GatewayRspCode'] == '0')
|
|
262
|
+
if(response['RspCode'] != '00' && response['RspCode'] != '85')
|
|
263
|
+
issuer_message(response['RspCode'])
|
|
264
264
|
else
|
|
265
265
|
response['GatewayRspMsg']
|
|
266
266
|
end
|
|
267
267
|
else
|
|
268
|
-
(GATEWAY_MESSAGES[response[
|
|
268
|
+
(GATEWAY_MESSAGES[response['GatewayRspCode']] || response['GatewayRspMsg'])
|
|
269
269
|
end
|
|
270
270
|
end
|
|
271
271
|
|
|
@@ -278,27 +278,27 @@ module ActiveMerchant #:nodoc:
|
|
|
278
278
|
end
|
|
279
279
|
|
|
280
280
|
ISSUER_MESSAGES = {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
281
|
+
'13' => 'Must be greater than or equal 0.',
|
|
282
|
+
'14' => 'The card number is incorrect.',
|
|
283
|
+
'54' => 'The card has expired.',
|
|
284
|
+
'55' => 'The 4-digit pin is invalid.',
|
|
285
|
+
'75' => 'Maximum number of pin retries exceeded.',
|
|
286
|
+
'80' => 'Card expiration date is invalid.',
|
|
287
|
+
'86' => "Can't verify card pin number."
|
|
288
288
|
}
|
|
289
289
|
def issuer_message(code)
|
|
290
|
-
return
|
|
291
|
-
return
|
|
290
|
+
return 'The card was declined.' if %w(02 03 04 05 41 43 44 51 56 61 62 63 65 78).include?(code)
|
|
291
|
+
return 'An error occurred while processing the card.' if %w(06 07 12 15 19 12 52 53 57 58 76 77 91 96 EC).include?(code)
|
|
292
292
|
return "The card's security code is incorrect." if %w(EB N7).include?(code)
|
|
293
293
|
ISSUER_MESSAGES[code]
|
|
294
294
|
end
|
|
295
295
|
|
|
296
296
|
GATEWAY_MESSAGES = {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
297
|
+
'-2' => 'Authentication error. Please double check your service configuration.',
|
|
298
|
+
'12' => 'Invalid CPC data.',
|
|
299
|
+
'13' => 'Invalid card data.',
|
|
300
|
+
'14' => 'The card number is not a valid credit card number.',
|
|
301
|
+
'30' => 'Gateway timed out.'
|
|
302
302
|
}
|
|
303
303
|
end
|
|
304
304
|
end
|
|
@@ -14,12 +14,12 @@ module ActiveMerchant #:nodoc:
|
|
|
14
14
|
self.display_name = 'iATS Payments'
|
|
15
15
|
|
|
16
16
|
ACTIONS = {
|
|
17
|
-
purchase:
|
|
18
|
-
purchase_check:
|
|
19
|
-
refund:
|
|
20
|
-
refund_check:
|
|
21
|
-
store:
|
|
22
|
-
unstore:
|
|
17
|
+
purchase: 'ProcessCreditCardV1',
|
|
18
|
+
purchase_check: 'ProcessACHEFTV1',
|
|
19
|
+
refund: 'ProcessCreditCardRefundWithTransactionIdV1',
|
|
20
|
+
refund_check: 'ProcessACHEFTRefundWithTransactionIdV1',
|
|
21
|
+
store: 'CreateCreditCardCustomerCodeV1',
|
|
22
|
+
unstore: 'DeleteCustomerCodeV1'
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
def initialize(options={})
|
|
@@ -145,19 +145,19 @@ module ActiveMerchant #:nodoc:
|
|
|
145
145
|
end
|
|
146
146
|
|
|
147
147
|
def expdate(creditcard)
|
|
148
|
-
year = sprintf(
|
|
149
|
-
month = sprintf(
|
|
148
|
+
year = sprintf('%.4i', creditcard.year)
|
|
149
|
+
month = sprintf('%.2i', creditcard.month)
|
|
150
150
|
|
|
151
151
|
"#{month}/#{year[-2..-1]}"
|
|
152
152
|
end
|
|
153
153
|
|
|
154
154
|
def creditcard_brand(brand)
|
|
155
155
|
case brand
|
|
156
|
-
when
|
|
157
|
-
when
|
|
158
|
-
when
|
|
159
|
-
when
|
|
160
|
-
when
|
|
156
|
+
when 'visa' then 'VISA'
|
|
157
|
+
when 'master' then 'MC'
|
|
158
|
+
when 'discover' then 'DSC'
|
|
159
|
+
when 'american_express' then 'AMX'
|
|
160
|
+
when 'maestro' then 'MAESTR'
|
|
161
161
|
else
|
|
162
162
|
raise "Unhandled credit card brand #{brand}"
|
|
163
163
|
end
|
|
@@ -178,12 +178,12 @@ module ActiveMerchant #:nodoc:
|
|
|
178
178
|
|
|
179
179
|
def endpoints
|
|
180
180
|
{
|
|
181
|
-
purchase:
|
|
182
|
-
purchase_check:
|
|
183
|
-
refund:
|
|
184
|
-
refund_check:
|
|
185
|
-
store:
|
|
186
|
-
unstore:
|
|
181
|
+
purchase: 'ProcessLink.asmx',
|
|
182
|
+
purchase_check: 'ProcessLink.asmx',
|
|
183
|
+
refund: 'ProcessLink.asmx',
|
|
184
|
+
refund_check: 'ProcessLink.asmx',
|
|
185
|
+
store: 'CustomerLink.asmx',
|
|
186
|
+
unstore: 'CustomerLink.asmx'
|
|
187
187
|
}
|
|
188
188
|
end
|
|
189
189
|
|
|
@@ -211,7 +211,7 @@ module ActiveMerchant #:nodoc:
|
|
|
211
211
|
def hashify_xml!(xml, response)
|
|
212
212
|
xml = REXML::Document.new(xml)
|
|
213
213
|
|
|
214
|
-
xml.elements.each(
|
|
214
|
+
xml.elements.each('//IATSRESPONSE/*') do |node|
|
|
215
215
|
recursively_parse_element(node, response)
|
|
216
216
|
end
|
|
217
217
|
end
|
|
@@ -229,7 +229,7 @@ module ActiveMerchant #:nodoc:
|
|
|
229
229
|
end
|
|
230
230
|
|
|
231
231
|
def success_from(response)
|
|
232
|
-
response[:status] ==
|
|
232
|
+
response[:status] == 'Success' && successful_result_message?(response)
|
|
233
233
|
end
|
|
234
234
|
|
|
235
235
|
def message_from(response)
|
|
@@ -253,14 +253,14 @@ module ActiveMerchant #:nodoc:
|
|
|
253
253
|
end
|
|
254
254
|
|
|
255
255
|
def split_authorization(authorization)
|
|
256
|
-
authorization.split(
|
|
256
|
+
authorization.split('|')
|
|
257
257
|
end
|
|
258
258
|
|
|
259
259
|
def envelope_namespaces
|
|
260
260
|
{
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
261
|
+
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
|
262
|
+
'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
|
|
263
|
+
'xmlns:soap12' => 'http://www.w3.org/2003/05/soap-envelope'
|
|
264
264
|
}
|
|
265
265
|
end
|
|
266
266
|
|
|
@@ -269,7 +269,7 @@ module ActiveMerchant #:nodoc:
|
|
|
269
269
|
xml.instruct!(:xml, :version => '1.0', :encoding => 'utf-8')
|
|
270
270
|
xml.tag! 'soap12:Envelope', envelope_namespaces do
|
|
271
271
|
xml.tag! 'soap12:Body' do
|
|
272
|
-
xml.tag! ACTIONS[action], {
|
|
272
|
+
xml.tag! ACTIONS[action], { 'xmlns' => 'https://www.iatspayments.com/NetGate/' } do
|
|
273
273
|
xml.tag!('agentCode', @options[:agent_code])
|
|
274
274
|
xml.tag!('password', @options[:password])
|
|
275
275
|
parameters.each do |name, value|
|
|
@@ -73,7 +73,7 @@ module ActiveMerchant #:nodoc:
|
|
|
73
73
|
# CreditCard object.
|
|
74
74
|
def update(vault_id, creditcard, options = {})
|
|
75
75
|
post = {}
|
|
76
|
-
post[:customer_vault] =
|
|
76
|
+
post[:customer_vault] = 'update_customer'
|
|
77
77
|
add_customer_vault_id(post, vault_id)
|
|
78
78
|
add_creditcard(post, creditcard, options)
|
|
79
79
|
add_address(post, creditcard, options)
|
|
@@ -84,7 +84,7 @@ module ActiveMerchant #:nodoc:
|
|
|
84
84
|
|
|
85
85
|
def delete(vault_id)
|
|
86
86
|
post = {}
|
|
87
|
-
post[:customer_vault] =
|
|
87
|
+
post[:customer_vault] = 'delete_customer'
|
|
88
88
|
add_customer_vault_id(post, vault_id)
|
|
89
89
|
commit(nil, nil, post)
|
|
90
90
|
end
|
|
@@ -141,7 +141,7 @@ module ActiveMerchant #:nodoc:
|
|
|
141
141
|
|
|
142
142
|
def add_creditcard(post, creditcard,options)
|
|
143
143
|
if options[:store]
|
|
144
|
-
post[:customer_vault] =
|
|
144
|
+
post[:customer_vault] = 'add_customer'
|
|
145
145
|
post[:customer_vault_id] = options[:store] unless options[:store] == true
|
|
146
146
|
end
|
|
147
147
|
post[:ccnumber] = creditcard.number
|
|
@@ -175,23 +175,23 @@ module ActiveMerchant #:nodoc:
|
|
|
175
175
|
|
|
176
176
|
response = parse( ssl_post(self.live_url, post_data(action,parameters)) )
|
|
177
177
|
|
|
178
|
-
Response.new(response[
|
|
179
|
-
:authorization => response[
|
|
178
|
+
Response.new(response['response'] == '1', message_from(response), response,
|
|
179
|
+
:authorization => response['transactionid'],
|
|
180
180
|
:test => test?,
|
|
181
|
-
:cvv_result => response[
|
|
182
|
-
:avs_result => { :code => response[
|
|
181
|
+
:cvv_result => response['cvvresponse'],
|
|
182
|
+
:avs_result => { :code => response['avsresponse'] }
|
|
183
183
|
)
|
|
184
184
|
|
|
185
185
|
end
|
|
186
186
|
|
|
187
187
|
def message_from(response)
|
|
188
|
-
case response[
|
|
189
|
-
when
|
|
190
|
-
|
|
191
|
-
when
|
|
192
|
-
|
|
188
|
+
case response['responsetext']
|
|
189
|
+
when 'SUCCESS','Approved'
|
|
190
|
+
'This transaction has been approved'
|
|
191
|
+
when 'DECLINE'
|
|
192
|
+
'This transaction has been declined'
|
|
193
193
|
else
|
|
194
|
-
response[
|
|
194
|
+
response['responsetext']
|
|
195
195
|
end
|
|
196
196
|
end
|
|
197
197
|
|
|
@@ -201,7 +201,7 @@ module ActiveMerchant #:nodoc:
|
|
|
201
201
|
post[:password] = @options[:password]
|
|
202
202
|
post[:type] = action if action
|
|
203
203
|
|
|
204
|
-
request = post.merge(parameters).map {|key,value| "#{key}=#{CGI.escape(value.to_s)}"}.join(
|
|
204
|
+
request = post.merge(parameters).map {|key,value| "#{key}=#{CGI.escape(value.to_s)}"}.join('&')
|
|
205
205
|
request
|
|
206
206
|
end
|
|
207
207
|
|
|
@@ -210,7 +210,7 @@ module ActiveMerchant #:nodoc:
|
|
|
210
210
|
when source.is_a?(String) then :vault
|
|
211
211
|
when CreditCard.card_companies.keys.include?(card_brand(source)) then :credit_card
|
|
212
212
|
when card_brand(source) == 'check' then :check
|
|
213
|
-
else raise ArgumentError,
|
|
213
|
+
else raise ArgumentError, 'Unsupported funding source provided'
|
|
214
214
|
end
|
|
215
215
|
end
|
|
216
216
|
end
|