activemerchant 1.104.0 → 1.105.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +22 -1
- data/README.md +1 -1
- data/lib/active_merchant/billing/gateways/authorize_net.rb +3 -2
- data/lib/active_merchant/billing/gateways/balanced.rb +4 -4
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +6 -10
- data/lib/active_merchant/billing/gateways/bpoint.rb +6 -4
- data/lib/active_merchant/billing/gateways/credorax.rb +22 -3
- data/lib/active_merchant/billing/gateways/decidir.rb +17 -1
- data/lib/active_merchant/billing/gateways/ebanx.rb +3 -2
- data/lib/active_merchant/billing/gateways/efsnet.rb +9 -9
- data/lib/active_merchant/billing/gateways/global_collect.rb +8 -8
- data/lib/active_merchant/billing/gateways/hps.rb +75 -25
- data/lib/active_merchant/billing/gateways/litle.rb +15 -15
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +15 -2
- data/lib/active_merchant/billing/gateways/monei.rb +18 -18
- data/lib/active_merchant/billing/gateways/moneris.rb +21 -21
- data/lib/active_merchant/billing/gateways/openpay.rb +3 -3
- data/lib/active_merchant/billing/gateways/orbital.rb +51 -51
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +3 -3
- data/lib/active_merchant/billing/gateways/paymentez.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +5 -5
- data/lib/active_merchant/billing/gateways/redsys.rb +2 -0
- data/lib/active_merchant/billing/gateways/secure_net.rb +3 -3
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +6 -6
- data/lib/active_merchant/billing/gateways/stripe.rb +13 -4
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +7 -14
- data/lib/active_merchant/billing/gateways/worldpay.rb +158 -69
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +1 -1
- data/lib/active_merchant/version.rb +1 -1
- metadata +2 -2
@@ -9,9 +9,9 @@ module ActiveMerchant #:nodoc:
|
|
9
9
|
|
10
10
|
ALLOWED_METHOD_STATES = %w[automatic manual].freeze
|
11
11
|
ALLOWED_CANCELLATION_REASONS = %w[duplicate fraudulent requested_by_customer abandoned].freeze
|
12
|
-
CREATE_INTENT_ATTRIBUTES = %i[description statement_descriptor receipt_email save_payment_method]
|
12
|
+
CREATE_INTENT_ATTRIBUTES = %i[description statement_descriptor_suffix statement_descriptor receipt_email save_payment_method]
|
13
13
|
CONFIRM_INTENT_ATTRIBUTES = %i[receipt_email return_url save_payment_method setup_future_usage off_session]
|
14
|
-
UPDATE_INTENT_ATTRIBUTES = %i[description statement_descriptor receipt_email setup_future_usage]
|
14
|
+
UPDATE_INTENT_ATTRIBUTES = %i[description statement_descriptor_suffix statement_descriptor receipt_email setup_future_usage]
|
15
15
|
DEFAULT_API_VERSION = '2019-05-16'
|
16
16
|
|
17
17
|
def create_intent(money, payment_method, options = {})
|
@@ -149,6 +149,11 @@ module ActiveMerchant #:nodoc:
|
|
149
149
|
|
150
150
|
private
|
151
151
|
|
152
|
+
def add_connected_account(post, options = {})
|
153
|
+
super(post, options)
|
154
|
+
post[:application_fee_amount] = options[:application_fee] if options[:application_fee]
|
155
|
+
end
|
156
|
+
|
152
157
|
def add_whitelisted_attribute(post, options, attribute)
|
153
158
|
post[attribute] = options[attribute] if options[attribute]
|
154
159
|
post
|
@@ -224,18 +229,6 @@ module ActiveMerchant #:nodoc:
|
|
224
229
|
post
|
225
230
|
end
|
226
231
|
|
227
|
-
def add_connected_account(post, options = {})
|
228
|
-
return unless options[:transfer_destination]
|
229
|
-
|
230
|
-
post[:transfer_data] = {}
|
231
|
-
post[:transfer_data][:destination] = options[:transfer_destination]
|
232
|
-
post[:transfer_data][:amount] = options[:transfer_amount] if options[:transfer_amount]
|
233
|
-
post[:on_behalf_of] = options[:on_behalf_of] if options[:on_behalf_of]
|
234
|
-
post[:transfer_group] = options[:transfer_group] if options[:transfer_group]
|
235
|
-
post[:application_fee_amount] = options[:application_fee] if options[:application_fee]
|
236
|
-
post
|
237
|
-
end
|
238
|
-
|
239
232
|
def add_billing_address(post, options = {})
|
240
233
|
return unless billing = options[:billing_address] || options[:address]
|
241
234
|
|
@@ -166,7 +166,7 @@ module ActiveMerchant #:nodoc:
|
|
166
166
|
xml = Builder::XmlMarkup.new :indent => 2
|
167
167
|
xml.instruct! :xml, :encoding => 'UTF-8'
|
168
168
|
xml.declare! :DOCTYPE, :paymentService, :PUBLIC, '-//WorldPay//DTD WorldPay PaymentService v1//EN', 'http://dtd.worldpay.com/paymentService_v1.dtd'
|
169
|
-
xml.
|
169
|
+
xml.paymentService 'version' => '1.4', 'merchantCode' => @options[:login] do
|
170
170
|
yield xml
|
171
171
|
end
|
172
172
|
xml.target!
|
@@ -174,8 +174,8 @@ module ActiveMerchant #:nodoc:
|
|
174
174
|
|
175
175
|
def build_order_modify_request(authorization)
|
176
176
|
build_request do |xml|
|
177
|
-
xml.
|
178
|
-
xml.
|
177
|
+
xml.modify do
|
178
|
+
xml.orderModification 'orderCode' => authorization do
|
179
179
|
yield xml
|
180
180
|
end
|
181
181
|
end
|
@@ -184,25 +184,26 @@ module ActiveMerchant #:nodoc:
|
|
184
184
|
|
185
185
|
def build_order_inquiry_request(authorization, options)
|
186
186
|
build_request do |xml|
|
187
|
-
xml.
|
188
|
-
xml.
|
187
|
+
xml.inquiry do
|
188
|
+
xml.orderInquiry 'orderCode' => authorization
|
189
189
|
end
|
190
190
|
end
|
191
191
|
end
|
192
192
|
|
193
193
|
def build_authorization_request(money, payment_method, options)
|
194
194
|
build_request do |xml|
|
195
|
-
xml.
|
196
|
-
xml.
|
195
|
+
xml.submit do
|
196
|
+
xml.order order_tag_attributes(options) do
|
197
197
|
xml.description(options[:description].blank? ? 'Purchase' : options[:description])
|
198
198
|
add_amount(xml, money, options)
|
199
199
|
if options[:order_content]
|
200
|
-
xml.
|
200
|
+
xml.orderContent do
|
201
201
|
xml.cdata! options[:order_content]
|
202
202
|
end
|
203
203
|
end
|
204
204
|
add_payment_method(xml, money, payment_method, options)
|
205
205
|
add_shopper(xml, options)
|
206
|
+
add_risk_data(xml, options[:risk_data]) if options[:risk_data]
|
206
207
|
add_hcg_additional_data(xml, options) if options[:hcg_additional_data]
|
207
208
|
add_instalments_data(xml, options) if options[:instalments]
|
208
209
|
add_moto_flag(xml, options) if options.dig(:metadata, :manual_entry)
|
@@ -219,23 +220,21 @@ module ActiveMerchant #:nodoc:
|
|
219
220
|
|
220
221
|
def build_capture_request(money, authorization, options)
|
221
222
|
build_order_modify_request(authorization) do |xml|
|
222
|
-
xml.
|
223
|
+
xml.capture do
|
223
224
|
time = Time.now
|
224
|
-
xml.
|
225
|
+
xml.date 'dayOfMonth' => time.day, 'month' => time.month, 'year'=> time.year
|
225
226
|
add_amount(xml, money, options)
|
226
227
|
end
|
227
228
|
end
|
228
229
|
end
|
229
230
|
|
230
231
|
def build_void_request(authorization, options)
|
231
|
-
build_order_modify_request(authorization)
|
232
|
-
xml.tag! 'cancel'
|
233
|
-
end
|
232
|
+
build_order_modify_request(authorization, &:cancel)
|
234
233
|
end
|
235
234
|
|
236
235
|
def build_refund_request(money, authorization, options)
|
237
236
|
build_order_modify_request(authorization) do |xml|
|
238
|
-
xml.
|
237
|
+
xml.refund do
|
239
238
|
add_amount(xml, money, options.merge(:debit_credit_indicator => 'credit'))
|
240
239
|
end
|
241
240
|
end
|
@@ -243,12 +242,12 @@ module ActiveMerchant #:nodoc:
|
|
243
242
|
|
244
243
|
def build_store_request(credit_card, options)
|
245
244
|
build_request do |xml|
|
246
|
-
xml.
|
247
|
-
xml.
|
245
|
+
xml.submit do
|
246
|
+
xml.paymentTokenCreate do
|
248
247
|
add_authenticated_shopper_id(xml, options)
|
249
|
-
xml.
|
250
|
-
xml.
|
251
|
-
xml.
|
248
|
+
xml.createToken
|
249
|
+
xml.paymentInstrument do
|
250
|
+
xml.cardDetails do
|
252
251
|
add_card(xml, credit_card, options)
|
253
252
|
end
|
254
253
|
end
|
@@ -258,11 +257,97 @@ module ActiveMerchant #:nodoc:
|
|
258
257
|
end
|
259
258
|
|
260
259
|
def add_additional_3ds_data(xml, options)
|
261
|
-
xml.
|
260
|
+
xml.additional3DSData 'dfReferenceId' => options[:session_id]
|
262
261
|
end
|
263
262
|
|
264
263
|
def add_3ds_exemption(xml, options)
|
265
|
-
xml.
|
264
|
+
xml.exemption 'type' => options[:exemption_type], 'placement' => options[:exemption_placement] || 'AUTHORISATION'
|
265
|
+
end
|
266
|
+
|
267
|
+
def add_risk_data(xml, risk_data)
|
268
|
+
xml.riskData do
|
269
|
+
add_authentication_risk_data(xml, risk_data[:authentication_risk_data])
|
270
|
+
add_shopper_account_risk_data(xml, risk_data[:shopper_account_risk_data])
|
271
|
+
add_transaction_risk_data(xml, risk_data[:transaction_risk_data])
|
272
|
+
end
|
273
|
+
end
|
274
|
+
|
275
|
+
def add_authentication_risk_data(xml, authentication_risk_data)
|
276
|
+
return unless authentication_risk_data
|
277
|
+
|
278
|
+
timestamp = authentication_risk_data.fetch(:authentication_date, {})
|
279
|
+
|
280
|
+
xml.authenticationRiskData('authenticationMethod' => authentication_risk_data[:authentication_method]) do
|
281
|
+
xml.authenticationTimestamp do
|
282
|
+
xml.date(
|
283
|
+
'dayOfMonth' => timestamp[:day_of_month],
|
284
|
+
'month' => timestamp[:month],
|
285
|
+
'year' => timestamp[:year],
|
286
|
+
'hour' => timestamp[:hour],
|
287
|
+
'minute' => timestamp[:minute],
|
288
|
+
'second' => timestamp[:second]
|
289
|
+
)
|
290
|
+
end
|
291
|
+
end
|
292
|
+
end
|
293
|
+
|
294
|
+
def add_shopper_account_risk_data(xml, shopper_account_risk_data)
|
295
|
+
return unless shopper_account_risk_data
|
296
|
+
|
297
|
+
data = {
|
298
|
+
'transactionsAttemptedLastDay' => shopper_account_risk_data[:transactions_attempted_last_day],
|
299
|
+
'transactionsAttemptedLastYear' => shopper_account_risk_data[:transactions_attempted_last_year],
|
300
|
+
'purchasesCompletedLastSixMonths' => shopper_account_risk_data[:purchases_completed_last_six_months],
|
301
|
+
'addCardAttemptsLastDay' => shopper_account_risk_data[:add_card_attempts_last_day],
|
302
|
+
'previousSuspiciousActivity' => shopper_account_risk_data[:previous_suspicious_activity],
|
303
|
+
'shippingNameMatchesAccountName' => shopper_account_risk_data[:shipping_name_matches_account_name],
|
304
|
+
'shopperAccountAgeIndicator' => shopper_account_risk_data[:shopper_account_age_indicator],
|
305
|
+
'shopperAccountChangeIndicator' => shopper_account_risk_data[:shopper_account_change_indicator],
|
306
|
+
'shopperAccountPasswordChangeIndicator' => shopper_account_risk_data[:shopper_account_password_change_indicator],
|
307
|
+
'shopperAccountShippingAddressUsageIndicator' => shopper_account_risk_data[:shopper_account_shipping_address_usage_indicator],
|
308
|
+
'shopperAccountPaymentAccountIndicator' => shopper_account_risk_data[:shopper_account_payment_account_indicator]
|
309
|
+
}.reject { |_k, v| v.nil? }
|
310
|
+
|
311
|
+
xml.shopperAccountRiskData(data) do
|
312
|
+
add_date_element(xml, 'shopperAccountCreationDate', shopper_account_risk_data[:shopper_account_creation_date])
|
313
|
+
add_date_element(xml, 'shopperAccountModificationDate', shopper_account_risk_data[:shopper_account_modification_date])
|
314
|
+
add_date_element(xml, 'shopperAccountPasswordChangeDate', shopper_account_risk_data[:shopper_account_password_change_date])
|
315
|
+
add_date_element(xml, 'shopperAccountShippingAddressFirstUseDate', shopper_account_risk_data[:shopper_account_shipping_address_first_use_date])
|
316
|
+
add_date_element(xml, 'shopperAccountPaymentAccountFirstUseDate', shopper_account_risk_data[:shopper_account_payment_account_first_use_date])
|
317
|
+
end
|
318
|
+
end
|
319
|
+
|
320
|
+
def add_transaction_risk_data(xml, transaction_risk_data)
|
321
|
+
return unless transaction_risk_data
|
322
|
+
|
323
|
+
data = {
|
324
|
+
'shippingMethod' => transaction_risk_data[:shipping_method],
|
325
|
+
'deliveryTimeframe' => transaction_risk_data[:delivery_timeframe],
|
326
|
+
'deliveryEmailAddress' => transaction_risk_data[:delivery_email_address],
|
327
|
+
'reorderingPreviousPurchases' => transaction_risk_data[:reordering_previous_purchases],
|
328
|
+
'preOrderPurchase' => transaction_risk_data[:pre_order_purchase],
|
329
|
+
'giftCardCount' => transaction_risk_data[:gift_card_count]
|
330
|
+
}.reject { |_k, v| v.nil? }
|
331
|
+
|
332
|
+
xml.transactionRiskData(data) do
|
333
|
+
xml.transactionRiskDataGiftCardAmount do
|
334
|
+
amount_hash = {
|
335
|
+
'value' => transaction_risk_data.dig(:transaction_risk_data_gift_card_amount, :value),
|
336
|
+
'currencyCode' => transaction_risk_data.dig(:transaction_risk_data_gift_card_amount, :currency),
|
337
|
+
'exponent' => transaction_risk_data.dig(:transaction_risk_data_gift_card_amount, :exponent)
|
338
|
+
}
|
339
|
+
debit_credit_indicator = transaction_risk_data.dig(:transaction_risk_data_gift_card_amount, :debit_credit_indicator)
|
340
|
+
amount_hash['debitCreditIndicator'] = debit_credit_indicator if debit_credit_indicator
|
341
|
+
xml.amount(amount_hash)
|
342
|
+
end
|
343
|
+
add_date_element(xml, 'transactionRiskDataPreOrderDate', transaction_risk_data[:transaction_risk_data_pre_order_date])
|
344
|
+
end
|
345
|
+
end
|
346
|
+
|
347
|
+
def add_date_element(xml, name, date)
|
348
|
+
xml.tag! name do
|
349
|
+
xml.date('dayOfMonth' => date[:day_of_month], 'month' => date[:month], 'year' => date[:year])
|
350
|
+
end
|
266
351
|
end
|
267
352
|
|
268
353
|
def add_amount(xml, money, options)
|
@@ -276,25 +361,25 @@ module ActiveMerchant #:nodoc:
|
|
276
361
|
|
277
362
|
amount_hash['debitCreditIndicator'] = options[:debit_credit_indicator] if options[:debit_credit_indicator]
|
278
363
|
|
279
|
-
xml.
|
364
|
+
xml.amount amount_hash
|
280
365
|
end
|
281
366
|
|
282
367
|
def add_payment_method(xml, amount, payment_method, options)
|
283
368
|
if options[:payment_type] == :pay_as_order
|
284
369
|
if options[:merchant_code]
|
285
|
-
xml.
|
370
|
+
xml.payAsOrder 'orderCode' => payment_method, 'merchantCode' => options[:merchant_code] do
|
286
371
|
add_amount(xml, amount, options)
|
287
372
|
end
|
288
373
|
else
|
289
|
-
xml.
|
374
|
+
xml.payAsOrder 'orderCode' => payment_method do
|
290
375
|
add_amount(xml, amount, options)
|
291
376
|
end
|
292
377
|
end
|
293
378
|
else
|
294
|
-
xml.
|
379
|
+
xml.paymentDetails credit_fund_transfer_attribute(options) do
|
295
380
|
if options[:payment_type] == :token
|
296
381
|
xml.tag! 'TOKEN-SSL', 'tokenScope' => options[:token_scope] do
|
297
|
-
xml.
|
382
|
+
xml.paymentTokenID options[:token_id]
|
298
383
|
end
|
299
384
|
else
|
300
385
|
xml.tag! card_code_for(payment_method) do
|
@@ -303,10 +388,10 @@ module ActiveMerchant #:nodoc:
|
|
303
388
|
end
|
304
389
|
add_stored_credential_options(xml, options)
|
305
390
|
if options[:ip] && options[:session_id]
|
306
|
-
xml.
|
391
|
+
xml.session 'shopperIPAddress' => options[:ip], 'id' => options[:session_id]
|
307
392
|
else
|
308
|
-
xml.
|
309
|
-
xml.
|
393
|
+
xml.session 'shopperIPAddress' => options[:ip] if options[:ip]
|
394
|
+
xml.session 'id' => options[:session_id] if options[:session_id]
|
310
395
|
end
|
311
396
|
|
312
397
|
if three_d_secure = options[:three_d_secure]
|
@@ -317,26 +402,30 @@ module ActiveMerchant #:nodoc:
|
|
317
402
|
end
|
318
403
|
|
319
404
|
def add_three_d_secure(three_d_secure, xml)
|
320
|
-
xml.
|
321
|
-
xml.
|
405
|
+
xml.info3DSecure do
|
406
|
+
xml.threeDSVersion three_d_secure[:version]
|
322
407
|
if three_d_secure[:version] =~ /^2/
|
323
|
-
xml.
|
408
|
+
xml.dsTransactionId three_d_secure[:ds_transaction_id]
|
324
409
|
else
|
325
|
-
xml.
|
410
|
+
xml.xid three_d_secure[:xid]
|
326
411
|
end
|
327
|
-
xml.
|
328
|
-
xml.
|
412
|
+
xml.cavv three_d_secure[:cavv]
|
413
|
+
xml.eci three_d_secure[:eci]
|
329
414
|
end
|
330
415
|
end
|
331
416
|
|
332
417
|
def add_card(xml, payment_method, options)
|
333
|
-
xml.
|
334
|
-
xml.
|
335
|
-
xml.
|
418
|
+
xml.cardNumber payment_method.number
|
419
|
+
xml.expiryDate do
|
420
|
+
xml.date(
|
421
|
+
'month' => format(payment_method.month, :two_digits),
|
422
|
+
'year' => format(payment_method.year, :four_digits)
|
423
|
+
)
|
336
424
|
end
|
337
425
|
|
338
|
-
|
339
|
-
xml.
|
426
|
+
card_holder_name = options[:execute_threed] && !options[:three_ds_version]&.start_with?('2') ? '3D' : payment_method.name
|
427
|
+
xml.cardHolderName card_holder_name
|
428
|
+
xml.cvc payment_method.verification_value
|
340
429
|
|
341
430
|
add_address(xml, (options[:billing_address] || options[:address]))
|
342
431
|
end
|
@@ -351,7 +440,7 @@ module ActiveMerchant #:nodoc:
|
|
351
440
|
|
352
441
|
def add_stored_credential_using_normalized_fields(xml, options)
|
353
442
|
if options[:stored_credential][:initial_transaction]
|
354
|
-
xml.
|
443
|
+
xml.storedCredentials 'usage' => 'FIRST'
|
355
444
|
else
|
356
445
|
reason = case options[:stored_credential][:reason_type]
|
357
446
|
when 'installment' then 'INSTALMENT'
|
@@ -359,8 +448,8 @@ module ActiveMerchant #:nodoc:
|
|
359
448
|
when 'unscheduled' then 'UNSCHEDULED'
|
360
449
|
end
|
361
450
|
|
362
|
-
xml.
|
363
|
-
xml.
|
451
|
+
xml.storedCredentials 'usage' => 'USED', 'merchantInitiatedReason' => reason do
|
452
|
+
xml.schemeTransactionIdentifier options[:stored_credential][:network_transaction_id] if options[:stored_credential][:network_transaction_id]
|
364
453
|
end
|
365
454
|
end
|
366
455
|
end
|
@@ -369,29 +458,29 @@ module ActiveMerchant #:nodoc:
|
|
369
458
|
return unless options[:stored_credential_usage]
|
370
459
|
|
371
460
|
if options[:stored_credential_initiated_reason]
|
372
|
-
xml.
|
373
|
-
xml.
|
461
|
+
xml.storedCredentials 'usage' => options[:stored_credential_usage], 'merchantInitiatedReason' => options[:stored_credential_initiated_reason] do
|
462
|
+
xml.schemeTransactionIdentifier options[:stored_credential_transaction_id] if options[:stored_credential_transaction_id]
|
374
463
|
end
|
375
464
|
else
|
376
|
-
xml.
|
465
|
+
xml.storedCredentials 'usage' => options[:stored_credential_usage]
|
377
466
|
end
|
378
467
|
end
|
379
468
|
|
380
469
|
def add_shopper(xml, options)
|
381
470
|
return unless options[:execute_threed] || options[:email] || options[:customer]
|
382
471
|
|
383
|
-
xml.
|
384
|
-
xml.
|
472
|
+
xml.shopper do
|
473
|
+
xml.shopperEmailAddress options[:email] if options[:email]
|
385
474
|
add_authenticated_shopper_id(xml, options)
|
386
|
-
xml.
|
387
|
-
xml.
|
388
|
-
xml.
|
475
|
+
xml.browser do
|
476
|
+
xml.acceptHeader options[:accept_header]
|
477
|
+
xml.userAgentHeader options[:user_agent]
|
389
478
|
end
|
390
479
|
end
|
391
480
|
end
|
392
481
|
|
393
482
|
def add_authenticated_shopper_id(xml, options)
|
394
|
-
xml.
|
483
|
+
xml.authenticatedShopperID options[:customer] if options[:customer]
|
395
484
|
end
|
396
485
|
|
397
486
|
def add_address(xml, address)
|
@@ -399,40 +488,40 @@ module ActiveMerchant #:nodoc:
|
|
399
488
|
|
400
489
|
address = address_with_defaults(address)
|
401
490
|
|
402
|
-
xml.
|
403
|
-
xml.
|
491
|
+
xml.cardAddress do
|
492
|
+
xml.address do
|
404
493
|
if m = /^\s*([^\s]+)\s+(.+)$/.match(address[:name])
|
405
|
-
xml.
|
406
|
-
xml.
|
494
|
+
xml.firstName m[1]
|
495
|
+
xml.lastName m[2]
|
407
496
|
end
|
408
|
-
xml.
|
409
|
-
xml.
|
410
|
-
xml.
|
411
|
-
xml.
|
412
|
-
xml.
|
413
|
-
xml.
|
414
|
-
xml.
|
497
|
+
xml.address1 address[:address1]
|
498
|
+
xml.address2 address[:address2] if address[:address2]
|
499
|
+
xml.postalCode address[:zip]
|
500
|
+
xml.city address[:city]
|
501
|
+
xml.state address[:state]
|
502
|
+
xml.countryCode address[:country]
|
503
|
+
xml.telephoneNumber address[:phone] if address[:phone]
|
415
504
|
end
|
416
505
|
end
|
417
506
|
end
|
418
507
|
|
419
508
|
def add_hcg_additional_data(xml, options)
|
420
|
-
xml.
|
509
|
+
xml.hcgAdditionalData do
|
421
510
|
options[:hcg_additional_data].each do |k, v|
|
422
|
-
xml.
|
511
|
+
xml.param({name: k.to_s}, v)
|
423
512
|
end
|
424
513
|
end
|
425
514
|
end
|
426
515
|
|
427
516
|
def add_instalments_data(xml, options)
|
428
|
-
xml.
|
429
|
-
xml.
|
430
|
-
xml.
|
517
|
+
xml.thirdPartyData do
|
518
|
+
xml.instalments options[:instalments]
|
519
|
+
xml.cpf options[:cpf] if options[:cpf]
|
431
520
|
end
|
432
521
|
end
|
433
522
|
|
434
523
|
def add_moto_flag(xml, options)
|
435
|
-
xml.
|
524
|
+
xml.dynamicInteractionType 'type' => 'MOTO'
|
436
525
|
end
|
437
526
|
|
438
527
|
def address_with_defaults(address)
|
@@ -104,7 +104,7 @@ module ActiveMerchant #:nodoc:
|
|
104
104
|
'city'=>options[:billing_address]&&options[:billing_address][:city] ? options[:billing_address][:city] : '',
|
105
105
|
'state'=>options[:billing_address]&&options[:billing_address][:state] ? options[:billing_address][:state] : '',
|
106
106
|
'countryCode'=>options[:billing_address]&&options[:billing_address][:country] ? options[:billing_address][:country] : ''
|
107
|
-
|
107
|
+
},
|
108
108
|
'customerOrderCode' => options[:order_id],
|
109
109
|
'orderType' => 'ECOM',
|
110
110
|
'authorizeOnly' => options[:authorizeOnly] ? true : false
|