activemerchant 1.114.0 → 1.116.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +45 -0
  3. data/lib/active_merchant.rb +1 -1
  4. data/lib/active_merchant/billing/avs_result.rb +1 -1
  5. data/lib/active_merchant/billing/compatibility.rb +3 -3
  6. data/lib/active_merchant/billing/credit_card_methods.rb +5 -5
  7. data/lib/active_merchant/billing/gateways/adyen.rb +23 -13
  8. data/lib/active_merchant/billing/gateways/allied_wallet.rb +7 -7
  9. data/lib/active_merchant/billing/gateways/authorize_net.rb +13 -11
  10. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -4
  11. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +1 -1
  12. data/lib/active_merchant/billing/gateways/axcessms.rb +8 -9
  13. data/lib/active_merchant/billing/gateways/balanced.rb +4 -3
  14. data/lib/active_merchant/billing/gateways/bambora_apac.rb +7 -7
  15. data/lib/active_merchant/billing/gateways/bank_frick.rb +7 -7
  16. data/lib/active_merchant/billing/gateways/banwire.rb +1 -1
  17. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +6 -4
  18. data/lib/active_merchant/billing/gateways/beanstream.rb +3 -3
  19. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +4 -5
  20. data/lib/active_merchant/billing/gateways/blue_pay.rb +2 -3
  21. data/lib/active_merchant/billing/gateways/blue_snap.rb +19 -17
  22. data/lib/active_merchant/billing/gateways/bogus.rb +19 -19
  23. data/lib/active_merchant/billing/gateways/borgun.rb +11 -11
  24. data/lib/active_merchant/billing/gateways/bpoint.rb +8 -8
  25. data/lib/active_merchant/billing/gateways/braintree.rb +1 -1
  26. data/lib/active_merchant/billing/gateways/braintree_blue.rb +7 -10
  27. data/lib/active_merchant/billing/gateways/bridge_pay.rb +7 -7
  28. data/lib/active_merchant/billing/gateways/cams.rb +8 -8
  29. data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
  30. data/lib/active_merchant/billing/gateways/card_save.rb +1 -1
  31. data/lib/active_merchant/billing/gateways/card_stream.rb +2 -2
  32. data/lib/active_merchant/billing/gateways/cardknox.rb +7 -7
  33. data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
  34. data/lib/active_merchant/billing/gateways/cecabank.rb +5 -5
  35. data/lib/active_merchant/billing/gateways/cenpos.rb +10 -10
  36. data/lib/active_merchant/billing/gateways/checkout.rb +2 -2
  37. data/lib/active_merchant/billing/gateways/checkout_v2.rb +16 -19
  38. data/lib/active_merchant/billing/gateways/clearhaus.rb +7 -7
  39. data/lib/active_merchant/billing/gateways/commercegate.rb +1 -1
  40. data/lib/active_merchant/billing/gateways/conekta.rb +2 -2
  41. data/lib/active_merchant/billing/gateways/creditcall.rb +10 -10
  42. data/lib/active_merchant/billing/gateways/credorax.rb +9 -9
  43. data/lib/active_merchant/billing/gateways/ct_payment.rb +10 -10
  44. data/lib/active_merchant/billing/gateways/culqi.rb +9 -9
  45. data/lib/active_merchant/billing/gateways/cyber_source.rb +30 -31
  46. data/lib/active_merchant/billing/gateways/d_local.rb +11 -11
  47. data/lib/active_merchant/billing/gateways/data_cash.rb +2 -3
  48. data/lib/active_merchant/billing/gateways/decidir.rb +9 -8
  49. data/lib/active_merchant/billing/gateways/dibs.rb +8 -8
  50. data/lib/active_merchant/billing/gateways/digitzs.rb +5 -5
  51. data/lib/active_merchant/billing/gateways/ebanx.rb +9 -9
  52. data/lib/active_merchant/billing/gateways/efsnet.rb +2 -3
  53. data/lib/active_merchant/billing/gateways/elavon.rb +251 -232
  54. data/lib/active_merchant/billing/gateways/element.rb +8 -8
  55. data/lib/active_merchant/billing/gateways/evo_ca.rb +5 -6
  56. data/lib/active_merchant/billing/gateways/eway.rb +3 -4
  57. data/lib/active_merchant/billing/gateways/eway_managed.rb +6 -7
  58. data/lib/active_merchant/billing/gateways/eway_rapid.rb +6 -6
  59. data/lib/active_merchant/billing/gateways/exact.rb +8 -9
  60. data/lib/active_merchant/billing/gateways/ezic.rb +7 -7
  61. data/lib/active_merchant/billing/gateways/fat_zebra.rb +4 -4
  62. data/lib/active_merchant/billing/gateways/federated_canada.rb +2 -3
  63. data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
  64. data/lib/active_merchant/billing/gateways/first_pay.rb +6 -6
  65. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +7 -7
  66. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +4 -4
  67. data/lib/active_merchant/billing/gateways/flo2cash.rb +8 -8
  68. data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
  69. data/lib/active_merchant/billing/gateways/forte.rb +14 -8
  70. data/lib/active_merchant/billing/gateways/global_collect.rb +10 -10
  71. data/lib/active_merchant/billing/gateways/global_transport.rb +7 -7
  72. data/lib/active_merchant/billing/gateways/hdfc.rb +9 -9
  73. data/lib/active_merchant/billing/gateways/hps.rb +7 -7
  74. data/lib/active_merchant/billing/gateways/iats_payments.rb +9 -4
  75. data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
  76. data/lib/active_merchant/billing/gateways/inspire.rb +3 -4
  77. data/lib/active_merchant/billing/gateways/instapay.rb +1 -2
  78. data/lib/active_merchant/billing/gateways/ipp.rb +5 -5
  79. data/lib/active_merchant/billing/gateways/iridium.rb +14 -15
  80. data/lib/active_merchant/billing/gateways/iveri.rb +7 -7
  81. data/lib/active_merchant/billing/gateways/ixopay.rb +7 -7
  82. data/lib/active_merchant/billing/gateways/jetpay.rb +1 -2
  83. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +4 -5
  84. data/lib/active_merchant/billing/gateways/kushki.rb +6 -6
  85. data/lib/active_merchant/billing/gateways/latitude19.rb +14 -14
  86. data/lib/active_merchant/billing/gateways/linkpoint.rb +4 -5
  87. data/lib/active_merchant/billing/gateways/litle.rb +11 -11
  88. data/lib/active_merchant/billing/gateways/mastercard.rb +10 -10
  89. data/lib/active_merchant/billing/gateways/mercado_pago.rb +7 -7
  90. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +1 -2
  91. data/lib/active_merchant/billing/gateways/merchant_one.rb +1 -1
  92. data/lib/active_merchant/billing/gateways/merchant_partners.rb +10 -10
  93. data/lib/active_merchant/billing/gateways/merchant_ware.rb +5 -7
  94. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +4 -6
  95. data/lib/active_merchant/billing/gateways/mercury.rb +4 -4
  96. data/lib/active_merchant/billing/gateways/metrics_global.rb +4 -5
  97. data/lib/active_merchant/billing/gateways/micropayment.rb +8 -8
  98. data/lib/active_merchant/billing/gateways/migs.rb +3 -4
  99. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +2 -4
  100. data/lib/active_merchant/billing/gateways/monei.rb +7 -7
  101. data/lib/active_merchant/billing/gateways/moneris.rb +4 -3
  102. data/lib/active_merchant/billing/gateways/money_movers.rb +2 -3
  103. data/lib/active_merchant/billing/gateways/mundipagg.rb +37 -10
  104. data/lib/active_merchant/billing/gateways/nab_transact.rb +2 -4
  105. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +7 -7
  106. data/lib/active_merchant/billing/gateways/net_registry.rb +1 -2
  107. data/lib/active_merchant/billing/gateways/netaxept.rb +6 -6
  108. data/lib/active_merchant/billing/gateways/netbanx.rb +8 -8
  109. data/lib/active_merchant/billing/gateways/netbilling.rb +4 -5
  110. data/lib/active_merchant/billing/gateways/network_merchants.rb +2 -3
  111. data/lib/active_merchant/billing/gateways/nmi.rb +21 -7
  112. data/lib/active_merchant/billing/gateways/ogone.rb +3 -3
  113. data/lib/active_merchant/billing/gateways/omise.rb +13 -13
  114. data/lib/active_merchant/billing/gateways/openpay.rb +3 -4
  115. data/lib/active_merchant/billing/gateways/opp.rb +9 -9
  116. data/lib/active_merchant/billing/gateways/optimal_payment.rb +2 -3
  117. data/lib/active_merchant/billing/gateways/orbital.rb +61 -66
  118. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +3 -4
  119. data/lib/active_merchant/billing/gateways/pagarme.rb +8 -8
  120. data/lib/active_merchant/billing/gateways/pago_facil.rb +2 -2
  121. data/lib/active_merchant/billing/gateways/pay_conex.rb +8 -8
  122. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +6 -7
  123. data/lib/active_merchant/billing/gateways/pay_hub.rb +7 -8
  124. data/lib/active_merchant/billing/gateways/pay_junction.rb +2 -3
  125. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +9 -9
  126. data/lib/active_merchant/billing/gateways/pay_secure.rb +2 -3
  127. data/lib/active_merchant/billing/gateways/paybox_direct.rb +23 -1
  128. data/lib/active_merchant/billing/gateways/payeezy.rb +9 -9
  129. data/lib/active_merchant/billing/gateways/payex.rb +6 -7
  130. data/lib/active_merchant/billing/gateways/payflow.rb +1 -1
  131. data/lib/active_merchant/billing/gateways/payment_express.rb +1 -2
  132. data/lib/active_merchant/billing/gateways/paymentez.rb +5 -5
  133. data/lib/active_merchant/billing/gateways/paymill.rb +7 -7
  134. data/lib/active_merchant/billing/gateways/paypal_express.rb +1 -1
  135. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
  136. data/lib/active_merchant/billing/gateways/payscout.rb +1 -2
  137. data/lib/active_merchant/billing/gateways/paystation.rb +3 -4
  138. data/lib/active_merchant/billing/gateways/payu_in.rb +3 -3
  139. data/lib/active_merchant/billing/gateways/payu_latam.rb +17 -10
  140. data/lib/active_merchant/billing/gateways/payway.rb +8 -9
  141. data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -2
  142. data/lib/active_merchant/billing/gateways/pro_pay.rb +8 -8
  143. data/lib/active_merchant/billing/gateways/psigate.rb +2 -3
  144. data/lib/active_merchant/billing/gateways/psl_card.rb +1 -2
  145. data/lib/active_merchant/billing/gateways/qbms.rb +1 -2
  146. data/lib/active_merchant/billing/gateways/quantum.rb +1 -2
  147. data/lib/active_merchant/billing/gateways/quickbooks.rb +1 -1
  148. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +3 -4
  149. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +1 -2
  150. data/lib/active_merchant/billing/gateways/qvalent.rb +8 -8
  151. data/lib/active_merchant/billing/gateways/realex.rb +1 -1
  152. data/lib/active_merchant/billing/gateways/redsys.rb +4 -4
  153. data/lib/active_merchant/billing/gateways/s5.rb +7 -7
  154. data/lib/active_merchant/billing/gateways/safe_charge.rb +12 -12
  155. data/lib/active_merchant/billing/gateways/sage.rb +3 -5
  156. data/lib/active_merchant/billing/gateways/sage_pay.rb +2 -3
  157. data/lib/active_merchant/billing/gateways/sallie_mae.rb +1 -2
  158. data/lib/active_merchant/billing/gateways/secure_net.rb +1 -2
  159. data/lib/active_merchant/billing/gateways/secure_pay.rb +3 -4
  160. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +2 -4
  161. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +1 -2
  162. data/lib/active_merchant/billing/gateways/securion_pay.rb +5 -6
  163. data/lib/active_merchant/billing/gateways/skip_jack.rb +2 -3
  164. data/lib/active_merchant/billing/gateways/smart_ps.rb +5 -6
  165. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +7 -7
  166. data/lib/active_merchant/billing/gateways/spreedly_core.rb +6 -6
  167. data/lib/active_merchant/billing/gateways/stripe.rb +9 -9
  168. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +9 -0
  169. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +3 -4
  170. data/lib/active_merchant/billing/gateways/telr.rb +8 -8
  171. data/lib/active_merchant/billing/gateways/trans_first.rb +2 -2
  172. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +12 -12
  173. data/lib/active_merchant/billing/gateways/transact_pro.rb +9 -9
  174. data/lib/active_merchant/billing/gateways/trust_commerce.rb +1 -2
  175. data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -1
  176. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +32 -32
  177. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +3 -4
  178. data/lib/active_merchant/billing/gateways/vanco.rb +3 -3
  179. data/lib/active_merchant/billing/gateways/verifi.rb +1 -2
  180. data/lib/active_merchant/billing/gateways/viaklix.rb +1 -2
  181. data/lib/active_merchant/billing/gateways/visanet_peru.rb +10 -10
  182. data/lib/active_merchant/billing/gateways/webpay.rb +2 -2
  183. data/lib/active_merchant/billing/gateways/wepay.rb +3 -2
  184. data/lib/active_merchant/billing/gateways/wirecard.rb +1 -2
  185. data/lib/active_merchant/billing/gateways/worldpay.rb +12 -8
  186. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +14 -16
  187. data/lib/active_merchant/billing/gateways/worldpay_us.rb +7 -7
  188. data/lib/active_merchant/billing/response.rb +1 -1
  189. data/lib/active_merchant/country.rb +1 -1
  190. data/lib/active_merchant/network_connection_retries.rb +2 -2
  191. data/lib/active_merchant/post_data.rb +1 -1
  192. data/lib/active_merchant/posts_data.rb +1 -1
  193. data/lib/active_merchant/version.rb +1 -1
  194. data/lib/support/ssl_verify.rb +2 -2
  195. data/lib/support/ssl_version.rb +2 -2
  196. metadata +2 -2
