activemerchant 1.94.0 → 1.99.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +120 -1
- data/README.md +3 -0
- data/lib/active_merchant/billing/avs_result.rb +4 -5
- data/lib/active_merchant/billing/credit_card.rb +6 -0
- data/lib/active_merchant/billing/credit_card_methods.rb +65 -2
- data/lib/active_merchant/billing/gateway.rb +10 -0
- data/lib/active_merchant/billing/gateways/adyen.rb +119 -34
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +43 -10
- data/lib/active_merchant/billing/gateways/beanstream.rb +11 -6
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +3 -0
- data/lib/active_merchant/billing/gateways/blue_snap.rb +22 -2
- data/lib/active_merchant/billing/gateways/bpoint.rb +4 -4
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +56 -9
- data/lib/active_merchant/billing/gateways/card_connect.rb +2 -1
- data/lib/active_merchant/billing/gateways/cecabank.rb +7 -7
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +37 -27
- data/lib/active_merchant/billing/gateways/credorax.rb +69 -4
- data/lib/active_merchant/billing/gateways/cyber_source.rb +51 -11
- data/lib/active_merchant/billing/gateways/d_local.rb +1 -1
- data/lib/active_merchant/billing/gateways/decidir.rb +245 -0
- data/lib/active_merchant/billing/gateways/epay.rb +13 -2
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +42 -12
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +6 -0
- data/lib/active_merchant/billing/gateways/global_collect.rb +3 -7
- data/lib/active_merchant/billing/gateways/hps.rb +46 -1
- data/lib/active_merchant/billing/gateways/kushki.rb +1 -1
- data/lib/active_merchant/billing/gateways/mastercard.rb +30 -5
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +1 -1
- data/lib/active_merchant/billing/gateways/migs.rb +8 -0
- data/lib/active_merchant/billing/gateways/monei.rb +31 -0
- data/lib/active_merchant/billing/gateways/mundipagg.rb +33 -6
- data/lib/active_merchant/billing/gateways/nab_transact.rb +1 -1
- data/lib/active_merchant/billing/gateways/nmi.rb +39 -1
- data/lib/active_merchant/billing/gateways/opp.rb +20 -1
- data/lib/active_merchant/billing/gateways/orbital.rb +60 -10
- data/lib/active_merchant/billing/gateways/payflow.rb +64 -14
- data/lib/active_merchant/billing/gateways/paymill.rb +5 -0
- data/lib/active_merchant/billing/gateways/paypal.rb +14 -1
- data/lib/active_merchant/billing/gateways/payu_latam.rb +6 -2
- data/lib/active_merchant/billing/gateways/qvalent.rb +43 -1
- data/lib/active_merchant/billing/gateways/realex.rb +32 -9
- data/lib/active_merchant/billing/gateways/redsys.rb +113 -30
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +43 -29
- data/lib/active_merchant/billing/gateways/stripe.rb +38 -9
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +271 -0
- data/lib/active_merchant/billing/gateways/tns.rb +10 -5
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +2 -2
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +45 -6
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +8 -5
- data/lib/active_merchant/billing/gateways/worldpay.rb +177 -39
- data/lib/active_merchant/country.rb +1 -0
- data/lib/active_merchant/version.rb +1 -1
- metadata +19 -4
@@ -33,9 +33,9 @@ module ActiveMerchant #:nodoc:
|
|
33
33
|
'10110' => STANDARD_ERROR_CODE[:incorrect_address],
|
34
34
|
'10111' => STANDARD_ERROR_CODE[:incorrect_address],
|
35
35
|
'10127' => STANDARD_ERROR_CODE[:card_declined],
|
36
|
-
'
|
37
|
-
'
|
38
|
-
'
|
36
|
+
'00043' => STANDARD_ERROR_CODE[:call_issuer],
|
37
|
+
'10205' => STANDARD_ERROR_CODE[:card_declined],
|
38
|
+
'10204' => STANDARD_ERROR_CODE[:pickup_card]
|
39
39
|
}
|
40
40
|
|
41
41
|
def initialize(options = {})
|
@@ -318,12 +318,15 @@ module ActiveMerchant #:nodoc:
|
|
318
318
|
def commit(action, parameters)
|
319
319
|
url = (test? ? self.test_url : self.live_url)
|
320
320
|
response = parse(ssl_post(url, post_data(action, parameters)))
|
321
|
-
|
321
|
+
approved = response[:status] == 'Approved'
|
322
|
+
error_code = nil
|
323
|
+
error_code = (STANDARD_ERROR_CODE_MAPPING[response[:error_code]] || STANDARD_ERROR_CODE[:processing_error]) unless approved
|
324
|
+
Response.new(approved, message_from(response), response,
|
322
325
|
:test => test?,
|
323
326
|
:authorization => response[:ref_num],
|
324
327
|
:cvv_result => response[:cvv2_result_code],
|
325
328
|
:avs_result => { :code => response[:avs_result_code] },
|
326
|
-
:error_code =>
|
329
|
+
:error_code => error_code
|
327
330
|
)
|
328
331
|
end
|
329
332
|
|
@@ -7,7 +7,7 @@ module ActiveMerchant #:nodoc:
|
|
7
7
|
self.default_currency = 'GBP'
|
8
8
|
self.money_format = :cents
|
9
9
|
self.supported_countries = %w(HK GB AU AD AR BE BR CA CH CN CO CR CY CZ DE DK ES FI FR GI GR HU IE IN IT JP LI LU MC MT MY MX NL NO NZ PA PE PL PT SE SG SI SM TR UM VA)
|
10
|
-
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :maestro, :elo]
|
10
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :maestro, :elo, :naranja, :cabal]
|
11
11
|
self.currencies_without_fractions = %w(HUF IDR ISK JPY KRW)
|
12
12
|
self.currencies_with_three_decimal_places = %w(BHD KWD OMR RSD TND)
|
13
13
|
self.homepage_url = 'http://www.worldpay.com/'
|
@@ -22,6 +22,8 @@ module ActiveMerchant #:nodoc:
|
|
22
22
|
'maestro' => 'MAESTRO-SSL',
|
23
23
|
'diners_club' => 'DINERS-SSL',
|
24
24
|
'elo' => 'ELO-SSL',
|
25
|
+
'naranja' => 'NARANJA-SSL',
|
26
|
+
'cabal' => 'CABAL-SSL',
|
25
27
|
'unknown' => 'CARD-SSL'
|
26
28
|
}
|
27
29
|
|
@@ -59,10 +61,12 @@ module ActiveMerchant #:nodoc:
|
|
59
61
|
|
60
62
|
def authorize(money, payment_method, options = {})
|
61
63
|
requires!(options, :order_id)
|
62
|
-
|
64
|
+
payment_details = payment_details_from(payment_method)
|
65
|
+
authorize_request(money, payment_method, payment_details.merge(options))
|
63
66
|
end
|
64
67
|
|
65
68
|
def capture(money, authorization, options = {})
|
69
|
+
authorization = order_id_from_authorization(authorization.to_s)
|
66
70
|
MultiResponse.run do |r|
|
67
71
|
r.process { inquire_request(authorization, options, 'AUTHORISED') } unless options[:authorization_validated]
|
68
72
|
if r.params
|
@@ -74,6 +78,7 @@ module ActiveMerchant #:nodoc:
|
|
74
78
|
end
|
75
79
|
|
76
80
|
def void(authorization, options = {})
|
81
|
+
authorization = order_id_from_authorization(authorization.to_s)
|
77
82
|
MultiResponse.run do |r|
|
78
83
|
r.process { inquire_request(authorization, options, 'AUTHORISED') } unless options[:authorization_validated]
|
79
84
|
r.process { cancel_request(authorization, options) }
|
@@ -81,8 +86,9 @@ module ActiveMerchant #:nodoc:
|
|
81
86
|
end
|
82
87
|
|
83
88
|
def refund(money, authorization, options = {})
|
89
|
+
authorization = order_id_from_authorization(authorization.to_s)
|
84
90
|
response = MultiResponse.run do |r|
|
85
|
-
r.process { inquire_request(authorization, options, 'CAPTURED', 'SETTLED', 'SETTLED_BY_MERCHANT') }
|
91
|
+
r.process { inquire_request(authorization, options, 'CAPTURED', 'SETTLED', 'SETTLED_BY_MERCHANT') } unless options[:authorization_validated]
|
86
92
|
r.process { refund_request(money, authorization, options) }
|
87
93
|
end
|
88
94
|
|
@@ -97,16 +103,22 @@ module ActiveMerchant #:nodoc:
|
|
97
103
|
# and other transactions should be performed on a normal eCom-flagged
|
98
104
|
# merchant ID.
|
99
105
|
def credit(money, payment_method, options = {})
|
100
|
-
|
106
|
+
payment_details = payment_details_from(payment_method)
|
107
|
+
credit_request(money, payment_method, payment_details.merge(:credit => true, **options))
|
101
108
|
end
|
102
109
|
|
103
|
-
def verify(
|
110
|
+
def verify(payment_method, options={})
|
104
111
|
MultiResponse.run(:use_first_response) do |r|
|
105
|
-
r.process { authorize(100,
|
112
|
+
r.process { authorize(100, payment_method, options) }
|
106
113
|
r.process(:ignore_result) { void(r.authorization, options.merge(:authorization_validated => true)) }
|
107
114
|
end
|
108
115
|
end
|
109
116
|
|
117
|
+
def store(credit_card, options={})
|
118
|
+
requires!(options, :customer)
|
119
|
+
store_request(credit_card, options)
|
120
|
+
end
|
121
|
+
|
110
122
|
def supports_scrubbing
|
111
123
|
true
|
112
124
|
end
|
@@ -144,6 +156,10 @@ module ActiveMerchant #:nodoc:
|
|
144
156
|
commit('credit', build_authorization_request(money, payment_method, options), :ok, 'SENT_FOR_REFUND', options)
|
145
157
|
end
|
146
158
|
|
159
|
+
def store_request(credit_card, options)
|
160
|
+
commit('store', build_store_request(credit_card, options), options)
|
161
|
+
end
|
162
|
+
|
147
163
|
def build_request
|
148
164
|
xml = Builder::XmlMarkup.new :indent => 2
|
149
165
|
xml.instruct! :xml, :encoding => 'UTF-8'
|
@@ -184,13 +200,16 @@ module ActiveMerchant #:nodoc:
|
|
184
200
|
end
|
185
201
|
end
|
186
202
|
add_payment_method(xml, money, payment_method, options)
|
187
|
-
|
203
|
+
add_shopper(xml, options)
|
188
204
|
if options[:hcg_additional_data]
|
189
205
|
add_hcg_additional_data(xml, options)
|
190
206
|
end
|
191
207
|
if options[:instalments]
|
192
208
|
add_instalments_data(xml, options)
|
193
209
|
end
|
210
|
+
add_moto_flag(xml, options) if options.dig(:metadata, :manual_entry)
|
211
|
+
add_additional_3ds_data(xml, options) if options[:execute_threed] && options[:three_ds_version] && options[:three_ds_version] =~ /^2/
|
212
|
+
add_3ds_exemption(xml, options) if options[:exemption_type]
|
194
213
|
end
|
195
214
|
end
|
196
215
|
end
|
@@ -224,6 +243,30 @@ module ActiveMerchant #:nodoc:
|
|
224
243
|
end
|
225
244
|
end
|
226
245
|
|
246
|
+
def build_store_request(credit_card, options)
|
247
|
+
build_request do |xml|
|
248
|
+
xml.tag! 'submit' do
|
249
|
+
xml.tag! 'paymentTokenCreate' do
|
250
|
+
add_authenticated_shopper_id(xml, options)
|
251
|
+
xml.tag! 'createToken'
|
252
|
+
xml.tag! 'paymentInstrument' do
|
253
|
+
xml.tag! 'cardDetails' do
|
254
|
+
add_card(xml, credit_card, options)
|
255
|
+
end
|
256
|
+
end
|
257
|
+
end
|
258
|
+
end
|
259
|
+
end
|
260
|
+
end
|
261
|
+
|
262
|
+
def add_additional_3ds_data(xml, options)
|
263
|
+
xml.tag! 'additional3DSData', 'dfReferenceId' => options[:session_id]
|
264
|
+
end
|
265
|
+
|
266
|
+
def add_3ds_exemption(xml, options)
|
267
|
+
xml.tag! 'exemption', 'type' => options[:exemption_type], 'placement' => options[:exemption_placement] || 'AUTHORISATION'
|
268
|
+
end
|
269
|
+
|
227
270
|
def add_amount(xml, money, options)
|
228
271
|
currency = options[:currency] || currency(money)
|
229
272
|
|
@@ -241,7 +284,7 @@ module ActiveMerchant #:nodoc:
|
|
241
284
|
end
|
242
285
|
|
243
286
|
def add_payment_method(xml, amount, payment_method, options)
|
244
|
-
if
|
287
|
+
if options[:payment_type] == :pay_as_order
|
245
288
|
if options[:merchant_code]
|
246
289
|
xml.tag! 'payAsOrder', 'orderCode' => payment_method, 'merchantCode' => options[:merchant_code] do
|
247
290
|
add_amount(xml, amount, options)
|
@@ -253,16 +296,14 @@ module ActiveMerchant #:nodoc:
|
|
253
296
|
end
|
254
297
|
else
|
255
298
|
xml.tag! 'paymentDetails', credit_fund_transfer_attribute(options) do
|
256
|
-
|
257
|
-
xml.tag! '
|
258
|
-
|
259
|
-
|
299
|
+
if options[:payment_type] == :token
|
300
|
+
xml.tag! 'TOKEN-SSL', 'tokenScope' => options[:token_scope] do
|
301
|
+
xml.tag! 'paymentTokenID', options[:token_id]
|
302
|
+
end
|
303
|
+
else
|
304
|
+
xml.tag! card_code_for(payment_method) do
|
305
|
+
add_card(xml, payment_method, options)
|
260
306
|
end
|
261
|
-
|
262
|
-
xml.tag! 'cardHolderName', options[:execute_threed] ? '3D' : payment_method.name
|
263
|
-
xml.tag! 'cvc', payment_method.verification_value
|
264
|
-
|
265
|
-
add_address(xml, (options[:billing_address] || options[:address]))
|
266
307
|
end
|
267
308
|
add_stored_credential_options(xml, options)
|
268
309
|
if options[:ip] && options[:session_id]
|
@@ -273,18 +314,37 @@ module ActiveMerchant #:nodoc:
|
|
273
314
|
end
|
274
315
|
|
275
316
|
if three_d_secure = options[:three_d_secure]
|
276
|
-
xml
|
277
|
-
xml.tag! 'threeDSVersion', three_d_secure[:version]
|
278
|
-
xid_tag = three_d_secure[:version] =~ /^2/ ? 'dsTransactionId' : 'xid'
|
279
|
-
xml.tag! xid_tag, three_d_secure[:xid]
|
280
|
-
xml.tag! 'cavv', three_d_secure[:cavv]
|
281
|
-
xml.tag! 'eci', three_d_secure[:eci]
|
282
|
-
end
|
317
|
+
add_three_d_secure(three_d_secure, xml)
|
283
318
|
end
|
284
319
|
end
|
285
320
|
end
|
286
321
|
end
|
287
322
|
|
323
|
+
def add_three_d_secure(three_d_secure, xml)
|
324
|
+
xml.tag! 'info3DSecure' do
|
325
|
+
xml.tag! 'threeDSVersion', three_d_secure[:version]
|
326
|
+
if three_d_secure[:version] =~ /^2/
|
327
|
+
xml.tag! 'dsTransactionId', three_d_secure[:ds_transaction_id]
|
328
|
+
else
|
329
|
+
xml.tag! 'xid', three_d_secure[:xid]
|
330
|
+
end
|
331
|
+
xml.tag! 'cavv', three_d_secure[:cavv]
|
332
|
+
xml.tag! 'eci', three_d_secure[:eci]
|
333
|
+
end
|
334
|
+
end
|
335
|
+
|
336
|
+
def add_card(xml, payment_method, options)
|
337
|
+
xml.tag! 'cardNumber', payment_method.number
|
338
|
+
xml.tag! 'expiryDate' do
|
339
|
+
xml.tag! 'date', 'month' => format(payment_method.month, :two_digits), 'year' => format(payment_method.year, :four_digits)
|
340
|
+
end
|
341
|
+
|
342
|
+
xml.tag! 'cardHolderName', options[:execute_threed] && (options[:three_ds_version] =~ /[^2]/).nil? ? '3D' : payment_method.name
|
343
|
+
xml.tag! 'cvc', payment_method.verification_value
|
344
|
+
|
345
|
+
add_address(xml, (options[:billing_address] || options[:address]))
|
346
|
+
end
|
347
|
+
|
288
348
|
def add_stored_credential_options(xml, options={})
|
289
349
|
if options[:stored_credential]
|
290
350
|
add_stored_credential_using_normalized_fields(xml, options)
|
@@ -321,10 +381,11 @@ module ActiveMerchant #:nodoc:
|
|
321
381
|
end
|
322
382
|
end
|
323
383
|
|
324
|
-
def
|
325
|
-
return unless options[:execute_threed] || options[:email]
|
384
|
+
def add_shopper(xml, options)
|
385
|
+
return unless options[:execute_threed] || options[:email] || options[:customer]
|
326
386
|
xml.tag! 'shopper' do
|
327
387
|
xml.tag! 'shopperEmailAddress', options[:email] if options[:email]
|
388
|
+
add_authenticated_shopper_id(xml, options)
|
328
389
|
xml.tag! 'browser' do
|
329
390
|
xml.tag! 'acceptHeader', options[:accept_header]
|
330
391
|
xml.tag! 'userAgentHeader', options[:user_agent]
|
@@ -332,6 +393,10 @@ module ActiveMerchant #:nodoc:
|
|
332
393
|
end
|
333
394
|
end
|
334
395
|
|
396
|
+
def add_authenticated_shopper_id(xml, options)
|
397
|
+
xml.tag!('authenticatedShopperID', options[:customer]) if options[:customer]
|
398
|
+
end
|
399
|
+
|
335
400
|
def add_address(xml, address)
|
336
401
|
return unless address
|
337
402
|
|
@@ -369,6 +434,10 @@ module ActiveMerchant #:nodoc:
|
|
369
434
|
end
|
370
435
|
end
|
371
436
|
|
437
|
+
def add_moto_flag(xml, options)
|
438
|
+
xml.tag! 'dynamicInteractionType', 'type' => 'MOTO'
|
439
|
+
end
|
440
|
+
|
372
441
|
def address_with_defaults(address)
|
373
442
|
address ||= {}
|
374
443
|
address.delete_if { |_, v| v.blank? }
|
@@ -390,14 +459,17 @@ module ActiveMerchant #:nodoc:
|
|
390
459
|
end
|
391
460
|
|
392
461
|
def parse_element(raw, node)
|
462
|
+
node_name = node.name.underscore
|
393
463
|
node.attributes.each do |k, v|
|
394
|
-
raw["#{
|
464
|
+
raw["#{node_name}_#{k.underscore}".to_sym] = v
|
395
465
|
end
|
396
466
|
if node.has_elements?
|
397
|
-
raw[
|
467
|
+
raw[node_name.to_sym] = true unless node.name.blank?
|
398
468
|
node.elements.each { |e| parse_element(raw, e) }
|
469
|
+
elsif node.children.count > 1
|
470
|
+
raw[node_name.to_sym] = node.children.join(' ').strip
|
399
471
|
else
|
400
|
-
raw[
|
472
|
+
raw[node_name.to_sym] = node.text unless node.text.nil?
|
401
473
|
end
|
402
474
|
raw
|
403
475
|
end
|
@@ -419,14 +491,16 @@ module ActiveMerchant #:nodoc:
|
|
419
491
|
if options[:execute_threed]
|
420
492
|
raw[:cookie] = @cookie
|
421
493
|
raw[:session_id] = options[:session_id]
|
494
|
+
raw[:is3DSOrder] = true
|
422
495
|
end
|
423
|
-
success
|
496
|
+
success = success_from(action, raw, success_criteria)
|
497
|
+
message = message_from(success, raw, success_criteria)
|
424
498
|
|
425
499
|
Response.new(
|
426
500
|
success,
|
427
501
|
message,
|
428
502
|
raw,
|
429
|
-
:authorization => authorization_from(raw),
|
503
|
+
:authorization => authorization_from(action, raw, options),
|
430
504
|
:error_code => error_code_from(success, raw),
|
431
505
|
:test => test?,
|
432
506
|
:avs_result => AVSResult.new(code: AVS_CODE_MAP[raw[:avs_result_code_description]]),
|
@@ -456,19 +530,30 @@ module ActiveMerchant #:nodoc:
|
|
456
530
|
end
|
457
531
|
end
|
458
532
|
|
533
|
+
def success_from(action, raw, success_criteria)
|
534
|
+
success_criteria_success?(raw, success_criteria) || action_success?(action, raw)
|
535
|
+
end
|
536
|
+
|
537
|
+
def message_from(success, raw, success_criteria)
|
538
|
+
return 'SUCCESS' if success
|
539
|
+
raw[:iso8583_return_code_description] || raw[:error] || required_status_message(raw, success_criteria)
|
540
|
+
end
|
541
|
+
|
459
542
|
# success_criteria can be:
|
460
543
|
# - a string or an array of strings (if one of many responses)
|
461
544
|
# - An array of strings if one of many responses could be considered a
|
462
545
|
# success.
|
463
|
-
def
|
464
|
-
|
465
|
-
|
466
|
-
|
546
|
+
def success_criteria_success?(raw, success_criteria)
|
547
|
+
success_criteria.include?(raw[:last_event]) || raw[:ok].present?
|
548
|
+
end
|
549
|
+
|
550
|
+
def action_success?(action, raw)
|
551
|
+
case action
|
552
|
+
when 'store'
|
553
|
+
raw[:token].present?
|
467
554
|
else
|
468
|
-
|
555
|
+
false
|
469
556
|
end
|
470
|
-
|
471
|
-
[ success, message ]
|
472
557
|
end
|
473
558
|
|
474
559
|
def error_code_from(success, raw)
|
@@ -483,11 +568,64 @@ module ActiveMerchant #:nodoc:
|
|
483
568
|
end
|
484
569
|
end
|
485
570
|
|
486
|
-
def authorization_from(raw)
|
571
|
+
def authorization_from(action, raw, options)
|
572
|
+
order_id = order_id_from(raw)
|
573
|
+
|
574
|
+
case action
|
575
|
+
when 'store'
|
576
|
+
authorization_from_token_details(
|
577
|
+
order_id: order_id,
|
578
|
+
token_id: raw[:payment_token_id],
|
579
|
+
token_scope: 'shopper',
|
580
|
+
customer: options[:customer]
|
581
|
+
)
|
582
|
+
else
|
583
|
+
order_id
|
584
|
+
end
|
585
|
+
end
|
586
|
+
|
587
|
+
def order_id_from(raw)
|
487
588
|
pair = raw.detect { |k, v| k.to_s =~ /_order_code$/ }
|
488
589
|
(pair ? pair.last : nil)
|
489
590
|
end
|
490
591
|
|
592
|
+
def authorization_from_token_details(options={})
|
593
|
+
[options[:order_id], options[:token_id], options[:token_scope], options[:customer]].join('|')
|
594
|
+
end
|
595
|
+
|
596
|
+
def order_id_from_authorization(authorization)
|
597
|
+
token_details_from_authorization(authorization)[:order_id]
|
598
|
+
end
|
599
|
+
|
600
|
+
def token_details_from_authorization(authorization)
|
601
|
+
order_id, token_id, token_scope, customer = authorization.split('|')
|
602
|
+
|
603
|
+
token_details = {}
|
604
|
+
token_details[:order_id] = order_id if order_id.present?
|
605
|
+
token_details[:token_id] = token_id if token_id.present?
|
606
|
+
token_details[:token_scope] = token_scope if token_scope.present?
|
607
|
+
token_details[:customer] = customer if customer.present?
|
608
|
+
|
609
|
+
token_details
|
610
|
+
end
|
611
|
+
|
612
|
+
def payment_details_from(payment_method)
|
613
|
+
payment_details = {}
|
614
|
+
if payment_method.respond_to?(:number)
|
615
|
+
payment_details[:payment_type] = :credit
|
616
|
+
else
|
617
|
+
token_details = token_details_from_authorization(payment_method)
|
618
|
+
payment_details.merge!(token_details)
|
619
|
+
if token_details.has_key?(:token_id)
|
620
|
+
payment_details[:payment_type] = :token
|
621
|
+
else
|
622
|
+
payment_details[:payment_type] = :pay_as_order
|
623
|
+
end
|
624
|
+
end
|
625
|
+
|
626
|
+
payment_details
|
627
|
+
end
|
628
|
+
|
491
629
|
def credit_fund_transfer_attribute(options)
|
492
630
|
return unless options[:credit]
|
493
631
|
{'action' => 'REFUND'}
|
@@ -183,6 +183,7 @@ module ActiveMerchant #:nodoc:
|
|
183
183
|
{ alpha2: 'KI', name: 'Kiribati', alpha3: 'KIR', numeric: '296' },
|
184
184
|
{ alpha2: 'KP', name: 'Korea, Democratic People\'s Republic of', alpha3: 'PRK', numeric: '408' },
|
185
185
|
{ alpha2: 'KR', name: 'Korea, Republic of', alpha3: 'KOR', numeric: '410' },
|
186
|
+
{ alpha2: 'XK', name: 'Kosovo', alpha3: 'XKX', numeric: '900' },
|
186
187
|
{ alpha2: 'KW', name: 'Kuwait', alpha3: 'KWT', numeric: '414' },
|
187
188
|
{ alpha2: 'KG', name: 'Kyrgyzstan', alpha3: 'KGZ', numeric: '417' },
|
188
189
|
{ alpha2: 'LA', name: 'Lao People\'s Democratic Republic', alpha3: 'LAO', numeric: '418' },
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activemerchant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.99.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Luetke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -128,6 +128,20 @@ dependencies:
|
|
128
128
|
- - ">="
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: pry
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - ">="
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
138
|
+
type: :development
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
131
145
|
description: Active Merchant is a simple payment abstraction library used in and sponsored
|
132
146
|
by Shopify. It is written by Tobias Luetke, Cody Fauser, and contributors. The aim
|
133
147
|
of the project is to feel natural to Ruby users and to abstract as many parts as
|
@@ -204,6 +218,7 @@ files:
|
|
204
218
|
- lib/active_merchant/billing/gateways/cyber_source.rb
|
205
219
|
- lib/active_merchant/billing/gateways/d_local.rb
|
206
220
|
- lib/active_merchant/billing/gateways/data_cash.rb
|
221
|
+
- lib/active_merchant/billing/gateways/decidir.rb
|
207
222
|
- lib/active_merchant/billing/gateways/dibs.rb
|
208
223
|
- lib/active_merchant/billing/gateways/digitzs.rb
|
209
224
|
- lib/active_merchant/billing/gateways/ebanx.rb
|
@@ -349,6 +364,7 @@ files:
|
|
349
364
|
- lib/active_merchant/billing/gateways/so_easy_pay.rb
|
350
365
|
- lib/active_merchant/billing/gateways/spreedly_core.rb
|
351
366
|
- lib/active_merchant/billing/gateways/stripe.rb
|
367
|
+
- lib/active_merchant/billing/gateways/stripe_payment_intents.rb
|
352
368
|
- lib/active_merchant/billing/gateways/swipe_checkout.rb
|
353
369
|
- lib/active_merchant/billing/gateways/telr.rb
|
354
370
|
- lib/active_merchant/billing/gateways/tns.rb
|
@@ -412,8 +428,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
412
428
|
- !ruby/object:Gem::Version
|
413
429
|
version: '0'
|
414
430
|
requirements: []
|
415
|
-
|
416
|
-
rubygems_version: 2.7.6
|
431
|
+
rubygems_version: 3.0.3
|
417
432
|
signing_key:
|
418
433
|
specification_version: 4
|
419
434
|
summary: Framework and tools for dealing with credit card transactions.
|