activemerchant 1.105.0 → 1.106.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +31 -1
- data/README.md +1 -1
- 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 +17 -6
- 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 +2 -2
- data/lib/active_merchant/billing/gateways/bpoint.rb +1 -1
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +74 -74
- 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 +1 -1
- 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 +86 -72
- data/lib/active_merchant/billing/gateways/data_cash.rb +33 -33
- data/lib/active_merchant/billing/gateways/decidir.rb +2 -2
- data/lib/active_merchant/billing/gateways/ebanx.rb +1 -1
- data/lib/active_merchant/billing/gateways/efsnet.rb +23 -23
- data/lib/active_merchant/billing/gateways/elavon.rb +13 -13
- 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 +20 -20
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +19 -19
- data/lib/active_merchant/billing/gateways/flo2cash.rb +4 -4
- data/lib/active_merchant/billing/gateways/forte.rb +1 -1
- data/lib/active_merchant/billing/gateways/garanti.rb +8 -8
- data/lib/active_merchant/billing/gateways/hdfc.rb +3 -3
- data/lib/active_merchant/billing/gateways/hps.rb +1 -1
- data/lib/active_merchant/billing/gateways/iats_payments.rb +1 -1
- 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 +8 -8
- data/lib/active_merchant/billing/gateways/itransact.rb +7 -7
- data/lib/active_merchant/billing/gateways/iveri.rb +2 -2
- data/lib/active_merchant/billing/gateways/ixopay.rb +21 -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/latitude19.rb +2 -2
- data/lib/active_merchant/billing/gateways/linkpoint.rb +62 -62
- data/lib/active_merchant/billing/gateways/litle.rb +2 -2
- data/lib/active_merchant/billing/gateways/mastercard.rb +2 -2
- 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 +1 -1
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +9 -9
- data/lib/active_merchant/billing/gateways/orbital.rb +10 -10
- 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 +7 -7
- 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 +8 -8
- 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 +15 -15
- 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 +8 -8
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +10 -3
- 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 +15 -15
- 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/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 +2 -3
- data/lib/active_merchant/billing/gateways/moneris_us.rb +0 -352
@@ -449,8 +449,8 @@ module ActiveMerchant #:nodoc:
|
|
449
449
|
options = {
|
450
450
|
authorization: authorization_from(kind, parsed, money),
|
451
451
|
test: test?,
|
452
|
-
:
|
453
|
-
:
|
452
|
+
avs_result: { code: AVS_RESPONSE_CODE[parsed[:fraudResult_avsResult]] },
|
453
|
+
cvv_result: parsed[:fraudResult_cardValidationResult]
|
454
454
|
}
|
455
455
|
|
456
456
|
Response.new(success_from(kind, parsed), parsed[:message], parsed, options)
|
@@ -46,7 +46,7 @@ module ActiveMerchant #:nodoc:
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def capture(money, transaction_id, options = {})
|
49
|
-
post ={}
|
49
|
+
post = {}
|
50
50
|
post[:transaction_id] = transaction_id
|
51
51
|
post[:client_reference_number] = options[:customer] if options.has_key?(:customer)
|
52
52
|
add_invoice(post, options)
|
@@ -166,10 +166,10 @@ module ActiveMerchant #:nodoc:
|
|
166
166
|
end
|
167
167
|
|
168
168
|
Response.new(response['error_code'] == '000', message_from(response), response,
|
169
|
-
:
|
170
|
-
:
|
171
|
-
:
|
172
|
-
:
|
169
|
+
authorization: response['transaction_id'],
|
170
|
+
test: test?,
|
171
|
+
cvv_result: response['cvv2_result'],
|
172
|
+
avs_result: { code: response['avs_result'] }
|
173
173
|
)
|
174
174
|
end
|
175
175
|
|
@@ -101,8 +101,8 @@ module ActiveMerchant #:nodoc:
|
|
101
101
|
(responses['response'].to_i == 1),
|
102
102
|
responses['responsetext'],
|
103
103
|
responses,
|
104
|
-
:
|
105
|
-
:
|
104
|
+
test: test?,
|
105
|
+
authorization: responses['transactionid']
|
106
106
|
)
|
107
107
|
end
|
108
108
|
end
|
@@ -172,20 +172,20 @@ module ActiveMerchant #:nodoc:
|
|
172
172
|
message_from(succeeded, response_data),
|
173
173
|
response_data,
|
174
174
|
authorization: authorization_from(post, response_data),
|
175
|
-
:
|
176
|
-
:
|
175
|
+
avs_result: AVSResult.new(code: response_data['avs_response']),
|
176
|
+
cvv_result: CVVResult.new(response_data['cvv2_response']),
|
177
177
|
test: test?
|
178
178
|
)
|
179
179
|
end
|
180
180
|
|
181
181
|
def headers
|
182
182
|
{
|
183
|
-
'Content-Type'
|
183
|
+
'Content-Type' => 'application/xml'
|
184
184
|
}
|
185
185
|
end
|
186
186
|
|
187
187
|
def build_request(post)
|
188
|
-
Nokogiri::XML::Builder.new(:
|
188
|
+
Nokogiri::XML::Builder.new(encoding: 'utf-8') do |xml|
|
189
189
|
xml.interface_driver {
|
190
190
|
xml.trans_catalog {
|
191
191
|
xml.transaction(name: 'creditcard') {
|
@@ -22,12 +22,12 @@ module ActiveMerchant #:nodoc:
|
|
22
22
|
TX_NAMESPACE_V4 = 'http://schemas.merchantwarehouse.com/merchantware/40/Credit/'
|
23
23
|
|
24
24
|
ACTIONS = {
|
25
|
-
:
|
26
|
-
:
|
27
|
-
:
|
28
|
-
:
|
29
|
-
:
|
30
|
-
:
|
25
|
+
purchase: 'IssueKeyedSale',
|
26
|
+
authorize: 'IssueKeyedPreAuth',
|
27
|
+
capture: 'IssuePostAuth',
|
28
|
+
void: 'VoidPreAuthorization',
|
29
|
+
credit: 'IssueKeyedRefund',
|
30
|
+
reference_credit: 'IssueRefundByReference'
|
31
31
|
}
|
32
32
|
|
33
33
|
# Creates a new MerchantWareGateway
|
@@ -117,7 +117,7 @@ module ActiveMerchant #:nodoc:
|
|
117
117
|
private
|
118
118
|
|
119
119
|
def soap_request(action)
|
120
|
-
xml = Builder::XmlMarkup.new :
|
120
|
+
xml = Builder::XmlMarkup.new indent: 2
|
121
121
|
xml.instruct!
|
122
122
|
xml.tag! 'env:Envelope', ENV_NAMESPACES do
|
123
123
|
xml.tag! 'env:Body' do
|
@@ -131,7 +131,7 @@ module ActiveMerchant #:nodoc:
|
|
131
131
|
end
|
132
132
|
|
133
133
|
def v4_soap_request(action)
|
134
|
-
xml = Builder::XmlMarkup.new :
|
134
|
+
xml = Builder::XmlMarkup.new indent: 2
|
135
135
|
xml.instruct!
|
136
136
|
xml.tag! 'soap:Envelope', ENV_NAMESPACES_V4 do
|
137
137
|
xml.tag! 'soap:Body' do
|
@@ -300,10 +300,10 @@ module ActiveMerchant #:nodoc:
|
|
300
300
|
end
|
301
301
|
|
302
302
|
Response.new(response[:success], response[:message], response,
|
303
|
-
:
|
304
|
-
:
|
305
|
-
:
|
306
|
-
:
|
303
|
+
test: test?,
|
304
|
+
authorization: authorization_from(response),
|
305
|
+
avs_result: { code: response['AVSResponse'] },
|
306
|
+
cvv_result: response['CVResponse']
|
307
307
|
)
|
308
308
|
end
|
309
309
|
|
@@ -16,12 +16,12 @@ module ActiveMerchant #:nodoc:
|
|
16
16
|
TX_NAMESPACE = 'http://schemas.merchantwarehouse.com/merchantware/40/Credit/'
|
17
17
|
|
18
18
|
ACTIONS = {
|
19
|
-
:
|
20
|
-
:
|
21
|
-
:
|
22
|
-
:
|
23
|
-
:
|
24
|
-
:
|
19
|
+
purchase: 'SaleKeyed',
|
20
|
+
reference_purchase: 'RepeatSale',
|
21
|
+
authorize: 'PreAuthorizationKeyed',
|
22
|
+
capture: 'PostAuthorization',
|
23
|
+
void: 'Void',
|
24
|
+
refund: 'Refund'
|
25
25
|
}
|
26
26
|
|
27
27
|
# Creates a new MerchantWareVersionFourGateway
|
@@ -129,7 +129,7 @@ module ActiveMerchant #:nodoc:
|
|
129
129
|
private
|
130
130
|
|
131
131
|
def soap_request(action)
|
132
|
-
xml = Builder::XmlMarkup.new :
|
132
|
+
xml = Builder::XmlMarkup.new indent: 2
|
133
133
|
xml.instruct!
|
134
134
|
xml.tag! 'soap:Envelope', ENV_NAMESPACES do
|
135
135
|
xml.tag! 'soap:Body' do
|
@@ -271,10 +271,10 @@ module ActiveMerchant #:nodoc:
|
|
271
271
|
end
|
272
272
|
|
273
273
|
Response.new(response[:success], response[:message], response,
|
274
|
-
:
|
275
|
-
:
|
276
|
-
:
|
277
|
-
:
|
274
|
+
test: test?,
|
275
|
+
authorization: authorization_from(response),
|
276
|
+
avs_result: { code: response['AvsResponse'] },
|
277
|
+
cvv_result: response['CvResponse']
|
278
278
|
)
|
279
279
|
end
|
280
280
|
|
@@ -31,6 +31,7 @@ module ActiveMerchant #:nodoc:
|
|
31
31
|
add_address(post, options)
|
32
32
|
add_payment_method(post, payment_method)
|
33
33
|
add_recurring_flag(post, options)
|
34
|
+
add_soft_descriptors(post, options)
|
34
35
|
commit('processAuth', post)
|
35
36
|
end
|
36
37
|
|
@@ -41,6 +42,7 @@ module ActiveMerchant #:nodoc:
|
|
41
42
|
add_address(post, options)
|
42
43
|
add_payment_method(post, payment_method)
|
43
44
|
add_recurring_flag(post, options)
|
45
|
+
add_soft_descriptors(post, options)
|
44
46
|
commit('processCard', post)
|
45
47
|
end
|
46
48
|
|
@@ -48,6 +50,7 @@ module ActiveMerchant #:nodoc:
|
|
48
50
|
post = {}
|
49
51
|
add_amount(post, money, options)
|
50
52
|
add_transaction(post, identification)
|
53
|
+
add_soft_descriptors(post, options)
|
51
54
|
post['captureAmount'] = amount(money)
|
52
55
|
commit('processCapture', post)
|
53
56
|
end
|
@@ -56,6 +59,7 @@ module ActiveMerchant #:nodoc:
|
|
56
59
|
post = {}
|
57
60
|
add_amount(post, money, options)
|
58
61
|
add_transaction(post, identification)
|
62
|
+
add_soft_descriptors(post, options)
|
59
63
|
post['refundAmount'] = amount(money)
|
60
64
|
commit('refundCard', post)
|
61
65
|
end
|
@@ -153,6 +157,12 @@ module ActiveMerchant #:nodoc:
|
|
153
157
|
post['recurringFlag'] = options[:recurring_flag]
|
154
158
|
end
|
155
159
|
|
160
|
+
def add_soft_descriptors(post, options)
|
161
|
+
post['descriptorName'] = options[:descriptor_name] if options[:descriptor_name]
|
162
|
+
post['descriptorCity'] = options[:descriptor_city] if options[:descriptor_city]
|
163
|
+
post['descriptorState'] = options[:descriptor_state] if options[:descriptor_state]
|
164
|
+
end
|
165
|
+
|
156
166
|
def verification_hash(money, currency)
|
157
167
|
Digest::MD5.hexdigest(
|
158
168
|
(
|
@@ -201,8 +211,8 @@ module ActiveMerchant #:nodoc:
|
|
201
211
|
success?(response),
|
202
212
|
response[:response_message],
|
203
213
|
response,
|
204
|
-
:
|
205
|
-
:
|
214
|
+
test: test?,
|
215
|
+
authorization: (response[:card_id] || response[:transaction_id])
|
206
216
|
)
|
207
217
|
end
|
208
218
|
|
@@ -12,8 +12,8 @@ module ActiveMerchant #:nodoc:
|
|
12
12
|
# and +refund+ will become mandatory.
|
13
13
|
class MercuryGateway < Gateway
|
14
14
|
URLS = {
|
15
|
-
:
|
16
|
-
:
|
15
|
+
test: 'https://w1.mercurycert.net/ws/ws.asmx',
|
16
|
+
live: 'https://w1.mercurypay.com/ws/ws.asmx'
|
17
17
|
}
|
18
18
|
|
19
19
|
self.homepage_url = 'http://www.mercurypay.com'
|
@@ -51,14 +51,14 @@ module ActiveMerchant #:nodoc:
|
|
51
51
|
def authorize(money, credit_card, options = {})
|
52
52
|
requires!(options, :order_id)
|
53
53
|
|
54
|
-
request = build_non_authorized_request('PreAuth', money, credit_card, options.merge(:
|
54
|
+
request = build_non_authorized_request('PreAuth', money, credit_card, options.merge(authorized: money))
|
55
55
|
commit('PreAuth', request)
|
56
56
|
end
|
57
57
|
|
58
58
|
def capture(money, authorization, options = {})
|
59
59
|
requires!(options, :credit_card) unless @use_tokenization
|
60
60
|
|
61
|
-
request = build_authorized_request('PreAuthCapture', money, authorization, options[:credit_card], options.merge(:
|
61
|
+
request = build_authorized_request('PreAuthCapture', money, authorization, options[:credit_card], options.merge(authorized: money))
|
62
62
|
commit('PreAuthCapture', request)
|
63
63
|
end
|
64
64
|
|
@@ -303,11 +303,11 @@ module ActiveMerchant #:nodoc:
|
|
303
303
|
message = success ? 'Success' : message_from(response)
|
304
304
|
|
305
305
|
Response.new(success, message, response,
|
306
|
-
:
|
307
|
-
:
|
308
|
-
:
|
309
|
-
:
|
310
|
-
:
|
306
|
+
test: test?,
|
307
|
+
authorization: authorization_from(response),
|
308
|
+
avs_result: { code: response[:avs_result] },
|
309
|
+
cvv_result: response[:cvv_result],
|
310
|
+
error_code: success ? nil : STANDARD_ERROR_CODE_MAPPING[response[:dsix_return_code]])
|
311
311
|
end
|
312
312
|
|
313
313
|
def message_from(response)
|
@@ -99,7 +99,7 @@ module ActiveMerchant #:nodoc:
|
|
99
99
|
# * <tt>money</tt> -- The amount to be captured as an Integer value in cents.
|
100
100
|
# * <tt>authorization</tt> -- The authorization returned from the previous authorize request.
|
101
101
|
def capture(money, authorization, options = {})
|
102
|
-
post = {:
|
102
|
+
post = {trans_id: authorization}
|
103
103
|
add_customer_data(post, options)
|
104
104
|
commit('PRIOR_AUTH_CAPTURE', money, post)
|
105
105
|
end
|
@@ -110,7 +110,7 @@ module ActiveMerchant #:nodoc:
|
|
110
110
|
#
|
111
111
|
# * <tt>authorization</tt> - The authorization returned from the previous authorize request.
|
112
112
|
def void(authorization, options = {})
|
113
|
-
post = {:
|
113
|
+
post = {trans_id: authorization}
|
114
114
|
add_duplicate_window(post)
|
115
115
|
commit('VOID', nil, post)
|
116
116
|
end
|
@@ -135,8 +135,8 @@ module ActiveMerchant #:nodoc:
|
|
135
135
|
def refund(money, identification, options = {})
|
136
136
|
requires!(options, :card_number)
|
137
137
|
|
138
|
-
post = { :
|
139
|
-
:
|
138
|
+
post = { trans_id: identification,
|
139
|
+
card_num: options[:card_number]}
|
140
140
|
|
141
141
|
post[:first_name] = options[:first_name] if options[:first_name]
|
142
142
|
post[:last_name] = options[:last_name] if options[:last_name]
|
@@ -176,11 +176,11 @@ module ActiveMerchant #:nodoc:
|
|
176
176
|
test_mode = test? || message =~ /TESTMODE/
|
177
177
|
|
178
178
|
Response.new(success?(response), message, response,
|
179
|
-
:
|
180
|
-
:
|
181
|
-
:
|
182
|
-
:
|
183
|
-
:
|
179
|
+
test: test_mode,
|
180
|
+
authorization: response[:transaction_id],
|
181
|
+
fraud_review: fraud_review?(response),
|
182
|
+
avs_result: { code: response[:avs_result_code] },
|
183
|
+
cvv_result: response[:card_code]
|
184
184
|
)
|
185
185
|
end
|
186
186
|
|
@@ -196,12 +196,12 @@ module ActiveMerchant #:nodoc:
|
|
196
196
|
fields = split(body)
|
197
197
|
|
198
198
|
results = {
|
199
|
-
:
|
200
|
-
:
|
201
|
-
:
|
202
|
-
:
|
203
|
-
:
|
204
|
-
:
|
199
|
+
response_code: fields[RESPONSE_CODE].to_i,
|
200
|
+
response_reason_code: fields[RESPONSE_REASON_CODE],
|
201
|
+
response_reason_text: fields[RESPONSE_REASON_TEXT],
|
202
|
+
avs_result_code: fields[AVS_RESULT_CODE],
|
203
|
+
transaction_id: fields[TRANSACTION_ID],
|
204
|
+
card_code: fields[CARD_CODE_RESPONSE_CODE]
|
205
205
|
}
|
206
206
|
results
|
207
207
|
end
|
@@ -79,7 +79,7 @@ module ActiveMerchant #:nodoc:
|
|
79
79
|
def capture(money, authorization, options = {})
|
80
80
|
requires!(@options, :advanced_login, :advanced_password)
|
81
81
|
|
82
|
-
post = options.merge(:
|
82
|
+
post = options.merge(TransNo: authorization)
|
83
83
|
|
84
84
|
add_amount(post, money, options)
|
85
85
|
add_advanced_user(post)
|
@@ -96,7 +96,7 @@ module ActiveMerchant #:nodoc:
|
|
96
96
|
def refund(money, authorization, options = {})
|
97
97
|
requires!(@options, :advanced_login, :advanced_password)
|
98
98
|
|
99
|
-
post = options.merge(:
|
99
|
+
post = options.merge(TransNo: authorization)
|
100
100
|
|
101
101
|
add_amount(post, money, options)
|
102
102
|
add_advanced_user(post)
|
@@ -109,7 +109,7 @@ module ActiveMerchant #:nodoc:
|
|
109
109
|
def void(authorization, options = {})
|
110
110
|
requires!(@options, :advanced_login, :advanced_password)
|
111
111
|
|
112
|
-
post = options.merge(:
|
112
|
+
post = options.merge(TransNo: authorization)
|
113
113
|
|
114
114
|
add_advanced_user(post)
|
115
115
|
add_standard_parameters('voidAuthorisation', post, options[:unique_id])
|
@@ -282,11 +282,11 @@ module ActiveMerchant #:nodoc:
|
|
282
282
|
cvv_result_code = 'P' if cvv_result_code == 'Unsupported'
|
283
283
|
|
284
284
|
Response.new(success?(response), response[:Message], response,
|
285
|
-
:
|
286
|
-
:
|
287
|
-
:
|
288
|
-
:
|
289
|
-
:
|
285
|
+
test: test?,
|
286
|
+
authorization: response[:TransactionNo],
|
287
|
+
fraud_review: fraud_review?(response),
|
288
|
+
avs_result: { code: avs_response_code },
|
289
|
+
cvv_result: cvv_result_code
|
290
290
|
)
|
291
291
|
end
|
292
292
|
|
@@ -300,11 +300,11 @@ module ActiveMerchant #:nodoc:
|
|
300
300
|
|
301
301
|
def add_standard_parameters(action, post, unique_id = nil)
|
302
302
|
post.merge!(
|
303
|
-
:
|
304
|
-
:
|
305
|
-
:
|
306
|
-
:
|
307
|
-
:
|
303
|
+
Version: API_VERSION,
|
304
|
+
Merchant: @options[:login],
|
305
|
+
AccessCode: @options[:password],
|
306
|
+
Command: action,
|
307
|
+
MerchTxnRef: unique_id || generate_unique_id.slice(0, 40)
|
308
308
|
)
|
309
309
|
end
|
310
310
|
|
@@ -17,8 +17,8 @@ module ActiveMerchant #:nodoc:
|
|
17
17
|
ERROR_MESSAGE = 'Transaction error'
|
18
18
|
|
19
19
|
PAYMENT_METHOD = {
|
20
|
-
:
|
21
|
-
:
|
20
|
+
check: 1,
|
21
|
+
credit_card: 2
|
22
22
|
}
|
23
23
|
|
24
24
|
def initialize(options = {})
|
@@ -111,7 +111,7 @@ module ActiveMerchant #:nodoc:
|
|
111
111
|
end
|
112
112
|
|
113
113
|
def build_request(action, params)
|
114
|
-
xml = Builder::XmlMarkup.new :
|
114
|
+
xml = Builder::XmlMarkup.new indent: 2
|
115
115
|
xml.instruct!
|
116
116
|
xml.tag! 'env:Envelope',
|
117
117
|
{ 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
|
@@ -147,15 +147,15 @@ module ActiveMerchant #:nodoc:
|
|
147
147
|
|
148
148
|
def commit(action, params)
|
149
149
|
data = ssl_post(url(action), build_request(action, params),
|
150
|
-
{ 'Content-Type' =>'text/xml; charset=utf-8',
|
150
|
+
{ 'Content-Type' => 'text/xml; charset=utf-8',
|
151
151
|
'SOAPAction' => "#{xmlns(action)}#{action}" }
|
152
152
|
)
|
153
153
|
|
154
154
|
response = parse(action, data)
|
155
155
|
Response.new(successful?(action, response), message_from(action, response), response,
|
156
|
-
:
|
157
|
-
:
|
158
|
-
:
|
156
|
+
test: test?,
|
157
|
+
authorization: authorization_from(action, response),
|
158
|
+
avs_result: { code: response[:avs_code] }
|
159
159
|
)
|
160
160
|
end
|
161
161
|
|
@@ -151,11 +151,11 @@ module ActiveMerchant #:nodoc:
|
|
151
151
|
|
152
152
|
# Private: Build XML wrapping code yielding to code to fill the transaction information
|
153
153
|
def build_request
|
154
|
-
builder = Nokogiri::XML::Builder.new(:
|
155
|
-
xml.Request(:
|
156
|
-
xml.Header { xml.Security(:
|
157
|
-
xml.Transaction(:
|
158
|
-
xml.User(:
|
154
|
+
builder = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
|
155
|
+
xml.Request(version: '1.0') do
|
156
|
+
xml.Header { xml.Security(sender: @options[:sender_id]) }
|
157
|
+
xml.Transaction(mode: test? ? 'CONNECTOR_TEST' : 'LIVE', response: 'SYNC', channel: @options[:channel_id]) do
|
158
|
+
xml.User(login: @options[:login], pwd: @options[:pwd])
|
159
159
|
yield xml
|
160
160
|
end
|
161
161
|
end
|
@@ -183,7 +183,7 @@ module ActiveMerchant #:nodoc:
|
|
183
183
|
def add_payment(xml, action, money, options)
|
184
184
|
code = tanslate_payment_code(action)
|
185
185
|
|
186
|
-
xml.Payment(:
|
186
|
+
xml.Payment(code: code) do
|
187
187
|
xml.Presentation do
|
188
188
|
xml.Amount amount(money)
|
189
189
|
xml.Currency options[:currency] || currency(money)
|
@@ -198,7 +198,7 @@ module ActiveMerchant #:nodoc:
|
|
198
198
|
xml.Holder credit_card.name
|
199
199
|
xml.Number credit_card.number
|
200
200
|
xml.Brand credit_card.brand.upcase
|
201
|
-
xml.Expiry(:
|
201
|
+
xml.Expiry(month: credit_card.month, year: credit_card.year)
|
202
202
|
xml.Verification credit_card.verification_value
|
203
203
|
end
|
204
204
|
end
|
@@ -248,10 +248,10 @@ module ActiveMerchant #:nodoc:
|
|
248
248
|
# Private : Add the 3DSecure infos to XML
|
249
249
|
def add_three_d_secure(xml, options)
|
250
250
|
if options[:three_d_secure]
|
251
|
-
xml.Authentication(:
|
251
|
+
xml.Authentication(type: '3DSecure') do
|
252
252
|
xml.ResultIndicator eci_to_result_indicator options[:three_d_secure][:eci]
|
253
|
-
xml.Parameter(:
|
254
|
-
xml.Parameter(:
|
253
|
+
xml.Parameter(name: 'VERIFICATION_ID') { xml.text options[:three_d_secure][:cavv] }
|
254
|
+
xml.Parameter(name: 'XID') { xml.text options[:three_d_secure][:xid] }
|
255
255
|
end
|
256
256
|
end
|
257
257
|
end
|
@@ -260,10 +260,10 @@ module ActiveMerchant #:nodoc:
|
|
260
260
|
def parse(body)
|
261
261
|
xml = Nokogiri::XML(body)
|
262
262
|
{
|
263
|
-
:
|
264
|
-
:
|
265
|
-
:
|
266
|
-
:
|
263
|
+
unique_id: xml.xpath('//Response/Transaction/Identification/UniqueID').text,
|
264
|
+
status: translate_status_code(xml.xpath('//Response/Transaction/Processing/Status/@code').text),
|
265
|
+
reason: translate_status_code(xml.xpath('//Response/Transaction/Processing/Reason/@code').text),
|
266
|
+
message: xml.xpath('//Response/Transaction/Processing/Return').text
|
267
267
|
}
|
268
268
|
end
|
269
269
|
|
@@ -326,11 +326,11 @@ module ActiveMerchant #:nodoc:
|
|
326
326
|
# Private: Translate AM operations to Monei operations codes
|
327
327
|
def tanslate_payment_code(action)
|
328
328
|
{
|
329
|
-
:
|
330
|
-
:
|
331
|
-
:
|
332
|
-
:
|
333
|
-
:
|
329
|
+
purchase: 'CC.DB',
|
330
|
+
authorize: 'CC.PA',
|
331
|
+
capture: 'CC.CP',
|
332
|
+
refund: 'CC.RF',
|
333
|
+
void: 'CC.RV'
|
334
334
|
}[action]
|
335
335
|
end
|
336
336
|
end
|