@@ -22,12 +22,12 @@ module ActiveMerchant #:nodoc:
22
22
  self.homepage_url = 'https://processing.paysafe.com/'
23
23
  self.display_name = 'Netbanx by PaySafe'
24
24
 
25
- def initialize(options={})
25
+ def initialize(options = {})
26
26
  requires!(options, :account_number, :api_key)
27
27
  super
28
28
  end
29
29
 
30
- def purchase(money, payment, options={})
30
+ def purchase(money, payment, options = {})
31
31
  # Do a Verification with AVS prior to purchase
32
32
  verification_response = verify(payment, options)
33
33
  return verification_response if verification_response.message != 'OK'
@@ -40,7 +40,7 @@ module ActiveMerchant #:nodoc:
40
40
  commit(:post, 'auths', post)
41
41
  end
42
42
 
43
- def authorize(money, payment, options={})
43
+ def authorize(money, payment, options = {})
44
44
  # Do a Verification with AVS prior to Auth + Settle
45
45
  verification_response = verify(payment, options)
46
46
  return verification_response if verification_response.message != 'OK'
@@ -52,14 +52,14 @@ module ActiveMerchant #:nodoc:
52
52
  commit(:post, 'auths', post)
53
53
  end
54
54
 
55
- def capture(money, authorization, options={})
55
+ def capture(money, authorization, options = {})
56
56
  post = {}
