activemerchant 1.69.0 → 1.70.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +15 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +10 -1
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +11 -7
- data/lib/active_merchant/billing/gateways/global_transport.rb +5 -1
- data/lib/active_merchant/billing/gateways/litle.rb +6 -10
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +229 -0
- data/lib/active_merchant/billing/gateways/orbital.rb +36 -0
- data/lib/active_merchant/billing/gateways/payu_latam.rb +2 -0
- data/lib/active_merchant/billing/gateways/qvalent.rb +3 -1
- data/lib/active_merchant/billing/gateways/safe_charge.rb +1 -0
- data/lib/active_merchant/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e4551f67805adf4841b97037e5340d2a628864e
|
4
|
+
data.tar.gz: 289a668109a083ee0ee467972dddfd8adc65c5d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79a3b02993aecc1c0b0fabc8a0d96901cb40388ee52f2fec05be7d6b6377b956ed60e46f72ab113103d430201ef3402ef94dc33c7022ae0d732e088b2be145a3
|
7
|
+
data.tar.gz: a887ee071f9df0d1e49a5e92fd59576c142ae59a1a16df872c9c380b77ecb5eb6d7933090697564e1eaedd80685e859fd93b74be0344a451bdce297abc54292c
|
data/CHANGELOG
CHANGED
@@ -2,6 +2,20 @@
|
|
2
2
|
|
3
3
|
== HEAD
|
4
4
|
|
5
|
+
== Version 1.70.0 (August 4, 2017)
|
6
|
+
* Barclaycard Smartpay: Provider a default billing address house number [nfarve] #2520
|
7
|
+
* FirstData E4: Fix duplicate XID and CAVV values in tokenized transactions [jasonwebster] #2529
|
8
|
+
* FirstData E4: Loose XSD validation for Payeezy (FirstData E4) [jasonwebster] #2529
|
9
|
+
* GlobalTransport: Support partial authorizations [dtykocki] #2511
|
10
|
+
* Litle: Update schema and certification tests to v9.12 [curiousepic] #2522
|
11
|
+
* Litle: Update urls and name to Vantiv [curiousepic] #2531
|
12
|
+
* Mercado Pago: Add gateway support [davidsantoso] #2518
|
13
|
+
* Orbital: Add support for level 2 data [dtykocki] #2515
|
14
|
+
* PayU Latam: Pass DNI Number [curiousepic] #2517
|
15
|
+
* Qvalent: Pass 3dSecure fields [curiousepic] #2508
|
16
|
+
* SafeCharge: Correct UserID field name [curiousepic]
|
17
|
+
* SafeCharge: Pass UserID field [curiousepic] #2507
|
18
|
+
|
5
19
|
== Version 1.69.0 (July 12, 2017)
|
6
20
|
* WePay: Add payer_rbits and transaction_rbits optional fields [davidsantoso]
|
7
21
|
* Adyen: Use Active Merchant standard order_id option for reference [jasonwebster] #2483
|
@@ -19,6 +33,7 @@
|
|
19
33
|
* PayFlow: Add optional email field [davidsantoso] #2505
|
20
34
|
* Worldpay: Support Credit on CFT-enabled merchant IDs [curiousepic] #2503
|
21
35
|
* FirstPay: Add processor_id field [davidsantoso] #2506
|
36
|
+
* Authorize.Net: Use two character default for billing state [dtykocki] #2496
|
22
37
|
|
23
38
|
== Version 1.68.0 (June 27, 2017)
|
24
39
|
* Authorize.Net: Return failed response if forced refund settlement fails [bizla] #2476
|
@@ -555,6 +555,7 @@ module ActiveMerchant
|
|
555
555
|
|
556
556
|
xml.billTo do
|
557
557
|
first_name, last_name = names_from(payment_source, address, options)
|
558
|
+
state = state_from(address, options)
|
558
559
|
full_address = "#{address[:address1]} #{address[:address2]}".strip
|
559
560
|
|
560
561
|
xml.firstName(truncate(first_name, 50)) unless empty?(first_name)
|
@@ -562,7 +563,7 @@ module ActiveMerchant
|
|
562
563
|
xml.company(truncate(address[:company], 50)) unless empty?(address[:company])
|
563
564
|
xml.address(truncate(full_address, 60))
|
564
565
|
xml.city(truncate(address[:city], 40))
|
565
|
-
xml.state(
|
566
|
+
xml.state(truncate(state, 40))
|
566
567
|
xml.zip(truncate((address[:zip] || options[:zip]), 20))
|
567
568
|
xml.country(truncate(address[:country], 60))
|
568
569
|
xml.phoneNumber(truncate(address[:phone], 25)) unless empty?(address[:phone])
|
@@ -714,6 +715,14 @@ module ActiveMerchant
|
|
714
715
|
end
|
715
716
|
end
|
716
717
|
|
718
|
+
def state_from(address, options)
|
719
|
+
if ["US", "CA"].include?(address[:country])
|
720
|
+
address[:state] || 'NC'
|
721
|
+
else
|
722
|
+
address[:state]
|
723
|
+
end
|
724
|
+
end
|
725
|
+
|
717
726
|
def headers
|
718
727
|
{ 'Content-Type' => 'text/xml' }
|
719
728
|
end
|
@@ -226,12 +226,12 @@ module ActiveMerchant #:nodoc:
|
|
226
226
|
def address_hash(address)
|
227
227
|
full_address = "#{address[:address1]} #{address[:address2]}" if address
|
228
228
|
street = address[:street] if address[:street]
|
229
|
-
house = address[:houseNumberOrName]
|
229
|
+
house = address[:houseNumberOrName] ? address[:houseNumberOrName] : full_address.split(/\s+/).keep_if { |x| x =~ /\d/ }.join(' ')
|
230
230
|
|
231
231
|
hash = {}
|
232
232
|
hash[:city] = address[:city] if address[:city]
|
233
233
|
hash[:street] = street || full_address.split(/\s+/).keep_if { |x| x !~ /\d/ }.join(' ')
|
234
|
-
hash[:houseNumberOrName] = house
|
234
|
+
hash[:houseNumberOrName] = house.empty? ? "Not Provided" : house
|
235
235
|
hash[:postalCode] = address[:zip] if address[:zip]
|
236
236
|
hash[:stateOrProvince] = address[:state] if address[:state]
|
237
237
|
hash[:country] = address[:country] if address[:country]
|
@@ -156,7 +156,7 @@ module ActiveMerchant #:nodoc:
|
|
156
156
|
xml = Builder::XmlMarkup.new
|
157
157
|
|
158
158
|
xml.instruct!
|
159
|
-
xml.tag! "Transaction" do
|
159
|
+
xml.tag! "Transaction", xmlns: "http://secure2.e-xact.com/vplug-in/transaction/rpc-enc/encodedTypes" do
|
160
160
|
add_credentials(xml)
|
161
161
|
add_transaction_type(xml, action)
|
162
162
|
xml << body
|
@@ -171,14 +171,13 @@ module ActiveMerchant #:nodoc:
|
|
171
171
|
add_amount(xml, money, options)
|
172
172
|
|
173
173
|
if credit_card_or_store_authorization.is_a? String
|
174
|
-
add_credit_card_token(xml, credit_card_or_store_authorization)
|
174
|
+
add_credit_card_token(xml, credit_card_or_store_authorization, options)
|
175
175
|
else
|
176
176
|
add_credit_card(xml, credit_card_or_store_authorization, options)
|
177
177
|
end
|
178
178
|
|
179
179
|
add_customer_data(xml, options)
|
180
180
|
add_invoice(xml, options)
|
181
|
-
add_card_authentication_data(xml, options)
|
182
181
|
add_tax_fields(xml, options)
|
183
182
|
add_level_3(xml, options)
|
184
183
|
|
@@ -254,9 +253,13 @@ module ActiveMerchant #:nodoc:
|
|
254
253
|
|
255
254
|
if credit_card.is_a?(NetworkTokenizationCreditCard)
|
256
255
|
add_network_tokenization_credit_card(xml, credit_card)
|
257
|
-
|
258
|
-
|
259
|
-
|
256
|
+
else
|
257
|
+
if credit_card.verification_value?
|
258
|
+
xml.tag! "CVD_Presence_Ind", "1"
|
259
|
+
xml.tag! "VerificationStr2", credit_card.verification_value
|
260
|
+
end
|
261
|
+
|
262
|
+
add_card_authentication_data(xml, options)
|
260
263
|
end
|
261
264
|
end
|
262
265
|
|
@@ -277,7 +280,7 @@ module ActiveMerchant #:nodoc:
|
|
277
280
|
xml.tag! "XID", options[:xid]
|
278
281
|
end
|
279
282
|
|
280
|
-
def add_credit_card_token(xml, store_authorization)
|
283
|
+
def add_credit_card_token(xml, store_authorization, options)
|
281
284
|
params = store_authorization.split(";")
|
282
285
|
credit_card = CreditCard.new(
|
283
286
|
:brand => params[1],
|
@@ -290,6 +293,7 @@ module ActiveMerchant #:nodoc:
|
|
290
293
|
xml.tag! "Expiry_Date", expdate(credit_card)
|
291
294
|
xml.tag! "CardHoldersName", credit_card.name
|
292
295
|
xml.tag! "CardType", card_type(credit_card.brand)
|
296
|
+
add_card_authentication_data(xml, options)
|
293
297
|
end
|
294
298
|
|
295
299
|
def add_customer_data(xml, options)
|
@@ -109,6 +109,10 @@ module ActiveMerchant #:nodoc:
|
|
109
109
|
response[node.name.downcase.to_sym] = node.text
|
110
110
|
end
|
111
111
|
|
112
|
+
ext_data = Nokogiri::HTML.parse(response[:extdata])
|
113
|
+
response[:approved_amount] = ext_data.xpath("//approvedamount").text
|
114
|
+
response[:balance_due] = ext_data.xpath("//balancedue").text
|
115
|
+
|
112
116
|
response
|
113
117
|
end
|
114
118
|
|
@@ -140,7 +144,7 @@ module ActiveMerchant #:nodoc:
|
|
140
144
|
end
|
141
145
|
|
142
146
|
def success_from(response)
|
143
|
-
|
147
|
+
response[:result] == "0" || response[:result] == "200"
|
144
148
|
end
|
145
149
|
|
146
150
|
def message_from(response)
|
@@ -3,24 +3,18 @@ require 'nokogiri'
|
|
3
3
|
module ActiveMerchant #:nodoc:
|
4
4
|
module Billing #:nodoc:
|
5
5
|
class LitleGateway < Gateway
|
6
|
-
SCHEMA_VERSION = '9.
|
6
|
+
SCHEMA_VERSION = '9.12'
|
7
7
|
|
8
8
|
self.test_url = 'https://www.testlitle.com/sandbox/communicator/online'
|
9
|
-
self.live_url = 'https://payments.
|
9
|
+
self.live_url = 'https://payments.vantivcnp.com/vap/communicator/online'
|
10
10
|
|
11
11
|
self.supported_countries = ['US']
|
12
12
|
self.default_currency = 'USD'
|
13
13
|
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
|
14
14
|
|
15
|
-
self.homepage_url = 'http://www.
|
16
|
-
self.display_name = '
|
15
|
+
self.homepage_url = 'http://www.vantiv.com/'
|
16
|
+
self.display_name = 'Vantiv eCommerce'
|
17
17
|
|
18
|
-
# Public: Create a new Litle gateway.
|
19
|
-
#
|
20
|
-
# options - A hash of options:
|
21
|
-
# :login - The user.
|
22
|
-
# :password - The password.
|
23
|
-
# :merchant_id - The merchant id.
|
24
18
|
def initialize(options={})
|
25
19
|
requires!(options, :login, :password, :merchant_id)
|
26
20
|
super
|
@@ -261,6 +255,8 @@ module ActiveMerchant #:nodoc:
|
|
261
255
|
doc.orderSource(options[:order_source])
|
262
256
|
elsif payment_method.is_a?(NetworkTokenizationCreditCard) && payment_method.source == :apple_pay
|
263
257
|
doc.orderSource('applepay')
|
258
|
+
elsif payment_method.is_a?(NetworkTokenizationCreditCard) && payment_method.source == :android_pay
|
259
|
+
doc.orderSource('androidpay')
|
264
260
|
elsif payment_method.respond_to?(:track_data) && payment_method.track_data.present?
|
265
261
|
doc.orderSource('retail')
|
266
262
|
else
|
@@ -0,0 +1,229 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
class MercadoPagoGateway < Gateway
|
4
|
+
self.live_url = self.test_url = 'https://api.mercadopago.com/v1'
|
5
|
+
|
6
|
+
self.supported_countries = ['AR', 'BR', 'CL', 'CO', 'MX', 'PE', 'UY']
|
7
|
+
self.supported_cardtypes = [:visa, :master, :american_express]
|
8
|
+
|
9
|
+
self.homepage_url = 'https://www.mercadopago.com/'
|
10
|
+
self.display_name = 'Mercado Pago'
|
11
|
+
self.money_format = :dollars
|
12
|
+
|
13
|
+
def initialize(options={})
|
14
|
+
requires!(options, :access_token)
|
15
|
+
super
|
16
|
+
end
|
17
|
+
|
18
|
+
def purchase(money, payment, options={})
|
19
|
+
MultiResponse.run do |r|
|
20
|
+
r.process { commit("tokenize", "card_tokens", card_token_request(money, payment, options)) }
|
21
|
+
options.merge!(card_brand: payment.brand)
|
22
|
+
options.merge!(card_token: r.authorization.split("|").first)
|
23
|
+
r.process { commit("purchase", "payments", purchase_request(money, payment, options) ) }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def authorize(money, payment, options={})
|
28
|
+
MultiResponse.run do |r|
|
29
|
+
r.process { commit("tokenize", "card_tokens", card_token_request(money, payment, options)) }
|
30
|
+
options.merge!(card_brand: payment.brand)
|
31
|
+
options.merge!(card_token: r.authorization.split("|").first)
|
32
|
+
r.process { commit("authorize", "payments", authorize_request(money, payment, options) ) }
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def capture(money, authorization, options={})
|
37
|
+
post = {}
|
38
|
+
authorization, _ = authorization.split("|")
|
39
|
+
post[:capture] = true
|
40
|
+
post[:transaction_amount] = amount(money).to_f
|
41
|
+
commit("capture", "payments/#{authorization}", post)
|
42
|
+
end
|
43
|
+
|
44
|
+
def refund(money, authorization, options={})
|
45
|
+
post = {}
|
46
|
+
authorization, original_amount = authorization.split("|")
|
47
|
+
post[:amount] = amount(money).to_f if original_amount && original_amount.to_f > amount(money).to_f
|
48
|
+
commit("refund", "payments/#{authorization}/refunds", post)
|
49
|
+
end
|
50
|
+
|
51
|
+
def void(authorization, options={})
|
52
|
+
authorization, _ = authorization.split("|")
|
53
|
+
post = { status: "cancelled" }
|
54
|
+
commit("void", "payments/#{authorization}", post)
|
55
|
+
end
|
56
|
+
|
57
|
+
def verify(credit_card, options={})
|
58
|
+
MultiResponse.run(:use_first_response) do |r|
|
59
|
+
r.process { authorize(100, credit_card, options) }
|
60
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def supports_scrubbing?
|
65
|
+
true
|
66
|
+
end
|
67
|
+
|
68
|
+
def scrub(transcript)
|
69
|
+
transcript.
|
70
|
+
gsub(%r((access_token=).*?([^\s]+)), '\1[FILTERED]').
|
71
|
+
gsub(%r((\"card_number\\\":\\\")\d+), '\1[FILTERED]').
|
72
|
+
gsub(%r((\"security_code\\\":\\\")\d+), '\1[FILTERED]')
|
73
|
+
end
|
74
|
+
|
75
|
+
private
|
76
|
+
|
77
|
+
def card_token_request(money, payment, options = {})
|
78
|
+
post = {}
|
79
|
+
post[:card_number] = payment.number
|
80
|
+
post[:security_code] = payment.verification_value
|
81
|
+
post[:expiration_month] = payment.month
|
82
|
+
post[:expiration_year] = payment.year
|
83
|
+
post[:cardholder] = { name: payment.name }
|
84
|
+
post
|
85
|
+
end
|
86
|
+
|
87
|
+
def purchase_request(money, payment, options = {})
|
88
|
+
post = {}
|
89
|
+
add_invoice(post, money, options)
|
90
|
+
add_payment(post, options)
|
91
|
+
add_additional_data(post, options)
|
92
|
+
add_customer_data(post, payment, options)
|
93
|
+
add_address(post, options)
|
94
|
+
post
|
95
|
+
end
|
96
|
+
|
97
|
+
def authorize_request(money, payment, options = {})
|
98
|
+
post = purchase_request(money, payment, options)
|
99
|
+
post.merge!(capture: false)
|
100
|
+
post
|
101
|
+
end
|
102
|
+
|
103
|
+
def add_additional_data(post, options)
|
104
|
+
post[:sponsor_id] = options["sponsor_id"]
|
105
|
+
post[:additional_info] = {
|
106
|
+
ip_address: options[:ip_address]
|
107
|
+
}
|
108
|
+
|
109
|
+
add_address(post, options)
|
110
|
+
end
|
111
|
+
|
112
|
+
def add_customer_data(post, payment, options)
|
113
|
+
post[:payer] = {
|
114
|
+
email: options[:email],
|
115
|
+
first_name: payment.first_name,
|
116
|
+
last_name: payment.last_name
|
117
|
+
}
|
118
|
+
end
|
119
|
+
|
120
|
+
def add_address(post, options)
|
121
|
+
if address = (options[:billing_address] || options[:address])
|
122
|
+
street_number = address[:address1].split(" ").first
|
123
|
+
street_name = address[:address1].split(" ")[1..-1].join(" ")
|
124
|
+
|
125
|
+
post[:additional_info] = {
|
126
|
+
payer: {
|
127
|
+
address: {
|
128
|
+
zip_code: address[:zip],
|
129
|
+
street_number: street_number,
|
130
|
+
street_name: street_name,
|
131
|
+
}
|
132
|
+
}
|
133
|
+
}
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
def add_invoice(post, money, options)
|
138
|
+
post[:transaction_amount] = amount(money).to_f
|
139
|
+
post[:description] = options[:description]
|
140
|
+
post[:installments] = options[:installments] ? options[:installments].to_i : 1
|
141
|
+
post[:statement_descriptor] = options[:statement_descriptor] if options[:statement_descriptor]
|
142
|
+
post[:order] = {
|
143
|
+
type: options[:order_type] || "mercadopago",
|
144
|
+
id: options[:order_id] || generate_integer_only_order_id
|
145
|
+
}
|
146
|
+
end
|
147
|
+
|
148
|
+
def add_payment(post, options)
|
149
|
+
post[:token] = options[:card_token]
|
150
|
+
post[:payment_method_id] = options[:card_brand]
|
151
|
+
end
|
152
|
+
|
153
|
+
def parse(body)
|
154
|
+
JSON.parse(body)
|
155
|
+
end
|
156
|
+
|
157
|
+
def commit(action, path, parameters)
|
158
|
+
if ["capture", "void"].include?(action)
|
159
|
+
response = parse(ssl_request(:put, url(path), post_data(parameters), headers))
|
160
|
+
else
|
161
|
+
response = parse(ssl_post(url(path), post_data(parameters), headers))
|
162
|
+
end
|
163
|
+
|
164
|
+
Response.new(
|
165
|
+
success_from(action, response),
|
166
|
+
message_from(response),
|
167
|
+
response,
|
168
|
+
authorization: authorization_from(response, parameters),
|
169
|
+
test: test?,
|
170
|
+
error_code: error_code_from(action, response)
|
171
|
+
)
|
172
|
+
end
|
173
|
+
|
174
|
+
def success_from(action, response)
|
175
|
+
if action == "refund"
|
176
|
+
response["error"].nil?
|
177
|
+
else
|
178
|
+
["active", "approved", "authorized", "cancelled"].include?(response["status"])
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
def message_from(response)
|
183
|
+
(response["status_detail"]) || (response["message"])
|
184
|
+
end
|
185
|
+
|
186
|
+
def authorization_from(response, params)
|
187
|
+
[response["id"], params[:transaction_amount]].join("|")
|
188
|
+
end
|
189
|
+
|
190
|
+
def post_data(parameters = {})
|
191
|
+
parameters.to_json
|
192
|
+
end
|
193
|
+
|
194
|
+
def error_code_from(action, response)
|
195
|
+
unless success_from(action, response)
|
196
|
+
if cause = response["cause"]
|
197
|
+
cause.empty? ? nil : cause.first["code"]
|
198
|
+
else
|
199
|
+
response["status"]
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
def url(action)
|
205
|
+
full_url = (test? ? test_url : live_url)
|
206
|
+
full_url + "/#{action}?access_token=#{@options[:access_token]}"
|
207
|
+
end
|
208
|
+
|
209
|
+
def headers
|
210
|
+
{
|
211
|
+
"Content-Type" => "application/json"
|
212
|
+
}
|
213
|
+
end
|
214
|
+
|
215
|
+
def handle_response(response)
|
216
|
+
case response.code.to_i
|
217
|
+
when 200..499
|
218
|
+
response.body
|
219
|
+
else
|
220
|
+
raise ResponseError.new(response)
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
def generate_integer_only_order_id
|
225
|
+
Time.now.to_i + rand(0..1000)
|
226
|
+
end
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
@@ -354,6 +354,34 @@ module ActiveMerchant #:nodoc:
|
|
354
354
|
xml.tag! :SDMerchantEmail, soft_desc[:merchant_email] || nil
|
355
355
|
end
|
356
356
|
|
357
|
+
def add_level_2_tax(xml, options={})
|
358
|
+
if (level_2 = options[:level_2_data])
|
359
|
+
xml.tag! :TaxInd, level_2[:tax_indicator] if [TAX_NOT_PROVIDED, TAX_INCLUDED, NON_TAXABLE_TRANSACTION].include?(level_2[:tax_indicator])
|
360
|
+
xml.tag! :Tax, amount(level_2[:tax]) if level_2[:tax]
|
361
|
+
end
|
362
|
+
end
|
363
|
+
|
364
|
+
def add_level_2_advice_addendum(xml, options={})
|
365
|
+
if (level_2 = options[:level_2_data])
|
366
|
+
xml.tag! :AMEXTranAdvAddn1, byte_limit(level_2[:advice_addendum_1], 40) if level_2[:advice_addendum_1]
|
367
|
+
xml.tag! :AMEXTranAdvAddn2, byte_limit(level_2[:advice_addendum_2], 40) if level_2[:advice_addendum_2]
|
368
|
+
xml.tag! :AMEXTranAdvAddn3, byte_limit(level_2[:advice_addendum_3], 40) if level_2[:advice_addendum_3]
|
369
|
+
xml.tag! :AMEXTranAdvAddn4, byte_limit(level_2[:advice_addendum_4], 40) if level_2[:advice_addendum_4]
|
370
|
+
end
|
371
|
+
end
|
372
|
+
|
373
|
+
def add_level_2_purchase(xml, options={})
|
374
|
+
if (level_2 = options[:level_2_data])
|
375
|
+
xml.tag! :PCOrderNum, byte_limit(level_2[:purchase_order], 17) if level_2[:purchase_order]
|
376
|
+
xml.tag! :PCDestZip, byte_limit(format_address_field(level_2[:zip]), 10) if level_2[:zip]
|
377
|
+
xml.tag! :PCDestName, byte_limit(format_address_field(level_2[:name]), 30) if level_2[:name]
|
378
|
+
xml.tag! :PCDestAddress1, byte_limit(format_address_field(level_2[:address1]), 30) if level_2[:address1]
|
379
|
+
xml.tag! :PCDestAddress2, byte_limit(format_address_field(level_2[:address2]), 30) if level_2[:address2]
|
380
|
+
xml.tag! :PCDestCity, byte_limit(format_address_field(level_2[:city]), 20) if level_2[:city]
|
381
|
+
xml.tag! :PCDestState, byte_limit(format_address_field(level_2[:state]), 2) if level_2[:state]
|
382
|
+
end
|
383
|
+
end
|
384
|
+
|
357
385
|
def add_address(xml, creditcard, options)
|
358
386
|
if(address = (options[:billing_address] || options[:address]))
|
359
387
|
avs_supported = AVS_SUPPORTED_COUNTRIES.include?(address[:country].to_s) || empty?(address[:country])
|
@@ -565,6 +593,9 @@ module ActiveMerchant #:nodoc:
|
|
565
593
|
xml.tag! :Amount, amount(money)
|
566
594
|
xml.tag! :Comments, parameters[:comments] if parameters[:comments]
|
567
595
|
|
596
|
+
add_level_2_tax(xml, parameters)
|
597
|
+
add_level_2_advice_addendum(xml, parameters)
|
598
|
+
|
568
599
|
# CustomerAni, AVSPhoneType and AVSDestPhoneType could be added here.
|
569
600
|
|
570
601
|
if parameters[:soft_descriptors].is_a?(OrbitalSoftDescriptors)
|
@@ -580,6 +611,8 @@ module ActiveMerchant #:nodoc:
|
|
580
611
|
tx_ref_num, _ = split_authorization(parameters[:authorization])
|
581
612
|
xml.tag! :TxRefNum, tx_ref_num
|
582
613
|
end
|
614
|
+
|
615
|
+
add_level_2_purchase(xml, parameters)
|
583
616
|
end
|
584
617
|
end
|
585
618
|
xml.target!
|
@@ -603,8 +636,11 @@ module ActiveMerchant #:nodoc:
|
|
603
636
|
add_xml_credentials(xml)
|
604
637
|
xml.tag! :OrderID, format_order_id(order_id)
|
605
638
|
xml.tag! :Amount, amount(money)
|
639
|
+
add_level_2_tax(xml, parameters)
|
606
640
|
add_bin_merchant_and_terminal(xml, parameters)
|
607
641
|
xml.tag! :TxRefNum, tx_ref_num
|
642
|
+
add_level_2_purchase(xml, parameters)
|
643
|
+
add_level_2_advice_addendum(xml, parameters)
|
608
644
|
end
|
609
645
|
end
|
610
646
|
xml.target!
|
@@ -155,6 +155,7 @@ module ActiveMerchant #:nodoc:
|
|
155
155
|
if address = options[:shipping_address]
|
156
156
|
buyer = {}
|
157
157
|
buyer[:fullName] = address[:name]
|
158
|
+
buyer[:dniNumber] = options[:dni_number]
|
158
159
|
shipping_address = {}
|
159
160
|
shipping_address[:street1] = address[:address1]
|
160
161
|
shipping_address[:street2] = address[:address2]
|
@@ -234,6 +235,7 @@ module ActiveMerchant #:nodoc:
|
|
234
235
|
post[:transaction][:paymentCountry] = address[:country]
|
235
236
|
payer[:fullName] = address[:name]
|
236
237
|
payer[:contactPhone] = address[:phone]
|
238
|
+
payer[:dniNumber] = options[:dni_number]
|
237
239
|
billing_address = {}
|
238
240
|
billing_address[:street1] = address[:address1]
|
239
241
|
billing_address[:street2] = address[:address2]
|
@@ -108,7 +108,7 @@ module ActiveMerchant #:nodoc:
|
|
108
108
|
def add_invoice(post, money, options)
|
109
109
|
post["order.amount"] = amount(money)
|
110
110
|
post["card.currency"] = CURRENCY_CODES[options[:currency] || currency(money)]
|
111
|
-
post["order.ECI"] = "SSL"
|
111
|
+
post["order.ECI"] = options[:eci] ? options[:eci] : "SSL"
|
112
112
|
end
|
113
113
|
|
114
114
|
def add_payment_method(post, payment_method)
|
@@ -137,6 +137,8 @@ module ActiveMerchant #:nodoc:
|
|
137
137
|
|
138
138
|
def add_customer_data(post, options)
|
139
139
|
post["order.ipAddress"] = options[:ip]
|
140
|
+
post["order.xid"] = options[:xid] if options[:xid]
|
141
|
+
post["order.cavv"] = options[:cavv] if options[:cavv]
|
140
142
|
end
|
141
143
|
|
142
144
|
def commit(action, post)
|
@@ -117,6 +117,7 @@ module ActiveMerchant #:nodoc:
|
|
117
117
|
post[:sg_ResponseFormat] = "4"
|
118
118
|
post[:sg_Version] = VERSION
|
119
119
|
post[:sg_ClientUniqueID] = options[:order_id] if options[:order_id]
|
120
|
+
post[:sg_UserID] = options[:user_id] if options[:user_id]
|
120
121
|
end
|
121
122
|
|
122
123
|
def add_payment(post, payment)
|
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.70.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: 2017-07
|
11
|
+
date: 2017-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -253,6 +253,7 @@ files:
|
|
253
253
|
- lib/active_merchant/billing/gateways/litle.rb
|
254
254
|
- lib/active_merchant/billing/gateways/mastercard.rb
|
255
255
|
- lib/active_merchant/billing/gateways/maxipago.rb
|
256
|
+
- lib/active_merchant/billing/gateways/mercado_pago.rb
|
256
257
|
- lib/active_merchant/billing/gateways/merchant_e_solutions.rb
|
257
258
|
- lib/active_merchant/billing/gateways/merchant_one.rb
|
258
259
|
- lib/active_merchant/billing/gateways/merchant_partners.rb
|