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
|
@@ -35,8 +35,8 @@ module ActiveMerchant #:nodoc:
|
|
|
35
35
|
# :email => 'jack@yahoo.com'
|
|
36
36
|
# )
|
|
37
37
|
class PsigateGateway < Gateway
|
|
38
|
-
self.test_url = 'https://
|
|
39
|
-
self.live_url = 'https://
|
|
38
|
+
self.test_url = 'https://realtimestaging.psigate.com/xml'
|
|
39
|
+
self.live_url = 'https://realtime.psigate.com/xml'
|
|
40
40
|
|
|
41
41
|
self.supported_cardtypes = [:visa, :master, :american_express]
|
|
42
42
|
self.supported_countries = ['CA']
|
|
@@ -53,18 +53,18 @@ module ActiveMerchant #:nodoc:
|
|
|
53
53
|
|
|
54
54
|
def authorize(money, creditcard, options = {})
|
|
55
55
|
requires!(options, :order_id)
|
|
56
|
-
options[:CardAction] =
|
|
56
|
+
options[:CardAction] = '1'
|
|
57
57
|
commit(money, creditcard, options)
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
def purchase(money, creditcard, options = {})
|
|
61
61
|
requires!(options, :order_id)
|
|
62
|
-
options[:CardAction] =
|
|
62
|
+
options[:CardAction] = '0'
|
|
63
63
|
commit(money, creditcard, options)
|
|
64
64
|
end
|
|
65
65
|
|
|
66
66
|
def capture(money, authorization, options = {})
|
|
67
|
-
options[:CardAction] =
|
|
67
|
+
options[:CardAction] = '2'
|
|
68
68
|
options[:order_id], options[:trans_ref_number] = split_authorization(authorization)
|
|
69
69
|
commit(money, nil, options)
|
|
70
70
|
end
|
|
@@ -75,13 +75,13 @@ module ActiveMerchant #:nodoc:
|
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
def refund(money, authorization, options = {})
|
|
78
|
-
options[:CardAction] =
|
|
78
|
+
options[:CardAction] = '3'
|
|
79
79
|
options[:order_id], options[:trans_ref_number] = split_authorization(authorization)
|
|
80
80
|
commit(money, nil, options)
|
|
81
81
|
end
|
|
82
82
|
|
|
83
83
|
def void(authorization, options = {})
|
|
84
|
-
options[:CardAction] =
|
|
84
|
+
options[:CardAction] = '9'
|
|
85
85
|
options[:order_id], options[:trans_ref_number] = split_authorization(authorization)
|
|
86
86
|
commit(nil, nil, options)
|
|
87
87
|
end
|
|
@@ -115,11 +115,11 @@ module ActiveMerchant #:nodoc:
|
|
|
115
115
|
end
|
|
116
116
|
|
|
117
117
|
def successful?(response)
|
|
118
|
-
response[:approved] ==
|
|
118
|
+
response[:approved] == 'APPROVED'
|
|
119
119
|
end
|
|
120
120
|
|
|
121
121
|
def parse(xml)
|
|
122
|
-
response = {:message =>
|
|
122
|
+
response = {:message => 'Global Error Receipt', :complete => false}
|
|
123
123
|
|
|
124
124
|
xml = REXML::Document.new(xml)
|
|
125
125
|
xml.elements.each('//Result/*') do |node|
|
|
@@ -132,7 +132,7 @@ module ActiveMerchant #:nodoc:
|
|
|
132
132
|
def post_data(money, creditcard, options)
|
|
133
133
|
xml = REXML::Document.new
|
|
134
134
|
xml << REXML::XMLDecl.new
|
|
135
|
-
root = xml.add_element(
|
|
135
|
+
root = xml.add_element('Order')
|
|
136
136
|
|
|
137
137
|
parameters(money, creditcard, options).each do |key, value|
|
|
138
138
|
root.add_element(key.to_s).text = value if value
|
|
@@ -155,7 +155,7 @@ module ActiveMerchant #:nodoc:
|
|
|
155
155
|
:TransRefNumber => options[:trans_ref_number],
|
|
156
156
|
|
|
157
157
|
# Credit Card parameters
|
|
158
|
-
:PaymentType =>
|
|
158
|
+
:PaymentType => 'CC',
|
|
159
159
|
:CardAction => options[:CardAction],
|
|
160
160
|
|
|
161
161
|
# Financial parameters
|
|
@@ -167,9 +167,9 @@ module ActiveMerchant #:nodoc:
|
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
if creditcard
|
|
170
|
-
exp_month = sprintf(
|
|
170
|
+
exp_month = sprintf('%.2i', creditcard.month) unless creditcard.month.blank?
|
|
171
171
|
exp_year = creditcard.year.to_s[2,2] unless creditcard.year.blank?
|
|
172
|
-
card_id_code = (creditcard.verification_value.blank? ? nil :
|
|
172
|
+
card_id_code = (creditcard.verification_value.blank? ? nil : '1')
|
|
173
173
|
|
|
174
174
|
params.update(
|
|
175
175
|
:CardNumber => creditcard.number,
|
|
@@ -206,11 +206,11 @@ module ActiveMerchant #:nodoc:
|
|
|
206
206
|
end
|
|
207
207
|
|
|
208
208
|
def message_from(response)
|
|
209
|
-
if response[:approved] ==
|
|
209
|
+
if response[:approved] == 'APPROVED'
|
|
210
210
|
return SUCCESS_MESSAGE
|
|
211
211
|
else
|
|
212
212
|
return FAILURE_MESSAGE if response[:errmsg].blank?
|
|
213
|
-
return response[:errmsg].gsub(/[^\w]/, ' ').split.join(
|
|
213
|
+
return response[:errmsg].gsub(/[^\w]/, ' ').split.join(' ').capitalize
|
|
214
214
|
end
|
|
215
215
|
end
|
|
216
216
|
|
|
@@ -220,7 +220,7 @@ module ActiveMerchant #:nodoc:
|
|
|
220
220
|
end
|
|
221
221
|
|
|
222
222
|
def build_authorization(response)
|
|
223
|
-
[response[:orderid], response[:transrefnumber]].join(
|
|
223
|
+
[response[:orderid], response[:transrefnumber]].join(';')
|
|
224
224
|
end
|
|
225
225
|
end
|
|
226
226
|
end
|
|
@@ -63,21 +63,21 @@ module ActiveMerchant
|
|
|
63
63
|
NOMINAL_AMOUNT = 101
|
|
64
64
|
|
|
65
65
|
AVS_CODE = {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
'ALL MATCH' => 'Y',
|
|
67
|
+
'SECURITY CODE MATCH ONLY' => 'N',
|
|
68
|
+
'ADDRESS MATCH ONLY' => 'Y',
|
|
69
|
+
'NO DATA MATCHES' => 'N',
|
|
70
|
+
'DATA NOT CHECKED' => 'R',
|
|
71
|
+
'SECURITY CHECKS NOT SUPPORTED' => 'X'
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
CVV_CODE = {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
75
|
+
'ALL MATCH' => 'M',
|
|
76
|
+
'SECURITY CODE MATCH ONLY' => 'M',
|
|
77
|
+
'ADDRESS MATCH ONLY' => 'N',
|
|
78
|
+
'NO DATA MATCHES' => 'N',
|
|
79
|
+
'DATA NOT CHECKED' => 'P',
|
|
80
|
+
'SECURITY CHECKS NOT SUPPORTED' => 'X'
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
# Create a new PslCardGateway
|
|
@@ -296,7 +296,7 @@ module ActiveMerchant
|
|
|
296
296
|
|
|
297
297
|
post.collect { |key, value|
|
|
298
298
|
"#{key}=#{CGI.escape(value.to_s.tr('&=', ' '))}"
|
|
299
|
-
}.join(
|
|
299
|
+
}.join('&')
|
|
300
300
|
end
|
|
301
301
|
end
|
|
302
302
|
end
|
|
@@ -5,8 +5,8 @@ module ActiveMerchant #:nodoc:
|
|
|
5
5
|
|
|
6
6
|
class_attribute :test_url, :live_url
|
|
7
7
|
|
|
8
|
-
self.test_url =
|
|
9
|
-
self.live_url =
|
|
8
|
+
self.test_url = 'https://webmerchantaccount.ptc.quickbooks.com/j/AppGateway'
|
|
9
|
+
self.live_url = 'https://webmerchantaccount.quickbooks.com/j/AppGateway'
|
|
10
10
|
|
|
11
11
|
self.homepage_url = 'http://payments.intuit.com/'
|
|
12
12
|
self.display_name = 'QuickBooks Merchant Services'
|
|
@@ -138,7 +138,7 @@ module ActiveMerchant #:nodoc:
|
|
|
138
138
|
|
|
139
139
|
req = build_request(type, money, parameters)
|
|
140
140
|
|
|
141
|
-
data = ssl_post(url, req,
|
|
141
|
+
data = ssl_post(url, req, 'Content-Type' => 'application/x-qbmsxml')
|
|
142
142
|
response = parse(type, data)
|
|
143
143
|
message = (response[:status_message] || '').strip
|
|
144
144
|
|
|
@@ -163,20 +163,20 @@ module ActiveMerchant #:nodoc:
|
|
|
163
163
|
xml = REXML::Document.new(body)
|
|
164
164
|
|
|
165
165
|
signon = REXML::XPath.first(xml, "//SignonMsgsRs/#{hosted? ? 'SignonAppCertRs' : 'SignonDesktopRs'}")
|
|
166
|
-
status_code = signon.attributes[
|
|
166
|
+
status_code = signon.attributes['statusCode'].to_i
|
|
167
167
|
|
|
168
168
|
if status_code != 0
|
|
169
169
|
return {
|
|
170
170
|
:status_code => status_code,
|
|
171
|
-
:status_message => signon.attributes[
|
|
171
|
+
:status_message => signon.attributes['statusMessage'],
|
|
172
172
|
}
|
|
173
173
|
end
|
|
174
174
|
|
|
175
175
|
response = REXML::XPath.first(xml, "//QBMSXMLMsgsRs/#{type}Rs")
|
|
176
176
|
|
|
177
177
|
results = {
|
|
178
|
-
:status_code => response.attributes[
|
|
179
|
-
:status_message => response.attributes[
|
|
178
|
+
:status_code => response.attributes['statusCode'].to_i,
|
|
179
|
+
:status_message => response.attributes['statusMessage'],
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
response.elements.each do |e|
|
|
@@ -200,16 +200,16 @@ module ActiveMerchant #:nodoc:
|
|
|
200
200
|
xml.instruct!(:xml, :version => '1.0', :encoding => 'utf-8')
|
|
201
201
|
xml.instruct!(:qbmsxml, :version => API_VERSION)
|
|
202
202
|
|
|
203
|
-
xml.tag!(
|
|
204
|
-
xml.tag!(
|
|
205
|
-
xml.tag!(hosted? ?
|
|
206
|
-
xml.tag!(
|
|
207
|
-
xml.tag!(
|
|
208
|
-
xml.tag!(
|
|
203
|
+
xml.tag!('QBMSXML') do
|
|
204
|
+
xml.tag!('SignonMsgsRq') do
|
|
205
|
+
xml.tag!(hosted? ? 'SignonAppCertRq' : 'SignonDesktopRq') do
|
|
206
|
+
xml.tag!('ClientDateTime', Time.now.xmlschema)
|
|
207
|
+
xml.tag!('ApplicationLogin', @options[:login])
|
|
208
|
+
xml.tag!('ConnectionTicket', @options[:ticket])
|
|
209
209
|
end
|
|
210
210
|
end
|
|
211
211
|
|
|
212
|
-
xml.tag!(
|
|
212
|
+
xml.tag!('QBMSXMLMsgsRq') do
|
|
213
213
|
xml.tag!("#{type}Rq") do
|
|
214
214
|
method("build_#{type}").call(xml, money, parameters)
|
|
215
215
|
end
|
|
@@ -223,47 +223,47 @@ module ActiveMerchant #:nodoc:
|
|
|
223
223
|
cc = parameters[:credit_card]
|
|
224
224
|
name = "#{cc.first_name} #{cc.last_name}"[0...30]
|
|
225
225
|
|
|
226
|
-
xml.tag!(
|
|
227
|
-
xml.tag!(
|
|
228
|
-
xml.tag!(
|
|
229
|
-
xml.tag!(
|
|
230
|
-
xml.tag!(
|
|
231
|
-
xml.tag!(
|
|
232
|
-
xml.tag!(
|
|
226
|
+
xml.tag!('TransRequestID', parameters[:trans_request_id])
|
|
227
|
+
xml.tag!('CreditCardNumber', cc.number)
|
|
228
|
+
xml.tag!('ExpirationMonth', cc.month)
|
|
229
|
+
xml.tag!('ExpirationYear', cc.year)
|
|
230
|
+
xml.tag!('IsECommerce', 'true')
|
|
231
|
+
xml.tag!('Amount', amount(money))
|
|
232
|
+
xml.tag!('NameOnCard', name)
|
|
233
233
|
add_address(xml, parameters)
|
|
234
|
-
xml.tag!(
|
|
234
|
+
xml.tag!('CardSecurityCode', cc.verification_value) if cc.verification_value?
|
|
235
235
|
end
|
|
236
236
|
|
|
237
237
|
def build_CustomerCreditCardCapture(xml, money, parameters)
|
|
238
|
-
xml.tag!(
|
|
239
|
-
xml.tag!(
|
|
240
|
-
xml.tag!(
|
|
238
|
+
xml.tag!('TransRequestID', parameters[:trans_request_id])
|
|
239
|
+
xml.tag!('CreditCardTransID', parameters[:transaction_id])
|
|
240
|
+
xml.tag!('Amount', amount(money))
|
|
241
241
|
end
|
|
242
242
|
|
|
243
243
|
def build_CustomerCreditCardCharge(xml, money, parameters)
|
|
244
244
|
cc = parameters[:credit_card]
|
|
245
245
|
name = "#{cc.first_name} #{cc.last_name}"[0...30]
|
|
246
246
|
|
|
247
|
-
xml.tag!(
|
|
248
|
-
xml.tag!(
|
|
249
|
-
xml.tag!(
|
|
250
|
-
xml.tag!(
|
|
251
|
-
xml.tag!(
|
|
252
|
-
xml.tag!(
|
|
253
|
-
xml.tag!(
|
|
247
|
+
xml.tag!('TransRequestID', parameters[:trans_request_id])
|
|
248
|
+
xml.tag!('CreditCardNumber', cc.number)
|
|
249
|
+
xml.tag!('ExpirationMonth', cc.month)
|
|
250
|
+
xml.tag!('ExpirationYear', cc.year)
|
|
251
|
+
xml.tag!('IsECommerce', 'true')
|
|
252
|
+
xml.tag!('Amount', amount(money))
|
|
253
|
+
xml.tag!('NameOnCard', name)
|
|
254
254
|
add_address(xml, parameters)
|
|
255
|
-
xml.tag!(
|
|
255
|
+
xml.tag!('CardSecurityCode', cc.verification_value) if cc.verification_value?
|
|
256
256
|
end
|
|
257
257
|
|
|
258
258
|
def build_CustomerCreditCardTxnVoidOrRefund(xml, money, parameters)
|
|
259
|
-
xml.tag!(
|
|
260
|
-
xml.tag!(
|
|
261
|
-
xml.tag!(
|
|
259
|
+
xml.tag!('TransRequestID', parameters[:trans_request_id])
|
|
260
|
+
xml.tag!('CreditCardTransID', parameters[:transaction_id])
|
|
261
|
+
xml.tag!('Amount', amount(money))
|
|
262
262
|
end
|
|
263
263
|
|
|
264
264
|
def build_CustomerCreditCardTxnVoid(xml, money, parameters)
|
|
265
|
-
xml.tag!(
|
|
266
|
-
xml.tag!(
|
|
265
|
+
xml.tag!('TransRequestID', parameters[:trans_request_id])
|
|
266
|
+
xml.tag!('CreditCardTransID', parameters[:transaction_id])
|
|
267
267
|
end
|
|
268
268
|
|
|
269
269
|
# Called reflectively by build_request
|
|
@@ -272,30 +272,30 @@ module ActiveMerchant #:nodoc:
|
|
|
272
272
|
|
|
273
273
|
def add_address(xml, parameters)
|
|
274
274
|
if address = parameters[:billing_address] || parameters[:address]
|
|
275
|
-
xml.tag!(
|
|
276
|
-
xml.tag!(
|
|
275
|
+
xml.tag!('CreditCardAddress', (address[:address1] || '')[0...30])
|
|
276
|
+
xml.tag!('CreditCardPostalCode', (address[:zip] || '')[0...9])
|
|
277
277
|
end
|
|
278
278
|
end
|
|
279
279
|
|
|
280
280
|
def cvv_result(response)
|
|
281
281
|
case response[:card_security_code_match]
|
|
282
|
-
when
|
|
283
|
-
when
|
|
284
|
-
when
|
|
282
|
+
when 'Pass' then 'M'
|
|
283
|
+
when 'Fail' then 'N'
|
|
284
|
+
when 'NotAvailable' then 'P'
|
|
285
285
|
end
|
|
286
286
|
end
|
|
287
287
|
|
|
288
288
|
def avs_result(response)
|
|
289
289
|
case "#{response[:avs_street]}|#{response[:avs_zip]}"
|
|
290
|
-
when
|
|
291
|
-
when
|
|
292
|
-
when
|
|
293
|
-
when
|
|
294
|
-
when
|
|
295
|
-
when
|
|
296
|
-
when
|
|
297
|
-
when
|
|
298
|
-
when
|
|
290
|
+
when 'Pass|Pass' then 'D'
|
|
291
|
+
when 'Pass|Fail' then 'A'
|
|
292
|
+
when 'Pass|NotAvailable' then 'B'
|
|
293
|
+
when 'Fail|Pass' then 'Z'
|
|
294
|
+
when 'Fail|Fail' then 'C'
|
|
295
|
+
when 'Fail|NotAvailable' then 'N'
|
|
296
|
+
when 'NotAvailable|Pass' then 'P'
|
|
297
|
+
when 'NotAvailable|Fail' then 'N'
|
|
298
|
+
when 'NotAvailable|NotAvailable' then 'U'
|
|
299
299
|
end
|
|
300
300
|
end
|
|
301
301
|
end
|
|
@@ -206,7 +206,7 @@ module ActiveMerchant #:nodoc:
|
|
|
206
206
|
headers = { 'Content-Type' => 'text/xml' }
|
|
207
207
|
response = parse(ssl_post(self.live_url, build_request(request, options), headers))
|
|
208
208
|
|
|
209
|
-
success = response[:request_status] ==
|
|
209
|
+
success = response[:request_status] == 'Success'
|
|
210
210
|
message = response[:request_message]
|
|
211
211
|
|
|
212
212
|
if success # => checking for connectivity success first
|
|
@@ -231,19 +231,19 @@ module ActiveMerchant #:nodoc:
|
|
|
231
231
|
begin
|
|
232
232
|
xml = REXML::Document.new(xml)
|
|
233
233
|
|
|
234
|
-
root = REXML::XPath.first(xml,
|
|
234
|
+
root = REXML::XPath.first(xml, '//QGWRequest/ResponseSummary')
|
|
235
235
|
parse_element(reply, root)
|
|
236
236
|
reply[:request_status] = reply[:Status]
|
|
237
237
|
reply[:request_message] = "#{reply[:Status]}: #{reply[:StatusDescription]}"
|
|
238
238
|
|
|
239
|
-
if root = REXML::XPath.first(xml,
|
|
239
|
+
if root = REXML::XPath.first(xml, '//QGWRequest/Result')
|
|
240
240
|
root.elements.to_a.each do |node|
|
|
241
241
|
parse_element(reply, node)
|
|
242
242
|
end
|
|
243
243
|
end
|
|
244
244
|
rescue Exception
|
|
245
245
|
reply[:request_status] = 'Failure'
|
|
246
|
-
reply[:request_message] =
|
|
246
|
+
reply[:request_message] = 'Failure: There was a problem parsing the response XML'
|
|
247
247
|
end
|
|
248
248
|
|
|
249
249
|
return reply
|
|
@@ -254,7 +254,7 @@ module ActiveMerchant #:nodoc:
|
|
|
254
254
|
node.elements.each{|e| parse_element(reply, e) }
|
|
255
255
|
else
|
|
256
256
|
if node.parent.name =~ /item/
|
|
257
|
-
parent = node.parent.name + (node.parent.attributes[
|
|
257
|
+
parent = node.parent.name + (node.parent.attributes['id'] ? '_' + node.parent.attributes['id'] : '')
|
|
258
258
|
reply[(parent + '_' + node.name).to_sym] = node.text
|
|
259
259
|
else
|
|
260
260
|
reply[node.name.to_sym] = node.text
|
|
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
|
|
|
10
10
|
|
|
11
11
|
self.homepage_url = 'http://payments.intuit.com'
|
|
12
12
|
self.display_name = 'QuickBooks Payments'
|
|
13
|
-
ENDPOINT =
|
|
13
|
+
ENDPOINT = '/quickbooks/v4/payments/charges'
|
|
14
14
|
OAUTH_ENDPOINTS = {
|
|
15
15
|
site: 'https://oauth.intuit.com',
|
|
16
16
|
request_token_path: '/oauth/v1/get_request_token',
|
|
@@ -60,7 +60,7 @@ module ActiveMerchant #:nodoc:
|
|
|
60
60
|
post = {}
|
|
61
61
|
add_amount(post, money, options)
|
|
62
62
|
add_charge_data(post, payment, options)
|
|
63
|
-
post[:capture] =
|
|
63
|
+
post[:capture] = 'true'
|
|
64
64
|
|
|
65
65
|
commit(ENDPOINT, post)
|
|
66
66
|
end
|
|
@@ -69,7 +69,7 @@ module ActiveMerchant #:nodoc:
|
|
|
69
69
|
post = {}
|
|
70
70
|
add_amount(post, money, options)
|
|
71
71
|
add_charge_data(post, payment, options)
|
|
72
|
-
post[:capture] =
|
|
72
|
+
post[:capture] = 'false'
|
|
73
73
|
|
|
74
74
|
commit(ENDPOINT, post)
|
|
75
75
|
end
|
|
@@ -145,7 +145,7 @@ module ActiveMerchant #:nodoc:
|
|
|
145
145
|
def add_creditcard(post, creditcard, options = {})
|
|
146
146
|
card = {}
|
|
147
147
|
card[:number] = creditcard.number
|
|
148
|
-
card[:expMonth] =
|
|
148
|
+
card[:expMonth] = '%02d' % creditcard.month
|
|
149
149
|
card[:expYear] = creditcard.year
|
|
150
150
|
card[:cvc] = creditcard.verification_value if creditcard.verification_value?
|
|
151
151
|
card[:name] = creditcard.name if creditcard.name
|
|
@@ -218,7 +218,7 @@ module ActiveMerchant #:nodoc:
|
|
|
218
218
|
oauth_nonce: generate_unique_id,
|
|
219
219
|
oauth_timestamp: Time.now.to_i.to_s,
|
|
220
220
|
oauth_signature_method: 'HMAC-SHA1',
|
|
221
|
-
oauth_version:
|
|
221
|
+
oauth_version: '1.0',
|
|
222
222
|
oauth_consumer_key: @options[:consumer_key],
|
|
223
223
|
oauth_token: @options[:access_token]
|
|
224
224
|
}
|
|
@@ -237,9 +237,9 @@ module ActiveMerchant #:nodoc:
|
|
|
237
237
|
oauth_headers += oauth_parameters.map {|k, v| "#{k}=\"#{v}\""}
|
|
238
238
|
|
|
239
239
|
{
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
'Content-type' => 'application/json',
|
|
241
|
+
'Request-Id' => generate_unique_id,
|
|
242
|
+
'Authorization' => oauth_headers.join(', ')
|
|
243
243
|
}
|
|
244
244
|
end
|
|
245
245
|
|
|
@@ -258,11 +258,11 @@ module ActiveMerchant #:nodoc:
|
|
|
258
258
|
end
|
|
259
259
|
|
|
260
260
|
def message_from(response)
|
|
261
|
-
response['errors'].present? ? response[
|
|
261
|
+
response['errors'].present? ? response['errors'].map {|error_hash| error_hash['message'] }.join(' ') : response['status']
|
|
262
262
|
end
|
|
263
263
|
|
|
264
264
|
def errors_from(response)
|
|
265
|
-
response['errors'].present? ? STANDARD_ERROR_CODE_MAPPING[response[
|
|
265
|
+
response['errors'].present? ? STANDARD_ERROR_CODE_MAPPING[response['errors'].first['code']] : ''
|
|
266
266
|
end
|
|
267
267
|
|
|
268
268
|
def authorization_from(response)
|
|
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
|
|
|
10
10
|
self.abstract_class = true
|
|
11
11
|
|
|
12
12
|
def self.new(options = {})
|
|
13
|
-
options.fetch(:login) { raise ArgumentError.new(
|
|
13
|
+
options.fetch(:login) { raise ArgumentError.new('Missing required parameter: login') }
|
|
14
14
|
|
|
15
15
|
version = options[:login].to_i < 10000000 ? 10 : 7
|
|
16
16
|
if version <= 7
|