57
57
  add_invoice(post, money, options)
58
58
 
59
59
  commit(:post, "auths/#{authorization}/settlements", post)
60
60
  end
61
61
 
62
- def refund(money, authorization, options={})
62
+ def refund(money, authorization, options = {})
63
63
  # If the transactions that are pending, API call needs to be Cancellation
64
64
  settlement_data = get_settlement(authorization)
65
65
  return settlement_data if settlement_data.message != 'OK'
@@ -86,14 +86,14 @@ module ActiveMerchant #:nodoc:
86
86
  commit(:get, "settlements/#{authorization}", post)
87
87
  end
88
88
 
89
- def void(authorization, options={})
89
+ def void(authorization, options = {})
90
90
  post = {}
91
91
  add_order_id(post, options)
92
92
 
93
93
  commit(:post, "auths/#{authorization}/voidauths", post)
94
94
  end
95
95
 
96
- def verify(credit_card, options={})
96
+ def verify(credit_card, options = {})
97
97
  post = {}
98
98
  add_payment(post, credit_card, options)
99
99
  add_order_id(post, options)
@@ -103,7 +103,7 @@ module ActiveMerchant #:nodoc:
103
103
 
104
104
  # note: when passing options[:customer] we only attempt to add the
105
105
  # card to the profile_id passed as the options[:customer]
106
- def store(credit_card, options={})
106
+ def store(credit_card, options = {})
107
107
  # locale can only be one of en_US, fr_CA, en_GB
108
108
  requires!(options, :locale)
109
109
  post = {}
@@ -196,13 +196,12 @@ module ActiveMerchant #:nodoc:
196
196
  Response.new(success?(response), message_from(response), response,
197
197
  test: test_response?(response),
198
198
  authorization: response[:trans_id],
199
- avs_result: { code: response[:avs_code]},
200
- cvv_result: response[:cvv2_code]
201
- )
199
+ avs_result: { code: response[:avs_code] },
200
+ cvv_result: response[:cvv2_code])
202
201
  rescue ActiveMerchant::ResponseError => e
203
202
  raise unless e.response.code =~ /^[67]\d\d$/
204
203
 
205
- return Response.new(false, e.response.message, {status_code: e.response.code}, test: test?)
204
+ return Response.new(false, e.response.message, { status_code: e.response.code }, test: test?)
206
205
  end
207
206
 
208
207
  def test_response?(response)
@@ -223,7 +222,7 @@ module ActiveMerchant #:nodoc:
223
222
  parameters[:pay_type] = 'C'
224
223
  parameters[:tran_type] = TRANSACTIONS[action]
225
224
 
226
- parameters.reject { |k, v| v.blank? }.collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
225
+ parameters.reject { |_k, v| v.blank? }.collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
227
226
  end
228
227
  end
229
228
  end
@@ -203,9 +203,8 @@ module ActiveMerchant #:nodoc:
203
203
  Response.new(success, raw['responsetext'], raw,
204
204
  test: test?,
205
205
  authorization: authorization,
206
- avs_result: { code: raw['avsresponse']},
207
- cvv_result: raw['cvvresponse']
208
- )
206
+ avs_result: { code: raw['avsresponse'] },
207
+ cvv_result: raw['cvvresponse'])
209
208
  end
210
209
 
211
210
  def build_request(action, parameters)
@@ -27,7 +27,7 @@ module ActiveMerchant #:nodoc:
27
27
  super
28
28
  end
29
29
 
30
- def purchase(amount, payment_method, options={})
30
+ def purchase(amount, payment_method, options = {})
31
31
  post = {}
