activemerchant 1.87.0 → 1.88.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 +5 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +15 -15
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +33 -33
- data/lib/active_merchant/billing/gateways/cardknox.rb +10 -10
- data/lib/active_merchant/billing/gateways/cyber_source.rb +13 -13
- data/lib/active_merchant/billing/gateways/epay.rb +9 -9
- data/lib/active_merchant/billing/gateways/eway_managed.rb +18 -18
- data/lib/active_merchant/billing/gateways/exact.rb +10 -10
- data/lib/active_merchant/billing/gateways/litle.rb +1 -1
- data/lib/active_merchant/billing/gateways/merchant_one.rb +3 -3
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +4 -4
- data/lib/active_merchant/billing/gateways/mundipagg.rb +1 -1
- data/lib/active_merchant/billing/gateways/netbilling.rb +8 -8
- data/lib/active_merchant/billing/gateways/ogone.rb +2 -2
- data/lib/active_merchant/billing/gateways/omise.rb +5 -5
- data/lib/active_merchant/billing/gateways/opp.rb +1 -1
- data/lib/active_merchant/billing/gateways/paymill.rb +5 -5
- data/lib/active_merchant/billing/gateways/paypal.rb +1 -1
- data/lib/active_merchant/billing/gateways/paystation.rb +76 -76
- data/lib/active_merchant/billing/gateways/payu_latam.rb +1 -1
- data/lib/active_merchant/billing/gateways/quickbooks.rb +2 -2
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +150 -150
- data/lib/active_merchant/billing/gateways/sage.rb +11 -11
- data/lib/active_merchant/billing/gateways/sage_pay.rb +5 -5
- data/lib/active_merchant/billing/gateways/wirecard.rb +5 -5
- data/lib/active_merchant/version.rb +1 -1
- metadata +2 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53339022ee833c22c93fb9958507b7650e40b9903cdeddf48bcac2874eeaa2bd
|
4
|
+
data.tar.gz: 3c0dfd77791def2e65522466a32a9f6aacf4289f1585f39322b226f5ed3a582c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a07c6a56d9b28ee1bef9f93985d05e4a25dbb9e85f0d1432e0a89f30d6af8e57cd5b6d9f4b8b43b66d984cdfd6edecf056d7eac94ad331364f05a5758df09833
|
7
|
+
data.tar.gz: 04a43d55813f193035fc7fc00d72597093cd8c2342a7fa880b283aab2db21d58c0516ae91f1f021189b8f805665e6502b41d38e1b8bc27306ce4cc2cf0e3938e
|
data/CHANGELOG
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
= ActiveMerchant CHANGELOG
|
2
2
|
|
3
3
|
== HEAD
|
4
|
+
|
5
|
+
== Version 1.88.0 (November 30, 2018)
|
6
|
+
* Added ActiveSupport/Rails master support [Edouard-chin] #3065
|
7
|
+
|
8
|
+
== Version 1.87.0 (November 29, 2018)
|
4
9
|
* Barclaycard Smartpay: Improves Error Handling [deedeelavinder] #3026
|
5
10
|
* Braintree: Fix passing phone-only billing address [curiousepic] #3025
|
6
11
|
* Litle: Capitalize check account type [curiousepic] #3028
|
@@ -837,7 +837,7 @@ module ActiveMerchant
|
|
837
837
|
response = {action: action}
|
838
838
|
|
839
839
|
response[:response_code] = if(element = doc.at_xpath('//transactionResponse/responseCode'))
|
840
|
-
|
840
|
+
(empty?(element.content) ? nil : element.content.to_i)
|
841
841
|
end
|
842
842
|
|
843
843
|
if(element = doc.at_xpath('//errors/error'))
|
@@ -855,35 +855,35 @@ module ActiveMerchant
|
|
855
855
|
end
|
856
856
|
|
857
857
|
response[:avs_result_code] = if(element = doc.at_xpath('//avsResultCode'))
|
858
|
-
|
858
|
+
(empty?(element.content) ? nil : element.content)
|
859
859
|
end
|
860
860
|
|
861
861
|
response[:transaction_id] = if(element = doc.at_xpath('//transId'))
|
862
|
-
|
862
|
+
(empty?(element.content) ? nil : element.content)
|
863
863
|
end
|
864
864
|
|
865
865
|
response[:card_code] = if(element = doc.at_xpath('//cvvResultCode'))
|
866
|
-
|
866
|
+
(empty?(element.content) ? nil : element.content)
|
867
867
|
end
|
868
868
|
|
869
869
|
response[:authorization_code] = if(element = doc.at_xpath('//authCode'))
|
870
|
-
|
870
|
+
(empty?(element.content) ? nil : element.content)
|
871
871
|
end
|
872
872
|
|
873
873
|
response[:cardholder_authentication_code] = if(element = doc.at_xpath('//cavvResultCode'))
|
874
|
-
|
874
|
+
(empty?(element.content) ? nil : element.content)
|
875
875
|
end
|
876
876
|
|
877
877
|
response[:account_number] = if(element = doc.at_xpath('//accountNumber'))
|
878
|
-
|
878
|
+
(empty?(element.content) ? nil : element.content[-4..-1])
|
879
879
|
end
|
880
880
|
|
881
881
|
response[:test_request] = if(element = doc.at_xpath('//testRequest'))
|
882
|
-
|
882
|
+
(empty?(element.content) ? nil : element.content)
|
883
883
|
end
|
884
884
|
|
885
885
|
response[:full_response_code] = if(element = doc.at_xpath('//messages/message/code'))
|
886
|
-
|
886
|
+
(empty?(element.content) ? nil : element.content)
|
887
887
|
end
|
888
888
|
|
889
889
|
response
|
@@ -900,28 +900,28 @@ module ActiveMerchant
|
|
900
900
|
end
|
901
901
|
|
902
902
|
response[:result_code] = if(element = doc.at_xpath('//messages/resultCode'))
|
903
|
-
|
903
|
+
(empty?(element.content) ? nil : element.content)
|
904
904
|
end
|
905
905
|
|
906
906
|
response[:test_request] = if(element = doc.at_xpath('//testRequest'))
|
907
|
-
|
907
|
+
(empty?(element.content) ? nil : element.content)
|
908
908
|
end
|
909
909
|
|
910
910
|
response[:customer_profile_id] = if(element = doc.at_xpath('//customerProfileId'))
|
911
|
-
|
911
|
+
(empty?(element.content) ? nil : element.content)
|
912
912
|
end
|
913
913
|
|
914
914
|
response[:customer_payment_profile_id] = if(element = doc.at_xpath('//customerPaymentProfileIdList/numericString'))
|
915
|
-
|
915
|
+
(empty?(element.content) ? nil : element.content)
|
916
916
|
end
|
917
917
|
|
918
918
|
response[:customer_payment_profile_id] = if(element = doc.at_xpath('//customerPaymentProfileIdList/numericString') ||
|
919
919
|
doc.at_xpath('//customerPaymentProfileId'))
|
920
|
-
|
920
|
+
(empty?(element.content) ? nil : element.content)
|
921
921
|
end
|
922
922
|
|
923
923
|
response[:direct_response] = if(element = doc.at_xpath('//directResponse'))
|
924
|
-
|
924
|
+
(empty?(element.content) ? nil : element.content)
|
925
925
|
end
|
926
926
|
|
927
927
|
response.merge!(parse_direct_response_elements(response, options))
|
@@ -380,18 +380,18 @@ module ActiveMerchant #:nodoc:
|
|
380
380
|
requires!(options[:transaction], :type)
|
381
381
|
case options[:transaction][:type]
|
382
382
|
when :void
|
383
|
-
|
383
|
+
requires!(options[:transaction], :trans_id)
|
384
384
|
when :refund
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
385
|
+
requires!(options[:transaction], :trans_id) &&
|
386
|
+
(
|
387
|
+
(options[:transaction][:customer_profile_id] && options[:transaction][:customer_payment_profile_id]) ||
|
388
|
+
options[:transaction][:credit_card_number_masked] ||
|
389
|
+
(options[:transaction][:bank_routing_number_masked] && options[:transaction][:bank_account_number_masked])
|
390
|
+
)
|
391
391
|
when :prior_auth_capture
|
392
|
-
|
392
|
+
requires!(options[:transaction], :amount, :trans_id)
|
393
393
|
else
|
394
|
-
|
394
|
+
requires!(options[:transaction], :amount, :customer_profile_id, :customer_payment_profile_id)
|
395
395
|
end
|
396
396
|
request = build_request(:create_customer_profile_transaction, options)
|
397
397
|
commit(:create_customer_profile_transaction, request)
|
@@ -666,33 +666,33 @@ module ActiveMerchant #:nodoc:
|
|
666
666
|
# The amount to be billed to the customer
|
667
667
|
case transaction[:type]
|
668
668
|
when :void
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
669
|
+
tag_unless_blank(xml, 'customerProfileId', transaction[:customer_profile_id])
|
670
|
+
tag_unless_blank(xml, 'customerPaymentProfileId', transaction[:customer_payment_profile_id])
|
671
|
+
tag_unless_blank(xml, 'customerShippingAddressId', transaction[:customer_shipping_address_id])
|
672
|
+
xml.tag!('transId', transaction[:trans_id])
|
673
673
|
when :refund
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
674
|
+
xml.tag!('amount', transaction[:amount])
|
675
|
+
tag_unless_blank(xml, 'customerProfileId', transaction[:customer_profile_id])
|
676
|
+
tag_unless_blank(xml, 'customerPaymentProfileId', transaction[:customer_payment_profile_id])
|
677
|
+
tag_unless_blank(xml, 'customerShippingAddressId', transaction[:customer_shipping_address_id])
|
678
|
+
tag_unless_blank(xml, 'creditCardNumberMasked', transaction[:credit_card_number_masked])
|
679
|
+
tag_unless_blank(xml, 'bankRoutingNumberMasked', transaction[:bank_routing_number_masked])
|
680
|
+
tag_unless_blank(xml, 'bankAccountNumberMasked', transaction[:bank_account_number_masked])
|
681
|
+
add_order(xml, transaction[:order]) if transaction[:order].present?
|
682
|
+
xml.tag!('transId', transaction[:trans_id])
|
683
|
+
add_tax(xml, transaction[:tax]) if transaction[:tax]
|
684
|
+
add_duty(xml, transaction[:duty]) if transaction[:duty]
|
685
|
+
add_shipping(xml, transaction[:shipping]) if transaction[:shipping]
|
686
686
|
when :prior_auth_capture
|
687
|
-
|
688
|
-
|
689
|
-
|
687
|
+
xml.tag!('amount', transaction[:amount])
|
688
|
+
add_order(xml, transaction[:order]) if transaction[:order].present?
|
689
|
+
xml.tag!('transId', transaction[:trans_id])
|
690
690
|
else
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
691
|
+
xml.tag!('amount', transaction[:amount])
|
692
|
+
xml.tag!('customerProfileId', transaction[:customer_profile_id])
|
693
|
+
xml.tag!('customerPaymentProfileId', transaction[:customer_payment_profile_id])
|
694
|
+
xml.tag!('approvalCode', transaction[:approval_code]) if transaction[:type] == :capture_only
|
695
|
+
add_order(xml, transaction[:order]) if transaction[:order].present?
|
696
696
|
|
697
697
|
end
|
698
698
|
if [:auth_capture, :auth_only, :capture_only].include?(transaction[:type])
|
@@ -81,8 +81,8 @@ module ActiveMerchant #:nodoc:
|
|
81
81
|
|
82
82
|
def verify(credit_card, options={})
|
83
83
|
MultiResponse.run(:use_first_response) do |r|
|
84
|
-
|
85
|
-
|
84
|
+
r.process { authorize(100, credit_card, options) }
|
85
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
@@ -282,14 +282,14 @@ module ActiveMerchant #:nodoc:
|
|
282
282
|
def commit(action, source_type, parameters)
|
283
283
|
response = parse(ssl_post(live_url, post_data(COMMANDS[source_type][action], parameters)))
|
284
284
|
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
285
|
+
Response.new(
|
286
|
+
(response[:status] == 'Approved'),
|
287
|
+
message_from(response),
|
288
|
+
response,
|
289
|
+
authorization: authorization_from(response, source_type),
|
290
|
+
avs_result: { code: response[:avs_result_code] },
|
291
|
+
cvv_result: response[:cvv_result_code]
|
292
|
+
)
|
293
293
|
end
|
294
294
|
|
295
295
|
def message_from(response)
|
@@ -683,23 +683,23 @@ module ActiveMerchant #:nodoc:
|
|
683
683
|
# Where we actually build the full SOAP request using builder
|
684
684
|
def build_request(body, options)
|
685
685
|
xml = Builder::XmlMarkup.new :indent => 2
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
end
|
686
|
+
xml.instruct!
|
687
|
+
xml.tag! 's:Envelope', {'xmlns:s' => 'http://schemas.xmlsoap.org/soap/envelope/'} do
|
688
|
+
xml.tag! 's:Header' do
|
689
|
+
xml.tag! 'wsse:Security', {'s:mustUnderstand' => '1', 'xmlns:wsse' => 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'} do
|
690
|
+
xml.tag! 'wsse:UsernameToken' do
|
691
|
+
xml.tag! 'wsse:Username', @options[:login]
|
692
|
+
xml.tag! 'wsse:Password', @options[:password], 'Type' => 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'
|
694
693
|
end
|
695
694
|
end
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
695
|
+
end
|
696
|
+
xml.tag! 's:Body', {'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema'} do
|
697
|
+
xml.tag! 'requestMessage', {'xmlns' => "urn:schemas-cybersource-com:transaction-data-#{XSD_VERSION}"} do
|
698
|
+
add_merchant_data(xml, options)
|
699
|
+
xml << body
|
701
700
|
end
|
702
701
|
end
|
702
|
+
end
|
703
703
|
xml.target!
|
704
704
|
end
|
705
705
|
|
@@ -252,17 +252,17 @@ module ActiveMerchant #:nodoc:
|
|
252
252
|
def xml_builder(params, soap_call)
|
253
253
|
xml = Builder::XmlMarkup.new(:indent => 2)
|
254
254
|
xml.instruct!
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
end
|
255
|
+
xml.tag! 'soap:Envelope', { 'xmlns:xsi' => 'http://schemas.xmlsoap.org/soap/envelope/',
|
256
|
+
'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
|
257
|
+
'xmlns:soap' => 'http://schemas.xmlsoap.org/soap/envelope/' } do
|
258
|
+
xml.tag! 'soap:Body' do
|
259
|
+
xml.tag! soap_call, { 'xmlns' => "#{self.live_url}remote/payment" } do
|
260
|
+
xml.tag! 'merchantnumber', @options[:login]
|
261
|
+
xml.tag! 'transactionid', params[:transaction]
|
262
|
+
xml.tag! 'amount', params[:amount].to_s if soap_call != 'delete'
|
264
263
|
end
|
265
264
|
end
|
265
|
+
end
|
266
266
|
xml.target!
|
267
267
|
end
|
268
268
|
|
@@ -150,7 +150,7 @@ module ActiveMerchant #:nodoc:
|
|
150
150
|
reply = {}
|
151
151
|
xml = REXML::Document.new(body)
|
152
152
|
if root = REXML::XPath.first(xml, '//soap:Fault') then
|
153
|
-
|
153
|
+
reply=parse_fault(root)
|
154
154
|
else
|
155
155
|
if root = REXML::XPath.first(xml, '//ProcessPaymentResponse/ewayResponse') then
|
156
156
|
# Successful payment
|
@@ -232,33 +232,33 @@ module ActiveMerchant #:nodoc:
|
|
232
232
|
# eWay demands all fields be sent, but contain an empty string if blank
|
233
233
|
post = case action
|
234
234
|
when 'QueryCustomer'
|
235
|
-
|
235
|
+
arguments
|
236
236
|
when 'ProcessPayment'
|
237
|
-
|
237
|
+
default_payment_fields.merge(arguments)
|
238
238
|
when 'CreateCustomer'
|
239
|
-
|
239
|
+
default_customer_fields.merge(arguments)
|
240
240
|
when 'UpdateCustomer'
|
241
|
-
|
241
|
+
default_customer_fields.merge(arguments)
|
242
242
|
end
|
243
243
|
|
244
244
|
xml = Builder::XmlMarkup.new :indent => 2
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
end
|
245
|
+
xml.instruct!
|
246
|
+
xml.tag! 'soap12:Envelope', {'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema', 'xmlns:soap12' => 'http://www.w3.org/2003/05/soap-envelope'} do
|
247
|
+
xml.tag! 'soap12:Header' do
|
248
|
+
xml.tag! 'eWAYHeader', {'xmlns' => 'https://www.eway.com.au/gateway/managedpayment'} do
|
249
|
+
xml.tag! 'eWAYCustomerID', @options[:login]
|
250
|
+
xml.tag! 'Username', @options[:username]
|
251
|
+
xml.tag! 'Password', @options[:password]
|
253
252
|
end
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
253
|
+
end
|
254
|
+
xml.tag! 'soap12:Body' do |x|
|
255
|
+
x.tag! action, {'xmlns' => 'https://www.eway.com.au/gateway/managedpayment'} do |y|
|
256
|
+
post.each do |key, value|
|
257
|
+
y.tag! key, value
|
259
258
|
end
|
260
259
|
end
|
261
260
|
end
|
261
|
+
end
|
262
262
|
xml.target!
|
263
263
|
end
|
264
264
|
|
@@ -160,14 +160,14 @@ module ActiveMerchant #:nodoc:
|
|
160
160
|
end
|
161
161
|
|
162
162
|
def commit(action, request)
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
163
|
+
response = parse(ssl_post(self.live_url, build_request(action, request), POST_HEADERS))
|
164
|
+
|
165
|
+
Response.new(successful?(response), message_from(response), response,
|
166
|
+
:test => test?,
|
167
|
+
:authorization => authorization_from(response),
|
168
|
+
:avs_result => { :code => response[:avs] },
|
169
|
+
:cvv_result => response[:cvv2]
|
170
|
+
)
|
171
171
|
rescue ResponseError => e
|
172
172
|
case e.response.code
|
173
173
|
when '401'
|
@@ -183,9 +183,9 @@ module ActiveMerchant #:nodoc:
|
|
183
183
|
|
184
184
|
def authorization_from(response)
|
185
185
|
if response[:authorization_num] && response[:transaction_tag]
|
186
|
-
|
186
|
+
"#{response[:authorization_num]};#{response[:transaction_tag]}"
|
187
187
|
else
|
188
|
-
|
188
|
+
''
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
@@ -33,7 +33,7 @@ module ActiveMerchant #:nodoc:
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
36
|
-
|
36
|
+
check?(payment_method) ? commit(:echeckSales, request, money) : commit(:sale, request, money)
|
37
37
|
end
|
38
38
|
|
39
39
|
def authorize(money, payment_method, options={})
|
@@ -75,9 +75,9 @@ module ActiveMerchant #:nodoc:
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def add_creditcard(post, creditcard)
|
78
|
-
|
79
|
-
|
80
|
-
|
78
|
+
post['cvv'] = creditcard.verification_value
|
79
|
+
post['ccnumber'] = creditcard.number
|
80
|
+
post['ccexp'] = "#{sprintf("%02d", creditcard.month)}#{creditcard.year.to_s[-2, 2]}"
|
81
81
|
end
|
82
82
|
|
83
83
|
def commit(action, money, parameters={})
|
@@ -226,10 +226,10 @@ module ActiveMerchant #:nodoc:
|
|
226
226
|
if credit_card.respond_to?(:track_data) && credit_card.track_data.present?
|
227
227
|
xml.tag! 'trackData', credit_card.track_data
|
228
228
|
else
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
229
|
+
xml.tag! 'strPAN', credit_card.number
|
230
|
+
xml.tag! 'strExpDate', expdate(credit_card)
|
231
|
+
xml.tag! 'strCardHolder', credit_card.name
|
232
|
+
xml.tag! 'strCVCode', credit_card.verification_value if credit_card.verification_value?
|
233
233
|
end
|
234
234
|
end
|
235
235
|
|
@@ -143,14 +143,14 @@ module ActiveMerchant #:nodoc:
|
|
143
143
|
post[:bill_state] = billing_address[:state]
|
144
144
|
end
|
145
145
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
146
|
+
if shipping_address = options[:shipping_address]
|
147
|
+
post[:ship_name1], post[:ship_name2] = split_names(shipping_address[:name])
|
148
|
+
post[:ship_street] = shipping_address[:address1]
|
149
|
+
post[:ship_zip] = shipping_address[:zip]
|
150
|
+
post[:ship_city] = shipping_address[:city]
|
151
|
+
post[:ship_country] = shipping_address[:country]
|
152
|
+
post[:ship_state] = shipping_address[:state]
|
153
|
+
end
|
154
154
|
end
|
155
155
|
|
156
156
|
def add_invoice(post, options)
|