activemerchant 1.51.0 → 1.52.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 +20 -0
- data/README.md +1 -0
- data/lib/active_merchant/billing/gateway.rb +2 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +24 -2
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +1 -1
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +2 -1
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +19 -1
- data/lib/active_merchant/billing/gateways/mercury.rb +2 -2
- data/lib/active_merchant/billing/gateways/moneris.rb +17 -4
- data/lib/active_merchant/billing/gateways/ogone.rb +1 -0
- data/lib/active_merchant/billing/gateways/paypal.rb +6 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +2 -2
- data/lib/active_merchant/billing/gateways/payu_in.rb +1 -1
- data/lib/active_merchant/billing/gateways/s5.rb +24 -7
- data/lib/active_merchant/billing/gateways/sage_pay.rb +1 -0
- data/lib/active_merchant/billing/gateways/stripe.rb +32 -11
- data/lib/active_merchant/billing/gateways/vanco.rb +1 -1
- data/lib/active_merchant/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b14d2c1c73ff33e03eda050a96c1de86f89619a
|
4
|
+
data.tar.gz: 89f173df6f5343c3da814920e5b4006ca928204d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9886654ba8fd2e3167ba753dc267fbe8ff585b8866b7201151b57e096a88cfb9e380a95f8ca95efa936b5d02a4965072318b3e29d60195c640a0f95ec17ca47d
|
7
|
+
data.tar.gz: 8b321b19d61ae62a920ebb55e3f70e267453bc8a73ee811f09ea162d16cea90124c384df699d1e43d6927096ddfc0777d982fd221a92f8b13a8901590ec1285e
|
data/CHANGELOG
CHANGED
@@ -1,5 +1,25 @@
|
|
1
1
|
= ActiveMerchant CHANGELOG
|
2
2
|
|
3
|
+
== Version 1.52.0 (July 20, 2015)
|
4
|
+
|
5
|
+
* Authorize.Net: Add device type to authorize.net retail requests [abecevello]
|
6
|
+
* Vanco: Change transaction type to WEB for echecks [duff]
|
7
|
+
* PayPal: Allow soft descriptor to be specified [davidsantoso]
|
8
|
+
* Authorize.net: Add disable_partial_auth field [anellis]
|
9
|
+
* SagePay: Add apply_avscv2 field [anellis]
|
10
|
+
* S5: Add Store [anellis]
|
11
|
+
* Merchant Ware v4: Add support for verify [davidsantoso]
|
12
|
+
* Mercury: No longer default to allow partial auth [duff]
|
13
|
+
* PayPal: Fix soft_descriptor and support soft_descriptor_city [duff]
|
14
|
+
* Merchant Ware: Add scrubbing [davidsantoso]
|
15
|
+
* Stripe: Make purchase via vaulted card consistent [duff]
|
16
|
+
* Moneris: Add network tokenization support [andrewpaliga]
|
17
|
+
* Ogone: Allow specifying a timeout value for requests [tomhipkin]
|
18
|
+
* PayU India: Increase allowed txnid to 30 characters [ntalbott]
|
19
|
+
* Authorize.Net: Allow passing device type through options, make wireless POS the default [abecevello]
|
20
|
+
* Authorize.Net: Update to new Akamai URL [taf2]
|
21
|
+
* Braintree: Add hold_in_escrow [anellis]
|
22
|
+
* Stripe: Allow purchases with tokens without customer specification [bizla]
|
3
23
|
|
4
24
|
== Version 1.51.0 (July 2, 2015)
|
5
25
|
|
data/README.md
CHANGED
@@ -146,6 +146,7 @@ The [ActiveMerchant Wiki](http://github.com/activemerchant/active_merchant/wikis
|
|
146
146
|
* [Metrics Global](http://www.metricsglobal.com) - US
|
147
147
|
* [MasterCard Internet Gateway Service (MiGS)](http://mastercard.com/mastercardsps) - AU, AE, BD, BN, EG, HK, ID, IN, JO, KW, LB, LK, MU, MV, MY, NZ, OM, PH, QA, SA, SG, TT, VN
|
148
148
|
* [Modern Payments](http://www.modpay.com) - US
|
149
|
+
* [MONEI](http://www.monei.net/) - ES
|
149
150
|
* [Moneris](http://www.moneris.com/) - CA
|
150
151
|
* [Moneris (US)](http://www.monerisusa.com/) - US
|
151
152
|
* [MoneyMovers](http://mmoa.us/) - US
|
@@ -72,6 +72,7 @@ module ActiveMerchant #:nodoc:
|
|
72
72
|
# :incorrect_cvc - Secerity code was not matched by the processor
|
73
73
|
# :incorrect_zip - Zip code is not in correct format
|
74
74
|
# :incorrect_address - Billing address info was not matched by the processor
|
75
|
+
# :incorrect_pin - Card PIN is incorrect
|
75
76
|
# :card_declined - Card number declined by processor
|
76
77
|
# :processing_error - Processor error
|
77
78
|
# :call_issuer - Transaction requires voice authentication, call issuer
|
@@ -86,6 +87,7 @@ module ActiveMerchant #:nodoc:
|
|
86
87
|
:incorrect_cvc => 'incorrect_cvc',
|
87
88
|
:incorrect_zip => 'incorrect_zip',
|
88
89
|
:incorrect_address => 'incorrect_address',
|
90
|
+
:incorrect_pin => 'incorrect_pin',
|
89
91
|
:card_declined => 'card_declined',
|
90
92
|
:processing_error => 'processing_error',
|
91
93
|
:call_issuer => 'call_issuer',
|
@@ -40,6 +40,19 @@ module ActiveMerchant #:nodoc:
|
|
40
40
|
:retail => '2'
|
41
41
|
}
|
42
42
|
|
43
|
+
DEVICE_TYPE = {
|
44
|
+
:unknown => '1',
|
45
|
+
:unattended_terminal => '2',
|
46
|
+
:self_service_terminal => '3',
|
47
|
+
:electronic_cash_register => '4',
|
48
|
+
:personal_computer_terminal => '5',
|
49
|
+
:airpay => '6',
|
50
|
+
:wireless_pos => '7',
|
51
|
+
:website => '8',
|
52
|
+
:dial_terminal => '9',
|
53
|
+
:virtual_terminal => '10'
|
54
|
+
}
|
55
|
+
|
43
56
|
class_attribute :duplicate_window
|
44
57
|
|
45
58
|
APPROVED, DECLINED, ERROR, FRAUD_REVIEW = 1, 2, 3, 4
|
@@ -204,7 +217,7 @@ module ActiveMerchant #:nodoc:
|
|
204
217
|
add_payment_source(xml, payment)
|
205
218
|
add_invoice(xml, options)
|
206
219
|
add_customer_data(xml, payment, options)
|
207
|
-
|
220
|
+
add_market_type_device_type(xml, payment, options)
|
208
221
|
add_settings(xml, payment, options)
|
209
222
|
add_user_fields(xml, amount, options)
|
210
223
|
end
|
@@ -327,6 +340,12 @@ module ActiveMerchant #:nodoc:
|
|
327
340
|
xml.settingValue("true")
|
328
341
|
end
|
329
342
|
end
|
343
|
+
if options[:disable_partial_auth]
|
344
|
+
xml.setting do
|
345
|
+
xml.settingName("allowPartialAuth")
|
346
|
+
xml.settingValue("false")
|
347
|
+
end
|
348
|
+
end
|
330
349
|
if options[:duplicate_window]
|
331
350
|
set_duplicate_window(xml, options[:duplicate_window])
|
332
351
|
elsif self.class.duplicate_window
|
@@ -407,11 +426,14 @@ module ActiveMerchant #:nodoc:
|
|
407
426
|
end
|
408
427
|
end
|
409
428
|
|
410
|
-
def
|
429
|
+
def add_market_type_device_type(xml, payment, options)
|
411
430
|
return if payment.is_a?(String) || card_brand(payment) == 'check' || card_brand(payment) == 'apple_pay'
|
412
431
|
if valid_track_data
|
413
432
|
xml.retail do
|
414
433
|
xml.marketType(MARKET_TYPE[:retail])
|
434
|
+
|
435
|
+
device_type = options[:device_type] || DEVICE_TYPE[:wireless_pos]
|
436
|
+
xml.deviceType(device_type)
|
415
437
|
end
|
416
438
|
elsif payment.manual_entry
|
417
439
|
xml.retail do
|
@@ -28,7 +28,7 @@ module ActiveMerchant #:nodoc:
|
|
28
28
|
# 5. Click Submit
|
29
29
|
class AuthorizeNetCimGateway < Gateway
|
30
30
|
self.test_url = 'https://apitest.authorize.net/xml/v1/request.api'
|
31
|
-
self.live_url = 'https://
|
31
|
+
self.live_url = 'https://api2.authorize.net/xml/v1/request.api'
|
32
32
|
|
33
33
|
AUTHORIZE_NET_CIM_NAMESPACE = 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'
|
34
34
|
|
@@ -517,7 +517,8 @@ module ActiveMerchant #:nodoc:
|
|
517
517
|
},
|
518
518
|
:options => {
|
519
519
|
:store_in_vault => options[:store] ? true : false,
|
520
|
-
:submit_for_settlement => options[:submit_for_settlement]
|
520
|
+
:submit_for_settlement => options[:submit_for_settlement],
|
521
|
+
:hold_in_escrow => options[:hold_in_escrow]
|
521
522
|
}
|
522
523
|
}
|
523
524
|
|
@@ -2,7 +2,7 @@ module ActiveMerchant #:nodoc:
|
|
2
2
|
module Billing #:nodoc:
|
3
3
|
class MerchantWareVersionFourGateway < Gateway
|
4
4
|
self.live_url = 'https://ps1.merchantware.net/Merchantware/ws/RetailTransaction/v4/Credit.asmx'
|
5
|
-
self.test_url = 'https://
|
5
|
+
self.test_url = 'https://ps1.merchantware.net/Merchantware/ws/RetailTransaction/v4/Credit.asmx'
|
6
6
|
|
7
7
|
self.supported_countries = ['US']
|
8
8
|
self.supported_cardtypes = [:visa, :master, :american_express, :discover]
|
@@ -108,6 +108,24 @@ module ActiveMerchant #:nodoc:
|
|
108
108
|
commit(:refund, request)
|
109
109
|
end
|
110
110
|
|
111
|
+
def verify(credit_card, options={})
|
112
|
+
MultiResponse.run(:use_first_response) do |r|
|
113
|
+
r.process { authorize(100, credit_card, options) }
|
114
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
def supports_scrubbing?
|
119
|
+
true
|
120
|
+
end
|
121
|
+
|
122
|
+
def scrub(transcript)
|
123
|
+
transcript.
|
124
|
+
gsub(%r((<merchantKey>).+?(</merchantKey>))i, '\1[FILTERED]\2').
|
125
|
+
gsub(%r((<cardNumber>).+?(</cardNumber>))i, '\1[FILTERED]\2').
|
126
|
+
gsub(%r((<cardSecurityCode>).+?(</cardSecurityCode>))i, '\1[FILTERED]\2')
|
127
|
+
end
|
128
|
+
|
111
129
|
private
|
112
130
|
|
113
131
|
def soap_request(action)
|
@@ -90,7 +90,7 @@ module ActiveMerchant #:nodoc:
|
|
90
90
|
xml.tag! "Transaction" do
|
91
91
|
xml.tag! 'TranType', 'Credit'
|
92
92
|
xml.tag! 'TranCode', action
|
93
|
-
if action == 'PreAuth' || action == 'Sale'
|
93
|
+
if options[:allow_partial_auth] && (action == 'PreAuth' || action == 'Sale')
|
94
94
|
xml.tag! "PartialAuth", "Allow"
|
95
95
|
end
|
96
96
|
add_invoice(xml, options[:order_id], nil, options)
|
@@ -113,7 +113,7 @@ module ActiveMerchant #:nodoc:
|
|
113
113
|
xml.tag! "TStream" do
|
114
114
|
xml.tag! "Transaction" do
|
115
115
|
xml.tag! 'TranType', 'Credit'
|
116
|
-
if action == 'PreAuthCapture'
|
116
|
+
if options[:allow_partial_auth] && (action == 'PreAuthCapture')
|
117
117
|
xml.tag! "PartialAuth", "Allow"
|
118
118
|
end
|
119
119
|
xml.tag! 'TranCode', (@use_tokenization ? (action + "ByRecordNo") : action)
|
@@ -51,7 +51,13 @@ module ActiveMerchant #:nodoc:
|
|
51
51
|
post[:order_id] = options[:order_id]
|
52
52
|
post[:address] = options[:billing_address] || options[:address]
|
53
53
|
post[:crypt_type] = options[:crypt_type] || @options[:crypt_type]
|
54
|
-
action =
|
54
|
+
action = if post[:cavv]
|
55
|
+
'cavv_preauth'
|
56
|
+
elsif post[:data_key].blank?
|
57
|
+
'preauth'
|
58
|
+
else
|
59
|
+
'res_preauth_cc'
|
60
|
+
end
|
55
61
|
commit(action, post)
|
56
62
|
end
|
57
63
|
|
@@ -67,7 +73,13 @@ module ActiveMerchant #:nodoc:
|
|
67
73
|
post[:order_id] = options[:order_id]
|
68
74
|
post[:address] = options[:billing_address] || options[:address]
|
69
75
|
post[:crypt_type] = options[:crypt_type] || @options[:crypt_type]
|
70
|
-
action =
|
76
|
+
action = if post[:cavv]
|
77
|
+
'cavv_purchase'
|
78
|
+
elsif post[:data_key].blank?
|
79
|
+
'purchase'
|
80
|
+
else
|
81
|
+
'res_purchase_cc'
|
82
|
+
end
|
71
83
|
commit(action, post)
|
72
84
|
end
|
73
85
|
|
@@ -161,6 +173,7 @@ module ActiveMerchant #:nodoc:
|
|
161
173
|
post[:pan] = source.number
|
162
174
|
post[:expdate] = expdate(source)
|
163
175
|
post[:cvd_value] = source.verification_value if source.verification_value?
|
176
|
+
post[:cavv] = source.payment_cryptogram if source.is_a?(NetworkTokenizationCreditCard)
|
164
177
|
end
|
165
178
|
post[:cust_id] = options[:customer] || source.name
|
166
179
|
end
|
@@ -291,8 +304,8 @@ module ActiveMerchant #:nodoc:
|
|
291
304
|
"indrefund" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
|
292
305
|
"completion" => [:order_id, :comp_amount, :txn_number, :crypt_type],
|
293
306
|
"purchasecorrection" => [:order_id, :txn_number, :crypt_type],
|
294
|
-
"
|
295
|
-
"
|
307
|
+
"cavv_preauth" => [:order_id, :cust_id, :amount, :pan, :expdate, :cavv],
|
308
|
+
"cavv_purchase" => [:order_id, :cust_id, :amount, :pan, :expdate, :cavv],
|
296
309
|
"transact" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
|
297
310
|
"Batchcloseall" => [],
|
298
311
|
"opentotals" => [:ecr_number],
|
@@ -335,6 +335,7 @@ module ActiveMerchant #:nodoc:
|
|
335
335
|
end
|
336
336
|
|
337
337
|
def commit(action, parameters)
|
338
|
+
add_pair parameters, 'RTIMEOUT', @options[:timeout] if @options[:timeout]
|
338
339
|
add_pair parameters, 'PSPID', @options[:login]
|
339
340
|
add_pair parameters, 'USERID', @options[:user]
|
340
341
|
add_pair parameters, 'PSWD', @options[:password]
|
@@ -74,6 +74,7 @@ module ActiveMerchant #:nodoc:
|
|
74
74
|
xml.tag! 'n2:' + transaction_type + 'RequestDetails' do
|
75
75
|
xml.tag! 'n2:ReferenceID', reference_id if transaction_type == 'DoReferenceTransaction'
|
76
76
|
xml.tag! 'n2:PaymentAction', action
|
77
|
+
add_descriptors(xml, options)
|
77
78
|
add_payment_details(xml, money, currency_code, options)
|
78
79
|
add_credit_card(xml, credit_card_or_referenced_id, billing_address, options) unless transaction_type == 'DoReferenceTransaction'
|
79
80
|
xml.tag! 'n2:IPAddress', options[:ip]
|
@@ -110,6 +111,11 @@ module ActiveMerchant #:nodoc:
|
|
110
111
|
end
|
111
112
|
end
|
112
113
|
|
114
|
+
def add_descriptors(xml, options)
|
115
|
+
xml.tag! 'n2:SoftDescriptor', options[:soft_descriptor] unless options[:soft_descriptor].blank?
|
116
|
+
xml.tag! 'n2:SoftDescriptorCity', options[:soft_descriptor_city] unless options[:soft_descriptor_city].blank?
|
117
|
+
end
|
118
|
+
|
113
119
|
def credit_card_type(type)
|
114
120
|
case type
|
115
121
|
when 'visa' then 'Visa'
|
@@ -604,9 +604,9 @@ module ActiveMerchant #:nodoc:
|
|
604
604
|
|
605
605
|
def add_express_only_payment_details(xml, options = {})
|
606
606
|
add_optional_fields(xml,
|
607
|
-
%w{n2:NoteText n2:
|
607
|
+
%w{n2:NoteText n2:PaymentAction
|
608
608
|
n2:TransactionId n2:AllowedPaymentMethodType
|
609
|
-
n2:PaymentRequestID
|
609
|
+
n2:PaymentRequestID },
|
610
610
|
options)
|
611
611
|
end
|
612
612
|
|
@@ -124,7 +124,7 @@ module ActiveMerchant #:nodoc:
|
|
124
124
|
def add_invoice(post, money, options)
|
125
125
|
post[:amount] = amount(money)
|
126
126
|
|
127
|
-
post[:txnid] = clean(options[:order_id], :alphanumeric,
|
127
|
+
post[:txnid] = clean(options[:order_id], :alphanumeric, 30)
|
128
128
|
post[:productinfo] = clean(options[:description] || "Purchase", nil, 100)
|
129
129
|
|
130
130
|
post[:surl] = "http://example.com"
|
@@ -19,6 +19,7 @@ module ActiveMerchant #:nodoc:
|
|
19
19
|
'capture' => 'CC.CP',
|
20
20
|
'refund' => 'CC.RF',
|
21
21
|
'void' => 'CC.RV',
|
22
|
+
'store' => 'CC.RG'
|
22
23
|
}
|
23
24
|
|
24
25
|
def initialize(options={})
|
@@ -75,6 +76,16 @@ module ActiveMerchant #:nodoc:
|
|
75
76
|
commit(request)
|
76
77
|
end
|
77
78
|
|
79
|
+
def store(payment, options = {})
|
80
|
+
request = build_xml_request do |xml|
|
81
|
+
xml.Payment(code: SUPPORTED_TRANSACTIONS["store"])
|
82
|
+
add_account(xml, payment)
|
83
|
+
add_customer(xml, payment, options)
|
84
|
+
end
|
85
|
+
|
86
|
+
commit(request)
|
87
|
+
end
|
88
|
+
|
78
89
|
def verify(credit_card, options={})
|
79
90
|
MultiResponse.run(:use_first_response) do |r|
|
80
91
|
r.process { authorize(100, credit_card, options) }
|
@@ -82,6 +93,7 @@ module ActiveMerchant #:nodoc:
|
|
82
93
|
end
|
83
94
|
end
|
84
95
|
|
96
|
+
|
85
97
|
def supports_scrubbing?
|
86
98
|
true
|
87
99
|
end
|
@@ -112,17 +124,22 @@ module ActiveMerchant #:nodoc:
|
|
112
124
|
end
|
113
125
|
end
|
114
126
|
|
115
|
-
def add_account(xml,
|
116
|
-
|
117
|
-
xml.
|
118
|
-
|
119
|
-
xml.
|
120
|
-
|
121
|
-
|
127
|
+
def add_account(xml, payment_method)
|
128
|
+
if !payment_method.respond_to?(:number)
|
129
|
+
xml.Account(registration: payment_method)
|
130
|
+
else
|
131
|
+
xml.Account do
|
132
|
+
xml.Number payment_method.number
|
133
|
+
xml.Holder "#{payment_method.first_name} #{payment_method.last_name}"
|
134
|
+
xml.Brand payment_method.brand
|
135
|
+
xml.Expiry(year: payment_method.year, month: payment_method.month)
|
136
|
+
xml.Verification payment_method.verification_value
|
137
|
+
end
|
122
138
|
end
|
123
139
|
end
|
124
140
|
|
125
141
|
def add_customer(xml, creditcard, options)
|
142
|
+
return unless creditcard.respond_to?(:number)
|
126
143
|
address = options[:billing_address]
|
127
144
|
xml.Customer do
|
128
145
|
xml.Contact do
|
@@ -187,6 +187,7 @@ module ActiveMerchant #:nodoc:
|
|
187
187
|
|
188
188
|
def add_optional_data(post, options)
|
189
189
|
add_pair(post, :GiftAidPayment, options[:gift_aid_payment]) unless options[:gift_aid_payment].blank?
|
190
|
+
add_pair(post, :ApplyAVSCV2, options[:apply_avscv2]) unless options[:apply_avscv2].blank?
|
190
191
|
add_pair(post, :Apply3DSecure, options[:apply_3d_secure]) unless options[:apply_3d_secure].blank?
|
191
192
|
add_pair(post, :CreateToken, 1) unless options[:store].blank?
|
192
193
|
add_pair(post, :FIRecipientAcctNumber, options[:recipient_account_number])
|
@@ -43,7 +43,8 @@ module ActiveMerchant #:nodoc:
|
|
43
43
|
'incorrect_zip' => STANDARD_ERROR_CODE[:incorrect_zip],
|
44
44
|
'card_declined' => STANDARD_ERROR_CODE[:card_declined],
|
45
45
|
'call_issuer' => STANDARD_ERROR_CODE[:call_issuer],
|
46
|
-
'processing_error' => STANDARD_ERROR_CODE[:processing_error]
|
46
|
+
'processing_error' => STANDARD_ERROR_CODE[:processing_error],
|
47
|
+
'incorrect_pin' => STANDARD_ERROR_CODE[:incorrect_pin]
|
47
48
|
}
|
48
49
|
|
49
50
|
def initialize(options = {})
|
@@ -187,17 +188,16 @@ module ActiveMerchant #:nodoc:
|
|
187
188
|
commit(:post, "customers/#{CGI.escape(customer_id)}", options, options)
|
188
189
|
end
|
189
190
|
|
190
|
-
def unstore(
|
191
|
+
def unstore(identification, options = {}, deprecated_options = {})
|
192
|
+
customer_id, card_id = identification.split("|")
|
193
|
+
|
191
194
|
if options.kind_of?(String)
|
192
|
-
ActiveMerchant.deprecated "Passing the card_id as the 2nd parameter is deprecated.
|
193
|
-
|
195
|
+
ActiveMerchant.deprecated "Passing the card_id as the 2nd parameter is deprecated. The response authorization includes both the customer_id and the card_id."
|
196
|
+
card_id ||= options
|
197
|
+
options = deprecated_options
|
194
198
|
end
|
195
199
|
|
196
|
-
|
197
|
-
commit(:delete, "customers/#{CGI.escape(customer_id)}/cards/#{CGI.escape(options[:card_id])}", nil, options)
|
198
|
-
else
|
199
|
-
commit(:delete, "customers/#{CGI.escape(customer_id)}", nil, options)
|
200
|
-
end
|
200
|
+
commit(:delete, "customers/#{CGI.escape(customer_id)}/cards/#{CGI.escape(card_id)}", nil, options)
|
201
201
|
end
|
202
202
|
|
203
203
|
def tokenize_apple_pay_token(apple_pay_payment_token, options = {})
|
@@ -243,6 +243,7 @@ module ActiveMerchant #:nodoc:
|
|
243
243
|
else
|
244
244
|
add_creditcard(post, payment, options)
|
245
245
|
end
|
246
|
+
|
246
247
|
unless emv_payment?(payment)
|
247
248
|
add_amount(post, money, options, true)
|
248
249
|
add_customer_data(post, options)
|
@@ -309,6 +310,7 @@ module ActiveMerchant #:nodoc:
|
|
309
310
|
if creditcard.respond_to?(:track_data) && creditcard.track_data.present?
|
310
311
|
card[:swipe_data] = creditcard.track_data
|
311
312
|
card[:fallback_reason] = creditcard.fallback_reason if creditcard.fallback_reason
|
313
|
+
card[:read_method] = "contactless" if creditcard.contactless
|
312
314
|
else
|
313
315
|
card[:number] = creditcard.number
|
314
316
|
card[:exp_month] = creditcard.month
|
@@ -329,6 +331,10 @@ module ActiveMerchant #:nodoc:
|
|
329
331
|
elsif creditcard.kind_of?(String)
|
330
332
|
if options[:track_data]
|
331
333
|
card[:swipe_data] = options[:track_data]
|
334
|
+
elsif creditcard.include?("|")
|
335
|
+
customer_id, card_id = creditcard.split("|")
|
336
|
+
card = card_id
|
337
|
+
post[:customer] = customer_id
|
332
338
|
else
|
333
339
|
card = creditcard
|
334
340
|
end
|
@@ -345,7 +351,10 @@ module ActiveMerchant #:nodoc:
|
|
345
351
|
end
|
346
352
|
|
347
353
|
def add_customer(post, payment, options)
|
348
|
-
|
354
|
+
if options[:customer] && !payment.respond_to?(:number)
|
355
|
+
ActiveMerchant.deprecated "Passing the customer in the options is deprecated. Just use the response.authorization instead."
|
356
|
+
post[:customer] = options[:customer]
|
357
|
+
end
|
349
358
|
end
|
350
359
|
|
351
360
|
def add_flags(post, options)
|
@@ -436,7 +445,7 @@ module ActiveMerchant #:nodoc:
|
|
436
445
|
success ? "Transaction approved" : response["error"]["message"],
|
437
446
|
response,
|
438
447
|
:test => response.has_key?("livemode") ? !response["livemode"] : false,
|
439
|
-
:authorization => success
|
448
|
+
:authorization => authorization_from(success, url, method, response),
|
440
449
|
:avs_result => { :code => avs_code },
|
441
450
|
:cvv_result => cvc_code,
|
442
451
|
:emv_authorization => emv_authorization_from_response(response),
|
@@ -444,6 +453,18 @@ module ActiveMerchant #:nodoc:
|
|
444
453
|
)
|
445
454
|
end
|
446
455
|
|
456
|
+
def authorization_from(success, url, method, response)
|
457
|
+
return response["error"]["charge"] unless success
|
458
|
+
|
459
|
+
if url == "customers"
|
460
|
+
[response["id"], response["sources"]["data"].first["id"]].join("|")
|
461
|
+
elsif method == :post && url.match(/customers\/.*\/cards/)
|
462
|
+
[response["customer"], response["id"]].join("|")
|
463
|
+
else
|
464
|
+
response["id"]
|
465
|
+
end
|
466
|
+
end
|
467
|
+
|
447
468
|
def response_error(raw_response)
|
448
469
|
begin
|
449
470
|
parse(raw_response)
|
@@ -223,7 +223,7 @@ module ActiveMerchant
|
|
223
223
|
doc.CustomerName("#{echeck.last_name}, #{echeck.first_name}")
|
224
224
|
doc.AccountNumber(echeck.account_number)
|
225
225
|
doc.RoutingNumber(echeck.routing_number)
|
226
|
-
doc.TransactionTypeCode("
|
226
|
+
doc.TransactionTypeCode("WEB")
|
227
227
|
end
|
228
228
|
|
229
229
|
def add_purchase_noise(doc)
|
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.52.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: 2015-07-
|
11
|
+
date: 2015-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|