32
32
  add_invoice(post, amount, options)
33
33
  add_payment_method(post, payment_method, options)
@@ -36,11 +36,12 @@ module ActiveMerchant #:nodoc:
36
36
  add_vendor_data(post, options)
37
37
  add_merchant_defined_fields(post, options)
38
38
  add_level3_fields(post, options)
39
+ add_three_d_secure(post, options)
39
40
 
40
41
  commit('sale', post)
41
42
  end
42
43
 
43
- def authorize(amount, payment_method, options={})
44
+ def authorize(amount, payment_method, options = {})
44
45
  post = {}
45
46
  add_invoice(post, amount, options)
46
47
  add_payment_method(post, payment_method, options)
@@ -49,11 +50,12 @@ module ActiveMerchant #:nodoc:
49
50
  add_vendor_data(post, options)
50
51
  add_merchant_defined_fields(post, options)
51
52
  add_level3_fields(post, options)
53
+ add_three_d_secure(post, options)
52
54
 
53
55
  commit('auth', post)
54
56
  end
55
57
 
56
- def capture(amount, authorization, options={})
58
+ def capture(amount, authorization, options = {})
57
59
  post = {}
58
60
  add_invoice(post, amount, options)
59
61
  add_reference(post, authorization)
@@ -62,7 +64,7 @@ module ActiveMerchant #:nodoc:
62
64
  commit('capture', post)
63
65
  end
64
66
 
65
- def void(authorization, options={})
67
+ def void(authorization, options = {})
66
68
  post = {}
67
69
  add_reference(post, authorization)
68
70
  add_payment_type(post, authorization)
@@ -70,7 +72,7 @@ module ActiveMerchant #:nodoc:
70
72
  commit('void', post)
71
73
  end
72
74
 
73
- def refund(amount, authorization, options={})
75
+ def refund(amount, authorization, options = {})
74
76
  post = {}
75
77
  add_invoice(post, amount, options)
76
78
  add_reference(post, authorization)
@@ -79,7 +81,7 @@ module ActiveMerchant #:nodoc:
79
81
  commit('refund', post)
80
82
  end
81
83
 
82
- def credit(amount, payment_method, options={})
84
+ def credit(amount, payment_method, options = {})
83
85
  post = {}
84
86
  add_invoice(post, amount, options)
85
87
  add_payment_method(post, payment_method, options)
@@ -90,7 +92,7 @@ module ActiveMerchant #:nodoc:
90
92
  commit('credit', post)
91
93
  end
92
94
 
93
- def verify(payment_method, options={})
95
+ def verify(payment_method, options = {})
94
96
  post = {}
95
97
  add_payment_method(post, payment_method, options)
96
98
  add_customer_data(post, options)
@@ -248,6 +250,18 @@ module ActiveMerchant #:nodoc:
248
250
  end
249
251
  end
250
252
 
253
+ def add_three_d_secure(post, options)
254
+ return unless options[:three_d_secure]
255
+
256
+ if (three_d_secure = options[:three_d_secure])
257
+ post[:eci] = three_d_secure[:eci]
258
+ post[:cavv] = three_d_secure[:cavv]
259
+ post[:xid] = three_d_secure[:xid]
260
+ post[:three_ds_version] = three_d_secure[:version]
261
+ post[:directory_server_id] = three_d_secure[:ds_transaction_id]
262
+ end
263
+ end
264
+
251
265
  def add_reference(post, authorization)
252
266
  transaction_id, = split_authorization(authorization)
253
267
  post[:transactionid] = transaction_id
@@ -204,7 +204,7 @@ module ActiveMerchant #:nodoc:
204
204
  perform_reference_credit(money, reference, options)
205
205
  end
206
206
 
207
- def verify(credit_card, options={})
207
+ def verify(credit_card, options = {})
208
208
  MultiResponse.run(:use_first_response) do |r|
209
209
  r.process { authorize(100, credit_card, options) }
210
210
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -432,9 +432,9 @@ module ActiveMerchant #:nodoc:
432
432
  raise "Unknown signature algorithm #{algorithm}"
433
433
  end
434
434
 
435
- filtered_params = signed_parameters.select { |k, v| !v.blank? }
435
+ filtered_params = signed_parameters.select { |_k, v| !v.blank? }
436
436
  sha_encryptor.hexdigest(
437
- filtered_params.sort_by { |k, v| k.upcase }.map { |k, v| "#{k.upcase}=#{v}#{secret}" }.join('')
437
+ filtered_params.sort_by { |k, _v| k.upcase }.map { |k, v| "#{k.upcase}=#{v}#{secret}" }.join('')
438
438
  ).upcase
439
439
  end
440
440
 
@@ -46,7 +46,7 @@ module ActiveMerchant #:nodoc:
46
46
  # * <tt>:api_version</tt> -- Omise's API Version (OPTIONAL), default version is '2014-07-27'
47
47
  # See version at page https://dashboard.omise.co/api-version/edit
48
48
 
49
- def initialize(options={})
49
+ def initialize(options = {})
50
50
  requires!(options, :public_key, :secret_key)
51
51
  @public_key = options[:public_key]
52
52
  @secret_key = options[:secret_key]
@@ -79,7 +79,7 @@ module ActiveMerchant #:nodoc:
79
79
  #
80
80
  # purchase(money, nil, { :customer_id => customer_id })
81
81
 
82
- def purchase(money, payment_method, options={})
82
+ def purchase(money, payment_method, options = {})
83
83
  create_charge(money, payment_method, options)
84
84
  end
85
85
 
@@ -91,7 +91,7 @@ module ActiveMerchant #:nodoc:
91
91
  # * <tt>payment_method</tt> -- The CreditCard object
92
92
  # * <tt>options</tt> -- An optional parameters, such as token or capture
93
93
 
94
- def authorize(money, payment_method, options={})
94
+ def authorize(money, payment_method, options = {})
95
95
  options[:capture] = 'false'
96
96
  create_charge(money, payment_method, options)
97
97
  end
@@ -104,7 +104,7 @@ module ActiveMerchant #:nodoc:
104
104
  # * <tt>charge_id</tt> -- The CreditCard object
105
105
  # * <tt>options</tt> -- An optional parameters, such as token or capture
106
106
 
107
- def capture(money, charge_id, options={})
107
+ def capture(money, charge_id, options = {})
108
108
  post = {}
