activemerchant 1.105.0 → 1.107.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +99 -1
- data/README.md +2 -2
- data/lib/active_merchant/billing/credit_card_methods.rb +12 -3
- data/lib/active_merchant/billing/gateway.rb +22 -22
- data/lib/active_merchant/billing/gateways/adyen.rb +18 -7
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +2 -2
- data/lib/active_merchant/billing/gateways/authorize_net.rb +19 -19
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +11 -11
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +35 -35
- data/lib/active_merchant/billing/gateways/axcessms.rb +3 -3
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +1 -1
- data/lib/active_merchant/billing/gateways/bank_frick.rb +1 -1
- data/lib/active_merchant/billing/gateways/banwire.rb +2 -2
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +5 -5
- data/lib/active_merchant/billing/gateways/be2bill.rb +4 -4
- data/lib/active_merchant/billing/gateways/beanstream.rb +1 -1
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +27 -27
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +1 -1
- data/lib/active_merchant/billing/gateways/blue_pay.rb +8 -8
- data/lib/active_merchant/billing/gateways/blue_snap.rb +5 -2
- data/lib/active_merchant/billing/gateways/bogus.rb +20 -20
- data/lib/active_merchant/billing/gateways/borgun.rb +17 -6
- data/lib/active_merchant/billing/gateways/bpoint.rb +1 -1
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +81 -77
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +3 -3
- data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
- data/lib/active_merchant/billing/gateways/card_stream.rb +19 -19
- data/lib/active_merchant/billing/gateways/cc5.rb +7 -7
- data/lib/active_merchant/billing/gateways/cecabank.rb +3 -3
- data/lib/active_merchant/billing/gateways/cenpos.rb +3 -3
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +20 -9
- data/lib/active_merchant/billing/gateways/clearhaus.rb +1 -1
- data/lib/active_merchant/billing/gateways/commercegate.rb +2 -2
- data/lib/active_merchant/billing/gateways/conekta.rb +1 -1
- data/lib/active_merchant/billing/gateways/creditcall.rb +4 -4
- data/lib/active_merchant/billing/gateways/ct_payment.rb +1 -1
- data/lib/active_merchant/billing/gateways/culqi.rb +2 -2
- data/lib/active_merchant/billing/gateways/cyber_source.rb +154 -91
- data/lib/active_merchant/billing/gateways/d_local.rb +4 -2
- data/lib/active_merchant/billing/gateways/data_cash.rb +33 -33
- data/lib/active_merchant/billing/gateways/decidir.rb +7 -2
- data/lib/active_merchant/billing/gateways/ebanx.rb +14 -2
- data/lib/active_merchant/billing/gateways/efsnet.rb +23 -23
- data/lib/active_merchant/billing/gateways/elavon.rb +70 -18
- data/lib/active_merchant/billing/gateways/element.rb +12 -4
- data/lib/active_merchant/billing/gateways/epay.rb +40 -40
- data/lib/active_merchant/billing/gateways/evo_ca.rb +11 -11
- data/lib/active_merchant/billing/gateways/eway.rb +3 -3
- data/lib/active_merchant/billing/gateways/eway_managed.rb +40 -40
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +7 -7
- data/lib/active_merchant/billing/gateways/exact.rb +11 -11
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +3 -2
- data/lib/active_merchant/billing/gateways/federated_canada.rb +5 -5
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +21 -21
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +20 -20
- data/lib/active_merchant/billing/gateways/flo2cash.rb +4 -4
- data/lib/active_merchant/billing/gateways/forte.rb +8 -7
- data/lib/active_merchant/billing/gateways/garanti.rb +8 -8
- data/lib/active_merchant/billing/gateways/global_collect.rb +30 -24
- data/lib/active_merchant/billing/gateways/hdfc.rb +3 -3
- data/lib/active_merchant/billing/gateways/hps.rb +5 -3
- data/lib/active_merchant/billing/gateways/iats_payments.rb +32 -15
- data/lib/active_merchant/billing/gateways/inspire.rb +7 -7
- data/lib/active_merchant/billing/gateways/instapay.rb +3 -3
- data/lib/active_merchant/billing/gateways/ipp.rb +1 -1
- data/lib/active_merchant/billing/gateways/iridium.rb +12 -10
- data/lib/active_merchant/billing/gateways/itransact.rb +7 -7
- data/lib/active_merchant/billing/gateways/iveri.rb +6 -3
- data/lib/active_merchant/billing/gateways/ixopay.rb +22 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +4 -4
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +5 -5
- data/lib/active_merchant/billing/gateways/kushki.rb +34 -5
- data/lib/active_merchant/billing/gateways/latitude19.rb +2 -2
- data/lib/active_merchant/billing/gateways/linkpoint.rb +62 -62
- data/lib/active_merchant/billing/gateways/litle.rb +8 -3
- data/lib/active_merchant/billing/gateways/mastercard.rb +2 -2
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +1 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +5 -5
- data/lib/active_merchant/billing/gateways/merchant_one.rb +2 -2
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +4 -4
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +12 -12
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +11 -11
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +12 -2
- data/lib/active_merchant/billing/gateways/mercury.rb +9 -9
- data/lib/active_merchant/billing/gateways/metrics_global.rb +15 -15
- data/lib/active_merchant/billing/gateways/migs.rb +13 -13
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +7 -7
- data/lib/active_merchant/billing/gateways/monei.rb +19 -19
- data/lib/active_merchant/billing/gateways/moneris.rb +10 -10
- data/lib/active_merchant/billing/gateways/money_movers.rb +5 -5
- data/lib/active_merchant/billing/gateways/mundipagg.rb +1 -1
- data/lib/active_merchant/billing/gateways/nab_transact.rb +15 -15
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/net_registry.rb +6 -6
- data/lib/active_merchant/billing/gateways/netaxept.rb +4 -4
- data/lib/active_merchant/billing/gateways/netbanx.rb +14 -14
- data/lib/active_merchant/billing/gateways/netbilling.rb +12 -12
- data/lib/active_merchant/billing/gateways/netpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/network_merchants.rb +5 -5
- data/lib/active_merchant/billing/gateways/ogone.rb +7 -7
- data/lib/active_merchant/billing/gateways/openpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/opp.rb +13 -7
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +13 -9
- data/lib/active_merchant/billing/gateways/orbital.rb +54 -12
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +7 -7
- data/lib/active_merchant/billing/gateways/pay_conex.rb +2 -2
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +16 -16
- data/lib/active_merchant/billing/gateways/pay_junction.rb +16 -16
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +18 -2
- data/lib/active_merchant/billing/gateways/pay_secure.rb +6 -6
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +36 -36
- data/lib/active_merchant/billing/gateways/payflow.rb +7 -7
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +12 -12
- data/lib/active_merchant/billing/gateways/payflow_express.rb +4 -4
- data/lib/active_merchant/billing/gateways/payment_express.rb +9 -9
- data/lib/active_merchant/billing/gateways/paymill.rb +3 -3
- data/lib/active_merchant/billing/gateways/paypal.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +5 -5
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
- data/lib/active_merchant/billing/gateways/payscout.rb +5 -5
- data/lib/active_merchant/billing/gateways/paystation.rb +2 -2
- data/lib/active_merchant/billing/gateways/payu_latam.rb +3 -3
- data/lib/active_merchant/billing/gateways/payway.rb +12 -12
- data/lib/active_merchant/billing/gateways/pin.rb +16 -16
- data/lib/active_merchant/billing/gateways/plugnpay.rb +10 -10
- data/lib/active_merchant/billing/gateways/psigate.rb +26 -26
- data/lib/active_merchant/billing/gateways/psl_card.rb +4 -4
- data/lib/active_merchant/billing/gateways/qbms.rb +23 -23
- data/lib/active_merchant/billing/gateways/quantum.rb +4 -4
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +95 -95
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +9 -9
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +2 -2
- data/lib/active_merchant/billing/gateways/qvalent.rb +1 -1
- data/lib/active_merchant/billing/gateways/realex.rb +17 -10
- data/lib/active_merchant/billing/gateways/redsys.rb +24 -16
- data/lib/active_merchant/billing/gateways/safe_charge.rb +1 -1
- data/lib/active_merchant/billing/gateways/sage.rb +10 -10
- data/lib/active_merchant/billing/gateways/sage_pay.rb +35 -35
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +2 -2
- data/lib/active_merchant/billing/gateways/secure_net.rb +9 -9
- data/lib/active_merchant/billing/gateways/secure_pay.rb +13 -13
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +16 -16
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +2 -2
- data/lib/active_merchant/billing/gateways/skip_jack.rb +8 -8
- data/lib/active_merchant/billing/gateways/smart_ps.rb +16 -16
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +6 -6
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +4 -4
- data/lib/active_merchant/billing/gateways/stripe.rb +15 -10
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +50 -9
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +2 -2
- data/lib/active_merchant/billing/gateways/trans_first.rb +4 -4
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +19 -19
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +110 -110
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +29 -29
- data/lib/active_merchant/billing/gateways/verifi.rb +10 -10
- data/lib/active_merchant/billing/gateways/viaklix.rb +6 -6
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +6 -6
- data/lib/active_merchant/billing/gateways/webpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/wirecard.rb +6 -6
- data/lib/active_merchant/billing/gateways/worldpay.rb +22 -20
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +32 -32
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +2 -2
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +1 -1
- data/lib/active_merchant/connection.rb +1 -1
- data/lib/active_merchant/network_connection_retries.rb +3 -3
- data/lib/active_merchant/post_data.rb +1 -1
- data/lib/active_merchant/version.rb +1 -1
- data/lib/certs/cacert.pem +75 -0
- data/lib/support/ssl_verify.rb +2 -2
- data/lib/support/ssl_version.rb +2 -2
- metadata +4 -4
- data/lib/active_merchant/billing/gateways/moneris_us.rb +0 -352
@@ -33,49 +33,49 @@ module ActiveMerchant #:nodoc:
|
|
33
33
|
AUTHORIZE_NET_CIM_NAMESPACE = 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'
|
34
34
|
|
35
35
|
CIM_ACTIONS = {
|
36
|
-
:
|
37
|
-
:
|
38
|
-
:
|
39
|
-
:
|
40
|
-
:
|
41
|
-
:
|
42
|
-
:
|
43
|
-
:
|
44
|
-
:
|
45
|
-
:
|
46
|
-
:
|
47
|
-
:
|
48
|
-
:
|
49
|
-
:
|
50
|
-
:
|
36
|
+
create_customer_profile: 'createCustomerProfile',
|
37
|
+
create_customer_payment_profile: 'createCustomerPaymentProfile',
|
38
|
+
create_customer_shipping_address: 'createCustomerShippingAddress',
|
39
|
+
get_customer_profile: 'getCustomerProfile',
|
40
|
+
get_customer_profile_ids: 'getCustomerProfileIds',
|
41
|
+
get_customer_payment_profile: 'getCustomerPaymentProfile',
|
42
|
+
get_customer_shipping_address: 'getCustomerShippingAddress',
|
43
|
+
delete_customer_profile: 'deleteCustomerProfile',
|
44
|
+
delete_customer_payment_profile: 'deleteCustomerPaymentProfile',
|
45
|
+
delete_customer_shipping_address: 'deleteCustomerShippingAddress',
|
46
|
+
update_customer_profile: 'updateCustomerProfile',
|
47
|
+
update_customer_payment_profile: 'updateCustomerPaymentProfile',
|
48
|
+
update_customer_shipping_address: 'updateCustomerShippingAddress',
|
49
|
+
create_customer_profile_transaction: 'createCustomerProfileTransaction',
|
50
|
+
validate_customer_payment_profile: 'validateCustomerPaymentProfile'
|
51
51
|
}
|
52
52
|
|
53
53
|
CIM_TRANSACTION_TYPES = {
|
54
|
-
:
|
55
|
-
:
|
56
|
-
:
|
57
|
-
:
|
58
|
-
:
|
59
|
-
:
|
54
|
+
auth_capture: 'profileTransAuthCapture',
|
55
|
+
auth_only: 'profileTransAuthOnly',
|
56
|
+
capture_only: 'profileTransCaptureOnly',
|
57
|
+
prior_auth_capture: 'profileTransPriorAuthCapture',
|
58
|
+
refund: 'profileTransRefund',
|
59
|
+
void: 'profileTransVoid'
|
60
60
|
}
|
61
61
|
|
62
62
|
CIM_VALIDATION_MODES = {
|
63
|
-
:
|
64
|
-
:
|
65
|
-
:
|
66
|
-
:
|
63
|
+
none: 'none',
|
64
|
+
test: 'testMode',
|
65
|
+
live: 'liveMode',
|
66
|
+
old: 'oldLiveMode'
|
67
67
|
}
|
68
68
|
|
69
69
|
BANK_ACCOUNT_TYPES = {
|
70
|
-
:
|
71
|
-
:
|
72
|
-
:
|
70
|
+
checking: 'checking',
|
71
|
+
savings: 'savings',
|
72
|
+
business_checking: 'businessChecking'
|
73
73
|
}
|
74
74
|
|
75
75
|
ECHECK_TYPES = {
|
76
|
-
:
|
77
|
-
:
|
78
|
-
:
|
76
|
+
ccd: 'CCD',
|
77
|
+
ppd: 'PPD',
|
78
|
+
web: 'WEB'
|
79
79
|
}
|
80
80
|
|
81
81
|
self.homepage_url = 'http://www.authorize.net/'
|
@@ -487,9 +487,9 @@ module ActiveMerchant #:nodoc:
|
|
487
487
|
def build_request(action, options = {})
|
488
488
|
raise StandardError, "Invalid Customer Information Manager Action: #{action}" unless CIM_ACTIONS.include?(action)
|
489
489
|
|
490
|
-
xml = Builder::XmlMarkup.new(:
|
491
|
-
xml.instruct!(:xml, :
|
492
|
-
xml.tag!("#{CIM_ACTIONS[action]}Request", :
|
490
|
+
xml = Builder::XmlMarkup.new(indent: 2)
|
491
|
+
xml.instruct!(:xml, version: '1.0', encoding: 'utf-8')
|
492
|
+
xml.tag!("#{CIM_ACTIONS[action]}Request", xmlns: AUTHORIZE_NET_CIM_NAMESPACE) do
|
493
493
|
add_merchant_authentication(xml)
|
494
494
|
# Merchant-assigned reference ID for the request
|
495
495
|
xml.tag!('refId', options[:ref_id]) if options[:ref_id]
|
@@ -852,7 +852,7 @@ module ActiveMerchant #:nodoc:
|
|
852
852
|
|
853
853
|
response_params = parse(action, xml)
|
854
854
|
|
855
|
-
message_element= response_params['messages']['message']
|
855
|
+
message_element = response_params['messages']['message']
|
856
856
|
first_error = message_element.is_a?(Array) ? message_element.first : message_element
|
857
857
|
message = first_error['text']
|
858
858
|
test_mode = @options[:test_requests] || message =~ /Test Mode/
|
@@ -72,8 +72,8 @@ module ActiveMerchant #:nodoc:
|
|
72
72
|
authorization = response[:unique_id]
|
73
73
|
|
74
74
|
Response.new(success, message, response,
|
75
|
-
:
|
76
|
-
:
|
75
|
+
authorization: authorization,
|
76
|
+
test: (response[:mode] != 'LIVE')
|
77
77
|
)
|
78
78
|
end
|
79
79
|
|
@@ -103,7 +103,7 @@ module ActiveMerchant #:nodoc:
|
|
103
103
|
end
|
104
104
|
|
105
105
|
def build_request(payment_code, money, payment, options)
|
106
|
-
xml = Builder::XmlMarkup.new :
|
106
|
+
xml = Builder::XmlMarkup.new indent: 2
|
107
107
|
xml.instruct!
|
108
108
|
xml.tag! 'Request', 'version' => API_VERSION do
|
109
109
|
xml.tag! 'Header' do
|
@@ -132,7 +132,7 @@ module ActiveMerchant #:nodoc:
|
|
132
132
|
end
|
133
133
|
|
134
134
|
def add_credit_card(xml, payment)
|
135
|
-
xml.CreditCard :
|
135
|
+
xml.CreditCard Registered: 'False' do
|
136
136
|
xml.CardNumber payment.number
|
137
137
|
xml.ExpM format(payment.month, :two_digits)
|
138
138
|
xml.ExpY format(payment.year, :four_digits)
|
@@ -166,7 +166,7 @@ module ActiveMerchant #:nodoc:
|
|
166
166
|
end
|
167
167
|
|
168
168
|
def build_xml_request(action, data)
|
169
|
-
xml = Builder::XmlMarkup.new :
|
169
|
+
xml = Builder::XmlMarkup.new indent: 2
|
170
170
|
xml.Request(version: '1.0') do
|
171
171
|
xml.Header do
|
172
172
|
xml.Security(sender: @options[:sender], type: 'MERCHANT')
|
@@ -92,8 +92,8 @@ module ActiveMerchant #:nodoc:
|
|
92
92
|
Response.new(success?(response),
|
93
93
|
response['message'],
|
94
94
|
response,
|
95
|
-
:
|
96
|
-
:
|
95
|
+
test: test?,
|
96
|
+
authorization: response['code_auth'])
|
97
97
|
end
|
98
98
|
|
99
99
|
def success?(response)
|
@@ -108,7 +108,7 @@ module ActiveMerchant #:nodoc:
|
|
108
108
|
def store(creditcard, options = {})
|
109
109
|
post = store_request(options)
|
110
110
|
post[:card] = credit_card_hash(creditcard)
|
111
|
-
post[:recurring] = {:
|
111
|
+
post[:recurring] = {contract: 'RECURRING'}
|
112
112
|
|
113
113
|
commit('store', post)
|
114
114
|
end
|
@@ -161,20 +161,20 @@ module ActiveMerchant #:nodoc:
|
|
161
161
|
message_from(response),
|
162
162
|
response,
|
163
163
|
test: test?,
|
164
|
-
avs_result: AVSResult.new(:
|
164
|
+
avs_result: AVSResult.new(code: parse_avs_code(response)),
|
165
165
|
authorization: response['recurringDetailReference'] || authorization_from(post, response)
|
166
166
|
)
|
167
167
|
rescue ResponseError => e
|
168
168
|
case e.response.code
|
169
169
|
when '401'
|
170
|
-
return Response.new(false, 'Invalid credentials', {}, :
|
170
|
+
return Response.new(false, 'Invalid credentials', {}, test: test?)
|
171
171
|
when '403'
|
172
|
-
return Response.new(false, 'Not allowed', {}, :
|
172
|
+
return Response.new(false, 'Not allowed', {}, test: test?)
|
173
173
|
when '422', '500'
|
174
174
|
if e.response.body.split(/\W+/).any? { |word| %w(validation configuration security).include?(word) }
|
175
175
|
error_message = e.response.body[/#{Regexp.escape('message=')}(.*?)#{Regexp.escape('&')}/m, 1].tr('+', ' ')
|
176
176
|
error_code = e.response.body[/#{Regexp.escape('errorCode=')}(.*?)#{Regexp.escape('&')}/m, 1]
|
177
|
-
return Response.new(false, error_code + ': ' + error_message, {}, :
|
177
|
+
return Response.new(false, error_code + ': ' + error_message, {}, test: test?)
|
178
178
|
end
|
179
179
|
end
|
180
180
|
raise
|
@@ -92,8 +92,8 @@ module ActiveMerchant #:nodoc:
|
|
92
92
|
successful?(response),
|
93
93
|
message_from(response),
|
94
94
|
response,
|
95
|
-
:
|
96
|
-
:
|
95
|
+
authorization: response['TRANSACTIONID'],
|
96
|
+
test: test?
|
97
97
|
)
|
98
98
|
end
|
99
99
|
|
@@ -111,8 +111,8 @@ module ActiveMerchant #:nodoc:
|
|
111
111
|
|
112
112
|
def post_data(action, parameters = {})
|
113
113
|
{
|
114
|
-
:
|
115
|
-
:
|
114
|
+
method: action,
|
115
|
+
params: parameters.merge(HASH: signature(parameters, action))
|
116
116
|
}.to_query
|
117
117
|
end
|
118
118
|
|
@@ -175,7 +175,7 @@ module ActiveMerchant #:nodoc:
|
|
175
175
|
# can't actually delete a secure profile with the supplicated API. This function sets the status of the profile to closed (C).
|
176
176
|
# Closed profiles will have to removed manually.
|
177
177
|
def delete(vault_id)
|
178
|
-
update(vault_id, false, {:
|
178
|
+
update(vault_id, false, {status: 'C'})
|
179
179
|
end
|
180
180
|
|
181
181
|
alias_method :unstore, :delete
|
@@ -9,20 +9,20 @@ module ActiveMerchant #:nodoc:
|
|
9
9
|
SP_SERVICE_VERSION = '1.1'
|
10
10
|
|
11
11
|
TRANSACTIONS = {
|
12
|
-
:
|
13
|
-
:
|
14
|
-
:
|
15
|
-
:
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:
|
12
|
+
authorization: 'PA',
|
13
|
+
purchase: 'P',
|
14
|
+
capture: 'PAC',
|
15
|
+
refund: 'R',
|
16
|
+
void: 'VP',
|
17
|
+
check_purchase: 'D',
|
18
|
+
check_refund: 'C',
|
19
|
+
void_purchase: 'VP',
|
20
|
+
void_refund: 'VR'
|
21
21
|
}
|
22
22
|
|
23
23
|
PROFILE_OPERATIONS = {
|
24
|
-
:
|
25
|
-
:
|
24
|
+
new: 'N',
|
25
|
+
modify: 'M'
|
26
26
|
}
|
27
27
|
|
28
28
|
CVD_CODES = {
|
@@ -41,24 +41,24 @@ module ActiveMerchant #:nodoc:
|
|
41
41
|
}
|
42
42
|
|
43
43
|
PERIODS = {
|
44
|
-
:
|
45
|
-
:
|
46
|
-
:
|
47
|
-
:
|
44
|
+
days: 'D',
|
45
|
+
weeks: 'W',
|
46
|
+
months: 'M',
|
47
|
+
years: 'Y'
|
48
48
|
}
|
49
49
|
|
50
50
|
PERIODICITIES = {
|
51
|
-
:
|
52
|
-
:
|
53
|
-
:
|
54
|
-
:
|
55
|
-
:
|
56
|
-
:
|
51
|
+
daily: [:days, 1],
|
52
|
+
weekly: [:weeks, 1],
|
53
|
+
biweekly: [:weeks, 2],
|
54
|
+
monthly: [:months, 1],
|
55
|
+
bimonthly: [:months, 2],
|
56
|
+
yearly: [:years, 1]
|
57
57
|
}
|
58
58
|
|
59
59
|
RECURRING_OPERATION = {
|
60
|
-
:
|
61
|
-
:
|
60
|
+
update: 'M',
|
61
|
+
cancel: 'C'
|
62
62
|
}
|
63
63
|
|
64
64
|
STATES = {
|
@@ -414,10 +414,10 @@ module ActiveMerchant #:nodoc:
|
|
414
414
|
response = parse(ssl_post((use_profile_api ? SECURE_PROFILE_URL : self.live_url), data))
|
415
415
|
response[:customer_vault_id] = response[:customerCode] if response[:customerCode]
|
416
416
|
build_response(success?(response), message_from(response), response,
|
417
|
-
:
|
418
|
-
:
|
419
|
-
:
|
420
|
-
:
|
417
|
+
test: test? || response[:authCode] == 'TEST',
|
418
|
+
authorization: authorization_from(response),
|
419
|
+
cvv_result: CVD_CODES[response[:cvdId]],
|
420
|
+
avs_result: { code: AVS_CODES.include?(response[:avsId]) ? AVS_CODES[response[:avsId]] : response[:avsId] }
|
421
421
|
)
|
422
422
|
end
|
423
423
|
|
@@ -18,7 +18,7 @@ module ActiveMerchant #:nodoc:
|
|
18
18
|
# post back is for until the response of the confirmation is
|
19
19
|
# received, which contains the order number.
|
20
20
|
def self.confirm(transaction)
|
21
|
-
gateway = new(:
|
21
|
+
gateway = new(login: '')
|
22
22
|
gateway.confirm(transaction)
|
23
23
|
end
|
24
24
|
|
@@ -18,7 +18,7 @@ module ActiveMerchant #:nodoc:
|
|
18
18
|
'TRANS_ID' => :transaction_id,
|
19
19
|
'STATUS' => :response_code,
|
20
20
|
'AVS' => :avs_result_code,
|
21
|
-
'CVV2'=> :card_code,
|
21
|
+
'CVV2' => :card_code,
|
22
22
|
'AUTH_CODE' => :authorization,
|
23
23
|
'MESSAGE' => :message,
|
24
24
|
'REBID' => :rebid,
|
@@ -29,7 +29,7 @@ module ActiveMerchant #:nodoc:
|
|
29
29
|
|
30
30
|
REBILL_FIELD_MAP = {
|
31
31
|
'REBILL_ID' => :rebill_id,
|
32
|
-
'ACCOUNT_ID'=> :account_id,
|
32
|
+
'ACCOUNT_ID' => :account_id,
|
33
33
|
'USER_ID' => :user_id,
|
34
34
|
'TEMPLATE_ID' => :template_id,
|
35
35
|
'STATUS' => :status,
|
@@ -343,8 +343,8 @@ module ActiveMerchant #:nodoc:
|
|
343
343
|
message = parsed[:status]
|
344
344
|
|
345
345
|
Response.new(success, message, parsed,
|
346
|
-
:
|
347
|
-
:
|
346
|
+
test: test?,
|
347
|
+
authorization: parsed[:rebill_id])
|
348
348
|
end
|
349
349
|
|
350
350
|
def parse(body)
|
@@ -363,10 +363,10 @@ module ActiveMerchant #:nodoc:
|
|
363
363
|
message = message_from(parsed)
|
364
364
|
success = parsed[:response_code] == '1'
|
365
365
|
Response.new(success, message, parsed,
|
366
|
-
:
|
367
|
-
:
|
368
|
-
:
|
369
|
-
:
|
366
|
+
test: test?,
|
367
|
+
authorization: (parsed[:rebid] && parsed[:rebid] != '' ? parsed[:rebid] : parsed[:transaction_id]),
|
368
|
+
avs_result: { code: parsed[:avs_result_code] },
|
369
|
+
cvv_result: parsed[:card_code]
|
370
370
|
)
|
371
371
|
end
|
372
372
|
|
@@ -9,6 +9,8 @@ module ActiveMerchant
|
|
9
9
|
|
10
10
|
self.default_currency = 'USD'
|
11
11
|
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners_club, :maestro, :naranja, :cabal]
|
12
|
+
self.currencies_without_fractions = %w(BYR CLP ILS JPY KRW VND XOF)
|
13
|
+
self.currencies_with_three_decimal_places = %w(BHD JOD KWD OMR TND)
|
12
14
|
|
13
15
|
self.homepage_url = 'https://home.bluesnap.com/'
|
14
16
|
self.display_name = 'BlueSnap'
|
@@ -188,8 +190,9 @@ module ActiveMerchant
|
|
188
190
|
end
|
189
191
|
|
190
192
|
def add_amount(doc, money, options)
|
191
|
-
|
192
|
-
doc.
|
193
|
+
currency = options[:currency] || currency(money)
|
194
|
+
doc.amount(localized_amount(money, currency))
|
195
|
+
doc.currency(currency)
|
193
196
|
end
|
194
197
|
|
195
198
|
def add_personal_info(doc, payment_method, options)
|
@@ -47,9 +47,9 @@ module ActiveMerchant #:nodoc:
|
|
47
47
|
money = amount(money)
|
48
48
|
case normalize(paysource)
|
49
49
|
when /1$/
|
50
|
-
Response.new(true, SUCCESS_MESSAGE, {:
|
50
|
+
Response.new(true, SUCCESS_MESSAGE, {paid_amount: money}, test: true)
|
51
51
|
when /2$/
|
52
|
-
Response.new(false, FAILURE_MESSAGE, {:
|
52
|
+
Response.new(false, FAILURE_MESSAGE, {paid_amount: money, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
|
53
53
|
else
|
54
54
|
raise Error, error_message(paysource)
|
55
55
|
end
|
@@ -61,9 +61,9 @@ module ActiveMerchant #:nodoc:
|
|
61
61
|
when /1$/
|
62
62
|
raise Error, REFUND_ERROR_MESSAGE
|
63
63
|
when /2$/
|
64
|
-
Response.new(false, FAILURE_MESSAGE, {:
|
64
|
+
Response.new(false, FAILURE_MESSAGE, {paid_amount: money, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
|
65
65
|
else
|
66
|
-
Response.new(true, SUCCESS_MESSAGE, {:
|
66
|
+
Response.new(true, SUCCESS_MESSAGE, {paid_amount: money}, test: true)
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
@@ -73,9 +73,9 @@ module ActiveMerchant #:nodoc:
|
|
73
73
|
when /1$/
|
74
74
|
raise Error, CAPTURE_ERROR_MESSAGE
|
75
75
|
when /2$/
|
76
|
-
Response.new(false, FAILURE_MESSAGE, {:
|
76
|
+
Response.new(false, FAILURE_MESSAGE, {paid_amount: money, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
|
77
77
|
else
|
78
|
-
Response.new(true, SUCCESS_MESSAGE, {:
|
78
|
+
Response.new(true, SUCCESS_MESSAGE, {paid_amount: money}, test: true)
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
@@ -84,18 +84,18 @@ module ActiveMerchant #:nodoc:
|
|
84
84
|
when /1$/
|
85
85
|
raise Error, VOID_ERROR_MESSAGE
|
86
86
|
when /2$/
|
87
|
-
Response.new(false, FAILURE_MESSAGE, {:
|
87
|
+
Response.new(false, FAILURE_MESSAGE, {authorization: reference, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
|
88
88
|
else
|
89
|
-
Response.new(true, SUCCESS_MESSAGE, {:
|
89
|
+
Response.new(true, SUCCESS_MESSAGE, {authorization: reference}, test: true)
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
93
|
def store(paysource, options = {})
|
94
94
|
case normalize(paysource)
|
95
95
|
when /1$/
|
96
|
-
Response.new(true, SUCCESS_MESSAGE, {:
|
96
|
+
Response.new(true, SUCCESS_MESSAGE, {billingid: '1'}, test: true, authorization: AUTHORIZATION)
|
97
97
|
when /2$/
|
98
|
-
Response.new(false, FAILURE_MESSAGE, {:
|
98
|
+
Response.new(false, FAILURE_MESSAGE, {billingid: nil, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
|
99
99
|
else
|
100
100
|
raise Error, error_message(paysource)
|
101
101
|
end
|
@@ -104,9 +104,9 @@ module ActiveMerchant #:nodoc:
|
|
104
104
|
def unstore(reference, options = {})
|
105
105
|
case reference
|
106
106
|
when /1$/
|
107
|
-
Response.new(true, SUCCESS_MESSAGE, {}, :
|
107
|
+
Response.new(true, SUCCESS_MESSAGE, {}, test: true)
|
108
108
|
when /2$/
|
109
|
-
Response.new(false, FAILURE_MESSAGE, {:
|
109
|
+
Response.new(false, FAILURE_MESSAGE, {error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
|
110
110
|
else
|
111
111
|
raise Error, UNSTORE_ERROR_MESSAGE
|
112
112
|
end
|
@@ -118,9 +118,9 @@ module ActiveMerchant #:nodoc:
|
|
118
118
|
money = amount(money)
|
119
119
|
case money
|
120
120
|
when /00$/
|
121
|
-
Response.new(true, SUCCESS_MESSAGE, {:
|
121
|
+
Response.new(true, SUCCESS_MESSAGE, {authorized_amount: money}, test: true, authorization: AUTHORIZATION, emv_authorization: AUTHORIZATION_EMV_SUCCESS)
|
122
122
|
when /05$/
|
123
|
-
Response.new(false, FAILURE_MESSAGE, {:
|
123
|
+
Response.new(false, FAILURE_MESSAGE, {authorized_amount: money, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error], emv_authorization: AUTHORIZATION_EMV_DECLINE)
|
124
124
|
else
|
125
125
|
raise Error, error_message(paysource)
|
126
126
|
end
|
@@ -130,9 +130,9 @@ module ActiveMerchant #:nodoc:
|
|
130
130
|
money = amount(money)
|
131
131
|
case normalize(paysource)
|
132
132
|
when /1$/, AUTHORIZATION
|
133
|
-
Response.new(true, SUCCESS_MESSAGE, {:
|
133
|
+
Response.new(true, SUCCESS_MESSAGE, {authorized_amount: money}, test: true, authorization: AUTHORIZATION)
|
134
134
|
when /2$/
|
135
|
-
Response.new(false, FAILURE_MESSAGE, {:
|
135
|
+
Response.new(false, FAILURE_MESSAGE, {authorized_amount: money, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
|
136
136
|
else
|
137
137
|
raise Error, error_message(paysource)
|
138
138
|
end
|
@@ -142,9 +142,9 @@ module ActiveMerchant #:nodoc:
|
|
142
142
|
money = amount(money)
|
143
143
|
case money
|
144
144
|
when /00$/
|
145
|
-
Response.new(true, SUCCESS_MESSAGE, {:
|
145
|
+
Response.new(true, SUCCESS_MESSAGE, {paid_amount: money}, test: true, authorization: AUTHORIZATION, emv_authorization: AUTHORIZATION_EMV_SUCCESS)
|
146
146
|
when /05$/
|
147
|
-
Response.new(false, FAILURE_MESSAGE, {:
|
147
|
+
Response.new(false, FAILURE_MESSAGE, {paid_amount: money, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error], emv_authorization: AUTHORIZATION_EMV_DECLINE)
|
148
148
|
else
|
149
149
|
raise Error, error_message(paysource)
|
150
150
|
end
|
@@ -154,9 +154,9 @@ module ActiveMerchant #:nodoc:
|
|
154
154
|
money = amount(money)
|
155
155
|
case normalize(paysource)
|
156
156
|
when /1$/, AUTHORIZATION
|
157
|
-
Response.new(true, SUCCESS_MESSAGE, {:
|
157
|
+
Response.new(true, SUCCESS_MESSAGE, {paid_amount: money}, test: true, authorization: AUTHORIZATION)
|
158
158
|
when /2$/
|
159
|
-
Response.new(false, FAILURE_MESSAGE, {:
|
159
|
+
Response.new(false, FAILURE_MESSAGE, {paid_amount: money, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
|
160
160
|
else
|
161
161
|
raise Error, error_message(paysource)
|
162
162
|
end
|