109
109
  add_amount(post, money, options)
110
110
  commit(:post, "charges/#{CGI.escape(charge_id)}/capture", post, options)
@@ -118,7 +118,7 @@ module ActiveMerchant #:nodoc:
118
118
  # * <tt>charge_id</tt> -- The CreditCard object
119
119
  # * <tt>options</tt> -- An optional parameters, such as token or capture
120
120
 
121
- def refund(money, charge_id, options={})
121
+ def refund(money, charge_id, options = {})
122
122
  options[:amount] = money if money
123
123
  commit(:post, "charges/#{CGI.escape(charge_id)}/refunds", options)
124
124
  end
@@ -132,7 +132,7 @@ module ActiveMerchant #:nodoc:
132
132
  # 'email' (A customer email)
133
133
  # 'description' (A customer description)
134
134
 
135
- def store(payment_method, options={})
135
+ def store(payment_method, options = {})
136
136
  post, card_params = {}, {}
137
137
  add_customer_data(post, options)
138
138
  add_token(card_params, payment_method, options)
@@ -145,7 +145,7 @@ module ActiveMerchant #:nodoc:
145
145
  #
146
146
  # * <tt>customer_id</tt> -- The Customer identifier (REQUIRED).
147
147
 
148
- def unstore(customer_id, options={})
148
+ def unstore(customer_id, options = {})
149
149
  commit(:delete, "customers/#{CGI.escape(customer_id)}")
150
150
  end
151
151
 
@@ -178,7 +178,7 @@ module ActiveMerchant #:nodoc:
178
178
  commit(:post, 'charges', post, options)
179
179
  end
180
180
 
181
- def headers(options={})
181
+ def headers(options = {})
182
182
  key = options[:key] || @secret_key
183
183
  {
184
184
  'Content-Type' => 'application/json;utf-8',
@@ -197,7 +197,7 @@ module ActiveMerchant #:nodoc:
197
197
  parameters.present? ? parameters.to_json : nil
198
198
  end
199
199
 
200
- def https_request(method, endpoint, parameters=nil, options={})
200
+ def https_request(method, endpoint, parameters = nil, options = {})
201
201
  raw_response = response = nil
202
202
  begin
203
203
  raw_response = ssl_request(method, url_for(endpoint), post_data(parameters), headers(options))
@@ -221,7 +221,7 @@ module ActiveMerchant #:nodoc:
221
221
  { message: msg }
222
222
  end
223
223
 
224
- def commit(method, endpoint, params=nil, options={})
224
+ def commit(method, endpoint, params = nil, options = {})
225
225
  response = https_request(method, endpoint, params, options)
226
226
  Response.new(
227
227
  successful?(response),
@@ -284,7 +284,7 @@ module ActiveMerchant #:nodoc:
284
284
  commit(:post, 'tokens', post, { key: @public_key })
285
285
  end
286
286
 
287
- def add_token(post, credit_card, options={})
287
+ def add_token(post, credit_card, options = {})
288
288
  if options[:token_id].present?
289
289
  post[:card] = options[:token_id]
290
290
  else
@@ -304,11 +304,11 @@ module ActiveMerchant #:nodoc:
304
304
  post[:card] = card
305
305
  end
306
306
 
307
- def add_customer(post, options={})
307
+ def add_customer(post, options = {})
308
308
  post[:customer] = options[:customer_id] if options[:customer_id]
309
309
  end
310
310
 
311
- def add_customer_data(post, options={})
311
+ def add_customer_data(post, options = {})
312
312
  post[:description] = options[:description] if options[:description]
313
313
  post[:email] = options[:email] if options[:email]
314
314
  end
@@ -116,7 +116,7 @@ module ActiveMerchant #:nodoc:
116
116
  post[:device_session_id] = options[:device_session_id]
117
117
  post[:currency] = (options[:currency] || currency(money)).upcase
118
118
  post[:use_card_points] = options[:use_card_points] if options[:use_card_points]
119
- post[:payment_plan] = {payments: options[:payments]} if options[:payments]
119
+ post[:payment_plan] = { payments: options[:payments] } if options[:payments]
120
120
  add_creditcard(post, creditcard, options)
121
121
  post
122
122
  end
@@ -188,11 +188,10 @@ module ActiveMerchant #:nodoc:
188
188
  (success ? response['error_code'] : response['description']),
189
189
  response,
190
190
  test: test?,
191
- authorization: response['id']
192
- )
191
+ authorization: response['id'])
193
192
  end
194
193
 
195
- def http_request(method, resource, parameters={}, options={})
194
+ def http_request(method, resource, parameters = {}, options = {})
196
195
  url = (test? ? self.test_url : self.live_url) + @merchant_id + '/' + resource
197
196
  raw_response = nil
198
197
  begin
@@ -117,39 +117,39 @@ module ActiveMerchant #:nodoc:
117
117
  self.homepage_url = 'https://docs.oppwa.com'
118
118
  self.display_name = 'Open Payment Platform'
119
119
 
120
- def initialize(options={})
120
+ def initialize(options = {})
121
121
  requires!(options, :access_token, :entity_id)
122
122
  super
123
123
  end
124
124
 
125
- def purchase(money, payment, options={})
125
+ def purchase(money, payment, options = {})
126
126
  # debit
127
127
  options[:registrationId] = payment if payment.is_a?(String)
128
128
  execute_dbpa(options[:risk_workflow] ? 'PA.CP' : 'DB',
129
129
  money, payment, options)
130
130
  end
131
131
 
132
- def authorize(money, payment, options={})
132
+ def authorize(money, payment, options = {})
133
133
  # preauthorization PA
134
134
  execute_dbpa('PA', money, payment, options)
135
135
  end
136
136
 
137
- def capture(money, authorization, options={})
137
+ def capture(money, authorization, options = {})
138
138
  # capture CP
139
139
  execute_referencing('CP', money, authorization, options)
140
140
  end
141
141
 
142
- def refund(money, authorization, options={})
142
+ def refund(money, authorization, options = {})
143
143
  # refund RF
144
144
  execute_referencing('RF', money, authorization, options)
145
145
  end
146
146
 
147
- def void(authorization, options={})
147
+ def void(authorization, options = {})
148
148
  # reversal RV
149
149
  execute_referencing('RV', nil, authorization, options)
150
150
  end
151
151
 
152
- def verify(credit_card, options={})
152
+ def verify(credit_card, options = {})
153
153
  MultiResponse.run(:use_first_response) do |r|
154
154
  r.process { authorize(100, credit_card, options) }
155
155
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -287,7 +287,7 @@ module ActiveMerchant #:nodoc:
287
287
  def add_options(post, options)
288
288
  post[:createRegistration] = options[:create_registration] if options[:create_registration] && !options[:registrationId]
289
289
  post[:testMode] = options[:test_mode] if test? && options[:test_mode]
290
- options.each { |key, value| post[key] = value if key.to_s.match('customParameters\[[a-zA-Z0-9\._]{3,64}\]') }
290
+ options.each { |key, value| post[key] = value if key.to_s =~ /'customParameters\[[a-zA-Z0-9\._]{3,64}\]'/ }
291
291
  post['customParameters[SHOPPER_pluginId]'] = 'activemerchant'
292
292
  post['customParameters[custom_disable3DSecure]'] = options[:disable_3d_secure] if options[:disable_3d_secure]
293
293
  end
@@ -349,7 +349,7 @@ module ActiveMerchant #:nodoc:
349
349
 
350
350
  def json_error(body)
351
351
  message = "Invalid response received #{body.inspect}"
352
- { 'result' => {'description' => message, 'code' => 'unknown' } }
352
+ { 'result' => { 'description' => message, 'code' => 'unknown' } }
353
353
  end
354
354
 
355
355
  def success_from(response)
@@ -125,8 +125,7 @@ module ActiveMerchant #:nodoc:
125
125
  test: test?,
126
126
  authorization: authorization_from(response),
127
127
  avs_result: { code: avs_result_from(response) },
128
- cvv_result: cvv_result_from(response)
129
- )
128
+ cvv_result: cvv_result_from(response))
130
129
  end
131
130
 
132
131
  # The upstream is picky and so we can't use CGI.escape like we want to
@@ -257,7 +256,7 @@ module ActiveMerchant #:nodoc:
257
256
  def schema
258
257
  { 'xmlns' => 'http://www.optimalpayments.com/creditcard/xmlschema/v1',
259
258
  'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
260
- 'xsi:schemaLocation' => 'http://www.optimalpayments.com/creditcard/xmlschema/v1'}
259
+ 'xsi:schemaLocation' => 'http://www.optimalpayments.com/creditcard/xmlschema/v1' }
261
260
  end
262
261
 
263
262
  def build_merchant_account(xml)
@@ -34,7 +34,7 @@ module ActiveMerchant #:nodoc:
34
34
 
35
35
  POST_HEADERS = {
36
36
  'MIME-Version' => '1.1',
37
- 'Content-Type' => "application/PTI#{API_VERSION.gsub(/\./, '')}",
37
+ 'Content-Type' => "application/PTI#{API_VERSION.delete('.')}",
38
38
  'Content-transfer-encoding' => 'text',
39
39
  'Request-number' => '1',
40
40
  'Document-type' => 'Request',
@@ -237,7 +237,7 @@ module ActiveMerchant #:nodoc:
237
237
  commit(order, :refund, options[:trace_number])
238
238
  end
239
239
 
240
- def credit(money, authorization, options= {})
240
+ def credit(money, authorization, options = {})
241
241
  ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
242
242
  refund(money, authorization, options)
243
243
  end
@@ -286,13 +286,13 @@ module ActiveMerchant #:nodoc:
286
286
  end
287
287
 
288
288
  def retrieve_customer_profile(customer_ref_num)
289
- options = {customer_profile_action: RETRIEVE, customer_ref_num: customer_ref_num}
289
+ options = { customer_profile_action: RETRIEVE, customer_ref_num: customer_ref_num }
290
290
  order = build_customer_request_xml(nil, options)
291
291
  commit(order, :retrieve_customer_profile)
292
292
  end
293
293
 
294
294
  def delete_customer_profile(customer_ref_num)
295
- options = {customer_profile_action: DELETE, customer_ref_num: customer_ref_num}
295
+ options = { customer_profile_action: DELETE, customer_ref_num: customer_ref_num }
296
296
  order = build_customer_request_xml(nil, options)
297
297
  commit(order, :delete_customer_profile)
298
298
  end
@@ -355,61 +355,61 @@ module ActiveMerchant #:nodoc:
355
355
  xml.tag! :SDMerchantEmail, soft_desc[:merchant_email] || nil
356
356
  end
357
357
 
358
- def add_level_2_tax(xml, options={})
359
- if (level_2 = options[:level_2_data])
360
- xml.tag! :TaxInd, level_2[:tax_indicator] if [TAX_NOT_PROVIDED, TAX_INCLUDED, NON_TAXABLE_TRANSACTION].include?(level_2[:tax_indicator].to_i)
361
- xml.tag! :Tax, level_2[:tax].to_i if level_2[:tax]
358
+ def add_level2_tax(xml, options = {})
359
+ if (level2 = options[:level_2_data])
360
+ xml.tag! :TaxInd, level2[:tax_indicator] if [TAX_NOT_PROVIDED, TAX_INCLUDED, NON_TAXABLE_TRANSACTION].include?(level2[:tax_indicator].to_i)
361
+ xml.tag! :Tax, level2[:tax].to_i if level2[:tax]
362
362
  end
363
363
  end
364
364
 
365
- def add_level_3_tax(xml, options={})
366
- if (level_3 = options[:level_3_data])
367
- xml.tag! :PC3VATtaxAmt, byte_limit(level_3[:vat_tax], 12) if level_3[:vat_tax]
368
- xml.tag! :PC3AltTaxAmt, byte_limit(level_3[:alt_tax], 9) if level_3[:alt_tax]
369
- xml.tag! :PC3VATtaxRate, byte_limit(level_3[:vat_rate], 4) if level_3[:vat_rate]
370
- xml.tag! :PC3AltTaxInd, byte_limit(level_3[:alt_ind], 15) if level_3[:alt_ind]
365
+ def add_level3_tax(xml, options = {})
366
+ if (level3 = options[:level_3_data])
367
+ xml.tag! :PC3VATtaxAmt, byte_limit(level3[:vat_tax], 12) if level3[:vat_tax]
368
+ xml.tag! :PC3AltTaxAmt, byte_limit(level3[:alt_tax], 9) if level3[:alt_tax]
369
+ xml.tag! :PC3VATtaxRate, byte_limit(level3[:vat_rate], 4) if level3[:vat_rate]
370
+ xml.tag! :PC3AltTaxInd, byte_limit(level3[:alt_ind], 15) if level3[:alt_ind]
371
371
  end
372
372
  end
373
373
 
374
- def add_level_2_advice_addendum(xml, options={})
375
- if (level_2 = options[:level_2_data])
376
- xml.tag! :AMEXTranAdvAddn1, byte_limit(level_2[:advice_addendum_1], 40) if level_2[:advice_addendum_1]
377
- xml.tag! :AMEXTranAdvAddn2, byte_limit(level_2[:advice_addendum_2], 40) if level_2[:advice_addendum_2]
378
- xml.tag! :AMEXTranAdvAddn3, byte_limit(level_2[:advice_addendum_3], 40) if level_2[:advice_addendum_3]
379
- xml.tag! :AMEXTranAdvAddn4, byte_limit(level_2[:advice_addendum_4], 40) if level_2[:advice_addendum_4]
374
+ def add_level2_advice_addendum(xml, options = {})
375
+ if (level2 = options[:level_2_data])
376
+ xml.tag! :AMEXTranAdvAddn1, byte_limit(level2[:advice_addendum_1], 40) if level2[:advice_addendum_1]
377
+ xml.tag! :AMEXTranAdvAddn2, byte_limit(level2[:advice_addendum_2], 40) if level2[:advice_addendum_2]
378
+ xml.tag! :AMEXTranAdvAddn3, byte_limit(level2[:advice_addendum_3], 40) if level2[:advice_addendum_3]
379
+ xml.tag! :AMEXTranAdvAddn4, byte_limit(level2[:advice_addendum_4], 40) if level2[:advice_addendum_4]
380
380
  end
381
381
  end
382
382
 
383
- def add_level_2_purchase(xml, options={})
384
- if (level_2 = options[:level_2_data])
385
- xml.tag! :PCOrderNum, byte_limit(level_2[:purchase_order], 17) if level_2[:purchase_order]
386
- xml.tag! :PCDestZip, byte_limit(format_address_field(level_2[:zip]), 10) if level_2[:zip]
387
- xml.tag! :PCDestName, byte_limit(format_address_field(level_2[:name]), 30) if level_2[:name]
388
- xml.tag! :PCDestAddress1, byte_limit(format_address_field(level_2[:address1]), 30) if level_2[:address1]
389
- xml.tag! :PCDestAddress2, byte_limit(format_address_field(level_2[:address2]), 30) if level_2[:address2]
390
- xml.tag! :PCDestCity, byte_limit(format_address_field(level_2[:city]), 20) if level_2[:city]
391
- xml.tag! :PCDestState, byte_limit(format_address_field(level_2[:state]), 2) if level_2[:state]
383
+ def add_level2_purchase(xml, options = {})
384
+ if (level2 = options[:level_2_data])
385
+ xml.tag! :PCOrderNum, byte_limit(level2[:purchase_order], 17) if level2[:purchase_order]
386
+ xml.tag! :PCDestZip, byte_limit(format_address_field(level2[:zip]), 10) if level2[:zip]
387
+ xml.tag! :PCDestName, byte_limit(format_address_field(level2[:name]), 30) if level2[:name]
388
+ xml.tag! :PCDestAddress1, byte_limit(format_address_field(level2[:address1]), 30) if level2[:address1]
389
+ xml.tag! :PCDestAddress2, byte_limit(format_address_field(level2[:address2]), 30) if level2[:address2]
390
+ xml.tag! :PCDestCity, byte_limit(format_address_field(level2[:city]), 20) if level2[:city]
391
+ xml.tag! :PCDestState, byte_limit(format_address_field(level2[:state]), 2) if level2[:state]
392
392
  end
393
393
  end
394
394
 
395
- def add_level_3_purchase(xml, options={})
396
- if (level_3 = options[:level_3_data])
397
- xml.tag! :PC3FreightAmt, byte_limit(level_3[:freight_amount], 12) if level_3[:freight_amount]
398
- xml.tag! :PC3DutyAmt, byte_limit(level_3[:duty_amount], 12) if level_3[:duty_amount]
399
- xml.tag! :PC3DestCountryCd, byte_limit(level_3[:dest_country], 3) if level_3[:dest_country]
400
- xml.tag! :PC3ShipFromZip, byte_limit(level_3[:ship_from_zip], 10) if level_3[:ship_from_zip]
401
- xml.tag! :PC3DiscAmt, byte_limit(level_3[:discount_amount], 12) if level_3[:discount_amount]
395
+ def add_level3_purchase(xml, options = {})
396
+ if (level3 = options[:level_3_data])
397
+ xml.tag! :PC3FreightAmt, byte_limit(level3[:freight_amount], 12) if level3[:freight_amount]
398
+ xml.tag! :PC3DutyAmt, byte_limit(level3[:duty_amount], 12) if level3[:duty_amount]
399
+ xml.tag! :PC3DestCountryCd, byte_limit(level3[:dest_country], 3) if level3[:dest_country]
400
+ xml.tag! :PC3ShipFromZip, byte_limit(level3[:ship_from_zip], 10) if level3[:ship_from_zip]
401
+ xml.tag! :PC3DiscAmt, byte_limit(level3[:discount_amount], 12) if level3[:discount_amount]
402
402
  end
403
403
  end
404
404
 
405
- def add_line_items(xml, options={})
405
+ def add_line_items(xml, options = {})
406
406
  xml.tag! :PC3LineItemCount, byte_limit(options[:line_items].count, 2)
407
407
  xml.tag! :PC3LineItemArray do
408
408
  options[:line_items].each_with_index do |line_item, index|
409
409
  xml.tag! :PC3LineItem do
410
410
  xml.tag! :PC3DtlIndex, byte_limit(index + 1, 2)
411
411
  line_item.each do |key, value|
412
- if key == :line_tot
412
+ if [:line_tot, 'line_tot'].include? key
413
413
  formatted_key = :PC3Dtllinetot
414
414
  else
415
415
  formatted_key = "PC3Dtl#{key.to_s.camelize}".to_sym
@@ -478,7 +478,7 @@ module ActiveMerchant #:nodoc:
478
478
  end
479
479
  end
480
480
 
481
- def add_creditcard(xml, creditcard, currency=nil)
481
+ def add_creditcard(xml, creditcard, currency = nil)
482
482
  unless creditcard.nil?
483
483
  xml.tag! :AccountNum, creditcard.number
484
484
  xml.tag! :Exp, expiry_date(creditcard)
@@ -515,13 +515,9 @@ module ActiveMerchant #:nodoc:
515
515
  end
516
516
 
517
517
  def add_xid(xml, creditcard, three_d_secure)
518
- xid = if three_d_secure && creditcard.brand == 'visa'
519
- three_d_secure[:xid]
520
- elsif creditcard.is_a?(NetworkTokenizationCreditCard)
521
- creditcard.transaction_id
522
- end
518
+ return unless three_d_secure && creditcard.brand == 'visa'
523
519
 
524
- xml.tag!(:XID, xid) if xid
520
+ xml.tag!(:XID, three_d_secure[:xid]) if three_d_secure[:xid]
525
521
  end
526
522
 
527
523
  def add_cavv(xml, creditcard, three_d_secure)
@@ -560,7 +556,7 @@ module ActiveMerchant #:nodoc:
560
556
  xml.tag!(:PymtBrandProgramCode, 'ASK')
561
557
  end
562
558
 
563
- def add_refund(xml, currency=nil)
559
+ def add_refund(xml, currency = nil)
564
560
  xml.tag! :AccountNum, nil
565
561
 
566
562
  xml.tag! :CurrencyCode, currency_code(currency)
@@ -647,7 +643,7 @@ module ActiveMerchant #:nodoc:
647
643
  end
648
644
  end
649
645
 
650
- def commit(order, message_type, trace_number=nil)
646
+ def commit(order, message_type, trace_number = nil)
651
647
  headers = POST_HEADERS.merge('Content-length' => order.size.to_s)
652
648
  if @options[:retry_logic] && trace_number
653
649
  headers['Trace-number'] = trace_number.to_s
@@ -669,11 +665,10 @@ module ActiveMerchant #:nodoc:
669
665
  test: self.test?,
670
666
  avs_result: OrbitalGateway::AVSResult.new(response[:avs_resp_code]),
671
667
  cvv_result: OrbitalGateway::CVVResult.new(response[:cvv2_resp_code])
672
- }
673
- )
668
+ })
674
669
  end
675
670
 
676
- def remote_url(url=:primary)
671
+ def remote_url(url = :primary)
677
672
  if url == :primary
678
673
  (self.test? ? self.test_url : self.live_url)
679
674
  else
@@ -733,22 +728,22 @@ module ActiveMerchant #:nodoc:
733
728
  xml.tag! :Amount, amount(money)
734
729
  xml.tag! :Comments, parameters[:comments] if parameters[:comments]
735
730
 
736
- add_level_2_tax(xml, parameters)
737
- add_level_2_advice_addendum(xml, parameters)
731
+ add_level2_tax(xml, parameters)
732
+ add_level2_advice_addendum(xml, parameters)
738
733
 
739
734
  add_aav(xml, creditcard, three_d_secure)
740
735
  # CustomerAni, AVSPhoneType and AVSDestPhoneType could be added here.
741
736
 
742
- add_dpanind(xml, creditcard)
743
- add_aevv(xml, creditcard, three_d_secure)
744
- add_digital_token_cryptogram(xml, creditcard)
745
-
746
737
  if parameters[:soft_descriptors].is_a?(OrbitalSoftDescriptors)
747
738
  add_soft_descriptors(xml, parameters[:soft_descriptors])
748
739
  elsif parameters[:soft_descriptors].is_a?(Hash)
749
740
  add_soft_descriptors_from_hash(xml, parameters[:soft_descriptors])
750
741
  end
751
742
 
743
+ add_dpanind(xml, creditcard)
744
+ add_aevv(xml, creditcard, three_d_secure)
745
+ add_digital_token_cryptogram(xml, creditcard)
746
+
752
747
  set_recurring_ind(xml, parameters)
753
748
 
754
749
  # Append Transaction Reference Number at the end for Refund transactions
@@ -757,11 +752,11 @@ module ActiveMerchant #:nodoc:
757
752
  xml.tag! :TxRefNum, tx_ref_num
758
753
  end
759
754
 
760
- add_level_2_purchase(xml, parameters)
761
- add_level_3_purchase(xml, parameters)
762
- add_level_3_tax(xml, parameters)
763
- add_card_indicators(xml, parameters)
755
+ add_level2_purchase(xml, parameters)
756
+ add_level3_purchase(xml, parameters)
757
+ add_level3_tax(xml, parameters)
764
758
  add_line_items(xml, parameters) if parameters[:line_items]
759
+ add_card_indicators(xml, parameters)
765
760
  add_stored_credentials(xml, parameters)
766
761
  add_pymt_brand_program_code(xml, creditcard, three_d_secure)
767
762
  end
@@ -788,13 +783,13 @@ module ActiveMerchant #:nodoc:
788
783
  add_xml_credentials(xml)
789
784
  xml.tag! :OrderID, format_order_id(order_id)
790
785
  xml.tag! :Amount, amount(money)
791
- add_level_2_tax(xml, parameters)
786
+ add_level2_tax(xml, parameters)
792
787
  add_bin_merchant_and_terminal(xml, parameters)
793
788
  xml.tag! :TxRefNum, tx_ref_num
794
- add_level_2_purchase(xml, parameters)
795
- add_level_2_advice_addendum(xml, parameters)
796
- add_level_3_purchase(xml, parameters)
797
- add_level_3_tax(xml, parameters)
789
+ add_level2_purchase(xml, parameters)
790
+ add_level2_advice_addendum(xml, parameters)
791
+ add_level3_purchase(xml, parameters)
792
+ add_level3_tax(xml, parameters)
798
793
  end
799
794
  end
800
795
  xml.target!
@@ -864,7 +859,7 @@ module ActiveMerchant #:nodoc:
864
859
  # 3. PINless Debit transactions can only use uppercase and lowercase alpha (A-Z, a-z) and numeric (0-9)
865
860
  def format_order_id(order_id)
866
861
  illegal_characters = /[^,$@&\- \w]/
867
- order_id = order_id.to_s.gsub(/\./, '-')
862
+ order_id = order_id.to_s.tr('.', '-')
868
863
  order_id.gsub!(illegal_characters, '')
869
864
  order_id.lstrip!
870
865
  order_id[0...22]