activemerchant 1.110.0 → 1.116.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (200) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +82 -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.rb +1 -1
  7. data/lib/active_merchant/billing/credit_card_methods.rb +6 -6
  8. data/lib/active_merchant/billing/gateway.rb +1 -1
  9. data/lib/active_merchant/billing/gateways/adyen.rb +30 -15
  10. data/lib/active_merchant/billing/gateways/allied_wallet.rb +7 -7
  11. data/lib/active_merchant/billing/gateways/authorize_net.rb +19 -17
  12. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -4
  13. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +2 -2
  14. data/lib/active_merchant/billing/gateways/axcessms.rb +8 -9
  15. data/lib/active_merchant/billing/gateways/balanced.rb +5 -4
  16. data/lib/active_merchant/billing/gateways/bambora_apac.rb +8 -8
  17. data/lib/active_merchant/billing/gateways/bank_frick.rb +8 -8
  18. data/lib/active_merchant/billing/gateways/banwire.rb +1 -1
  19. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +6 -4
  20. data/lib/active_merchant/billing/gateways/beanstream.rb +3 -3
  21. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +4 -5
  22. data/lib/active_merchant/billing/gateways/blue_pay.rb +2 -3
  23. data/lib/active_merchant/billing/gateways/blue_snap.rb +83 -23
  24. data/lib/active_merchant/billing/gateways/bogus.rb +19 -19
  25. data/lib/active_merchant/billing/gateways/borgun.rb +12 -12
  26. data/lib/active_merchant/billing/gateways/bpoint.rb +8 -8
  27. data/lib/active_merchant/billing/gateways/braintree.rb +1 -1
  28. data/lib/active_merchant/billing/gateways/braintree_blue.rb +14 -17
  29. data/lib/active_merchant/billing/gateways/bridge_pay.rb +7 -7
  30. data/lib/active_merchant/billing/gateways/cams.rb +8 -8
  31. data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
  32. data/lib/active_merchant/billing/gateways/card_save.rb +1 -1
  33. data/lib/active_merchant/billing/gateways/card_stream.rb +2 -2
  34. data/lib/active_merchant/billing/gateways/cardknox.rb +8 -8
  35. data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
  36. data/lib/active_merchant/billing/gateways/cecabank.rb +5 -5
  37. data/lib/active_merchant/billing/gateways/cenpos.rb +11 -11
  38. data/lib/active_merchant/billing/gateways/checkout.rb +2 -2
  39. data/lib/active_merchant/billing/gateways/checkout_v2.rb +17 -20
  40. data/lib/active_merchant/billing/gateways/clearhaus.rb +7 -7
  41. data/lib/active_merchant/billing/gateways/commercegate.rb +1 -1
  42. data/lib/active_merchant/billing/gateways/conekta.rb +2 -2
  43. data/lib/active_merchant/billing/gateways/creditcall.rb +10 -10
  44. data/lib/active_merchant/billing/gateways/credorax.rb +15 -9
  45. data/lib/active_merchant/billing/gateways/ct_payment.rb +10 -10
  46. data/lib/active_merchant/billing/gateways/culqi.rb +10 -10
  47. data/lib/active_merchant/billing/gateways/cyber_source.rb +58 -37
  48. data/lib/active_merchant/billing/gateways/d_local.rb +11 -11
  49. data/lib/active_merchant/billing/gateways/data_cash.rb +2 -3
  50. data/lib/active_merchant/billing/gateways/decidir.rb +10 -9
  51. data/lib/active_merchant/billing/gateways/dibs.rb +8 -8
  52. data/lib/active_merchant/billing/gateways/digitzs.rb +6 -6
  53. data/lib/active_merchant/billing/gateways/ebanx.rb +9 -9
  54. data/lib/active_merchant/billing/gateways/efsnet.rb +3 -4
  55. data/lib/active_merchant/billing/gateways/elavon.rb +251 -232
  56. data/lib/active_merchant/billing/gateways/element.rb +12 -8
  57. data/lib/active_merchant/billing/gateways/evo_ca.rb +5 -6
  58. data/lib/active_merchant/billing/gateways/eway.rb +3 -4
  59. data/lib/active_merchant/billing/gateways/eway_managed.rb +6 -7
  60. data/lib/active_merchant/billing/gateways/eway_rapid.rb +8 -8
  61. data/lib/active_merchant/billing/gateways/exact.rb +8 -9
  62. data/lib/active_merchant/billing/gateways/ezic.rb +8 -8
  63. data/lib/active_merchant/billing/gateways/fat_zebra.rb +9 -7
  64. data/lib/active_merchant/billing/gateways/federated_canada.rb +2 -3
  65. data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
  66. data/lib/active_merchant/billing/gateways/first_pay.rb +6 -6
  67. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +7 -7
  68. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +4 -4
  69. data/lib/active_merchant/billing/gateways/flo2cash.rb +9 -9
  70. data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
  71. data/lib/active_merchant/billing/gateways/forte.rb +14 -8
  72. data/lib/active_merchant/billing/gateways/global_collect.rb +15 -10
  73. data/lib/active_merchant/billing/gateways/global_transport.rb +7 -7
  74. data/lib/active_merchant/billing/gateways/hdfc.rb +10 -10
  75. data/lib/active_merchant/billing/gateways/hps.rb +16 -13
  76. data/lib/active_merchant/billing/gateways/iats_payments.rb +9 -4
  77. data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
  78. data/lib/active_merchant/billing/gateways/inspire.rb +3 -4
  79. data/lib/active_merchant/billing/gateways/instapay.rb +1 -2
  80. data/lib/active_merchant/billing/gateways/ipp.rb +7 -7
  81. data/lib/active_merchant/billing/gateways/iridium.rb +16 -17
  82. data/lib/active_merchant/billing/gateways/iveri.rb +7 -7
  83. data/lib/active_merchant/billing/gateways/ixopay.rb +7 -7
  84. data/lib/active_merchant/billing/gateways/jetpay.rb +1 -2
  85. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +4 -5
  86. data/lib/active_merchant/billing/gateways/kushki.rb +6 -6
  87. data/lib/active_merchant/billing/gateways/latitude19.rb +14 -14
  88. data/lib/active_merchant/billing/gateways/linkpoint.rb +5 -6
  89. data/lib/active_merchant/billing/gateways/litle.rb +12 -12
  90. data/lib/active_merchant/billing/gateways/mastercard.rb +12 -12
  91. data/lib/active_merchant/billing/gateways/mercado_pago.rb +8 -8
  92. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +1 -2
  93. data/lib/active_merchant/billing/gateways/merchant_one.rb +1 -1
  94. data/lib/active_merchant/billing/gateways/merchant_partners.rb +10 -10
  95. data/lib/active_merchant/billing/gateways/merchant_ware.rb +5 -7
  96. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +4 -6
  97. data/lib/active_merchant/billing/gateways/mercury.rb +4 -4
  98. data/lib/active_merchant/billing/gateways/metrics_global.rb +4 -5
  99. data/lib/active_merchant/billing/gateways/micropayment.rb +8 -8
  100. data/lib/active_merchant/billing/gateways/migs.rb +3 -4
  101. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +2 -4
  102. data/lib/active_merchant/billing/gateways/monei.rb +7 -7
  103. data/lib/active_merchant/billing/gateways/moneris.rb +4 -3
  104. data/lib/active_merchant/billing/gateways/money_movers.rb +2 -3
  105. data/lib/active_merchant/billing/gateways/mundipagg.rb +37 -10
  106. data/lib/active_merchant/billing/gateways/nab_transact.rb +2 -4
  107. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +7 -7
  108. data/lib/active_merchant/billing/gateways/net_registry.rb +1 -2
  109. data/lib/active_merchant/billing/gateways/netaxept.rb +6 -6
  110. data/lib/active_merchant/billing/gateways/netbanx.rb +12 -10
  111. data/lib/active_merchant/billing/gateways/netbilling.rb +4 -5
  112. data/lib/active_merchant/billing/gateways/network_merchants.rb +2 -3
  113. data/lib/active_merchant/billing/gateways/nmi.rb +21 -7
  114. data/lib/active_merchant/billing/gateways/ogone.rb +3 -3
  115. data/lib/active_merchant/billing/gateways/omise.rb +13 -13
  116. data/lib/active_merchant/billing/gateways/openpay.rb +4 -5
  117. data/lib/active_merchant/billing/gateways/opp.rb +12 -12
  118. data/lib/active_merchant/billing/gateways/optimal_payment.rb +3 -4
  119. data/lib/active_merchant/billing/gateways/orbital.rb +66 -64
  120. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +3 -4
  121. data/lib/active_merchant/billing/gateways/pagarme.rb +9 -9
  122. data/lib/active_merchant/billing/gateways/pago_facil.rb +2 -2
  123. data/lib/active_merchant/billing/gateways/pay_conex.rb +8 -8
  124. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +6 -7
  125. data/lib/active_merchant/billing/gateways/pay_hub.rb +7 -8
  126. data/lib/active_merchant/billing/gateways/pay_junction.rb +4 -5
  127. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +9 -9
  128. data/lib/active_merchant/billing/gateways/pay_secure.rb +2 -3
  129. data/lib/active_merchant/billing/gateways/paybox_direct.rb +23 -1
  130. data/lib/active_merchant/billing/gateways/payeezy.rb +12 -12
  131. data/lib/active_merchant/billing/gateways/payex.rb +11 -12
  132. data/lib/active_merchant/billing/gateways/payflow.rb +4 -1
  133. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +1 -1
  134. data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +1 -1
  135. data/lib/active_merchant/billing/gateways/payment_express.rb +1 -2
  136. data/lib/active_merchant/billing/gateways/paymentez.rb +5 -5
  137. data/lib/active_merchant/billing/gateways/paymill.rb +10 -10
  138. data/lib/active_merchant/billing/gateways/paypal_express.rb +1 -1
  139. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
  140. data/lib/active_merchant/billing/gateways/payscout.rb +1 -2
  141. data/lib/active_merchant/billing/gateways/paystation.rb +3 -4
  142. data/lib/active_merchant/billing/gateways/payu_in.rb +3 -3
  143. data/lib/active_merchant/billing/gateways/payu_latam.rb +21 -11
  144. data/lib/active_merchant/billing/gateways/payway.rb +8 -9
  145. data/lib/active_merchant/billing/gateways/plugnpay.rb +2 -3
  146. data/lib/active_merchant/billing/gateways/pro_pay.rb +8 -8
  147. data/lib/active_merchant/billing/gateways/psigate.rb +3 -4
  148. data/lib/active_merchant/billing/gateways/psl_card.rb +1 -2
  149. data/lib/active_merchant/billing/gateways/qbms.rb +4 -5
  150. data/lib/active_merchant/billing/gateways/quantum.rb +1 -2
  151. data/lib/active_merchant/billing/gateways/quickbooks.rb +4 -3
  152. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +3 -4
  153. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +1 -2
  154. data/lib/active_merchant/billing/gateways/qvalent.rb +9 -9
  155. data/lib/active_merchant/billing/gateways/realex.rb +2 -1
  156. data/lib/active_merchant/billing/gateways/redsys.rb +7 -7
  157. data/lib/active_merchant/billing/gateways/s5.rb +7 -7
  158. data/lib/active_merchant/billing/gateways/safe_charge.rb +12 -12
  159. data/lib/active_merchant/billing/gateways/sage.rb +3 -5
  160. data/lib/active_merchant/billing/gateways/sage_pay.rb +6 -7
  161. data/lib/active_merchant/billing/gateways/sallie_mae.rb +1 -2
  162. data/lib/active_merchant/billing/gateways/secure_net.rb +1 -2
  163. data/lib/active_merchant/billing/gateways/secure_pay.rb +3 -4
  164. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +2 -4
  165. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +1 -2
  166. data/lib/active_merchant/billing/gateways/securion_pay.rb +5 -6
  167. data/lib/active_merchant/billing/gateways/skip_jack.rb +3 -4
  168. data/lib/active_merchant/billing/gateways/smart_ps.rb +5 -6
  169. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +7 -7
  170. data/lib/active_merchant/billing/gateways/spreedly_core.rb +6 -6
  171. data/lib/active_merchant/billing/gateways/stripe.rb +11 -11
  172. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +9 -0
  173. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +3 -4
  174. data/lib/active_merchant/billing/gateways/telr.rb +9 -9
  175. data/lib/active_merchant/billing/gateways/trans_first.rb +3 -3
  176. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +14 -14
  177. data/lib/active_merchant/billing/gateways/transact_pro.rb +9 -9
  178. data/lib/active_merchant/billing/gateways/trust_commerce.rb +8 -9
  179. data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -1
  180. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +36 -36
  181. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +4 -5
  182. data/lib/active_merchant/billing/gateways/vanco.rb +3 -3
  183. data/lib/active_merchant/billing/gateways/verifi.rb +1 -2
  184. data/lib/active_merchant/billing/gateways/viaklix.rb +1 -2
  185. data/lib/active_merchant/billing/gateways/visanet_peru.rb +10 -10
  186. data/lib/active_merchant/billing/gateways/webpay.rb +2 -2
  187. data/lib/active_merchant/billing/gateways/wepay.rb +3 -2
  188. data/lib/active_merchant/billing/gateways/wirecard.rb +1 -2
  189. data/lib/active_merchant/billing/gateways/worldpay.rb +12 -8
  190. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +14 -16
  191. data/lib/active_merchant/billing/gateways/worldpay_us.rb +9 -9
  192. data/lib/active_merchant/billing/response.rb +1 -1
  193. data/lib/active_merchant/country.rb +1 -1
  194. data/lib/active_merchant/network_connection_retries.rb +2 -2
  195. data/lib/active_merchant/post_data.rb +1 -1
  196. data/lib/active_merchant/posts_data.rb +1 -1
  197. data/lib/active_merchant/version.rb +1 -1
  198. data/lib/support/ssl_verify.rb +2 -2
  199. data/lib/support/ssl_version.rb +2 -2
  200. metadata +16 -2
@@ -83,7 +83,7 @@ module ActiveMerchant
83
83
  store: 'registerAccount'
84
84
  }
85
85
 
86
- def initialize(options={})
86
+ def initialize(options = {})
87
87
  @options = options
88
88
 
89
89
  @options[:merchant] ||= 'TEST' if test?
@@ -92,7 +92,7 @@ module ActiveMerchant
92
92
  @options[:eci] ||= 'SSL'
93
93
  end
94
94
 
95
- def authorize(amount, payment_method, options={})
95
+ def authorize(amount, payment_method, options = {})
96
96
  requires!(options, :order_id)
97
97
 
98
98
  post = {}
@@ -101,7 +101,7 @@ module ActiveMerchant
101
101
  commit(:authorize, post)
102
102
  end
103
103
 
104
- def capture(amount, authorization, options={})
104
+ def capture(amount, authorization, options = {})
105
105
  requires!(options, :order_id)
106
106
 
107
107
  post = {}
@@ -110,7 +110,7 @@ module ActiveMerchant
110
110
  commit(:capture, post)
111
111
  end
112
112
 
113
- def purchase(amount, payment_method, options={})
113
+ def purchase(amount, payment_method, options = {})
114
114
  requires!(options, :order_id)
115
115
 
116
116
  post = {}
@@ -119,7 +119,7 @@ module ActiveMerchant
119
119
  commit(:purchase, post)
120
120
  end
121
121
 
122
- def refund(amount, authorization, options={})
122
+ def refund(amount, authorization, options = {})
123
123
  requires!(options, :order_id)
124
124
 
125
125
  post = {}
@@ -128,7 +128,7 @@ module ActiveMerchant
128
128
  commit(:refund, post)
129
129
  end
130
130
 
131
- def store(credit_card, options={})
131
+ def store(credit_card, options = {})
132
132
  requires!(options, :billing_id)
133
133
 
134
134
  post = {}
@@ -137,7 +137,7 @@ module ActiveMerchant
137
137
  commit(:store, post)
138
138
  end
139
139
 
140
- def status(options={})
140
+ def status(options = {})
141
141
  requires!(options, :order_id)
142
142
 
143
143
  commit(:status, 'customer.orderNumber' => options[:order_id])
@@ -194,8 +194,7 @@ module ActiveMerchant
194
194
 
195
195
  Response.new(success, message, params,
196
196
  test: (@options[:merchant].to_s == 'TEST'),
197
- authorization: post[:order_number]
198
- )
197
+ authorization: post[:order_number])
199
198
  rescue ActiveMerchant::ResponseError => e
200
199
  raise unless e.response.code == '403'
201
200
 
@@ -31,7 +31,7 @@ module ActiveMerchant
31
31
  'W' => '9-digit zip/postal code matches billing information, street address does not',
32
32
  'X' => 'Street address and 9-digit zip/postal code matches billing information',
33
33
  'Y' => 'Street address and 5-digit zip/postal code matches billing information',
34
- 'Z' => '5-digit zip/postal code matches billing information, street address does not',
34
+ 'Z' => '5-digit zip/postal code matches billing information, street address does not'
35
35
  }
36
36
 
37
37
  AVS_ERRORS = %w(A E N R W Z)
@@ -182,8 +182,7 @@ module ActiveMerchant
182
182
  test: test?,
183
183
  authorization: response[:orderid],
184
184
  avs_result: { code: response[:avs_code] },
185
- cvv_result: response[:cvvresp]
186
- )
185
+ cvv_result: response[:cvvresp])
187
186
  end
188
187
 
189
188
  def parse(body)
@@ -133,12 +133,12 @@ module ActiveMerchant #:nodoc:
133
133
  '99' => 'Generic decline or unable to parse issuer response code'
134
134
  }
135
135
 
136
- def initialize(options={})
136
+ def initialize(options = {})
137
137
  requires!(options, :cert_str)
138
138
  super
139
139
  end
140
140
 
141
- def purchase(money, payment, options={})
141
+ def purchase(money, payment, options = {})
142
142
  request = build_xml_request do |xml|
143
143
  add_invoice(xml, money, options)
144
144
  add_payment(xml, payment, options)
@@ -151,7 +151,7 @@ module ActiveMerchant #:nodoc:
151
151
  commit(request)
152
152
  end
153
153
 
154
- def authorize(money, payment, options={})
154
+ def authorize(money, payment, options = {})
155
155
  request = build_xml_request do |xml|
156
156
  add_invoice(xml, money, options)
157
157
  add_payment(xml, payment, options)
@@ -164,7 +164,7 @@ module ActiveMerchant #:nodoc:
164
164
  commit(request)
165
165
  end
166
166
 
167
- def capture(money, authorization, options={})
167
+ def capture(money, authorization, options = {})
168
168
  request = build_xml_request do |xml|
169
169
  add_invoice(xml, money, options)
170
170
  add_account(xml, options)
@@ -175,7 +175,7 @@ module ActiveMerchant #:nodoc:
175
175
  commit(request)
176
176
  end
177
177
 
178
- def refund(money, authorization, options={})
178
+ def refund(money, authorization, options = {})
179
179
  request = build_xml_request do |xml|
180
180
  add_invoice(xml, money, options)
181
181
  add_account(xml, options)
@@ -186,11 +186,11 @@ module ActiveMerchant #:nodoc:
186
186
  commit(request)
187
187
  end
188
188
 
189
- def void(authorization, options={})
189
+ def void(authorization, options = {})
190
190
  refund(nil, authorization, options)
191
191
  end
192
192
 
193
- def credit(money, payment, options={})
193
+ def credit(money, payment, options = {})
194
194
  request = build_xml_request do |xml|
195
195
  add_invoice(xml, money, options)
196
196
  add_payment(xml, payment, options)
@@ -201,7 +201,7 @@ module ActiveMerchant #:nodoc:
201
201
  commit(request)
202
202
  end
203
203
 
204
- def verify(credit_card, options={})
204
+ def verify(credit_card, options = {})
205
205
  MultiResponse.run(:use_first_response) do |r|
206
206
  r.process { authorize(100, credit_card, options) }
207
207
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -106,8 +106,7 @@ module ActiveMerchant #:nodoc:
106
106
  test: test?,
107
107
  authorization: build_authorization(response),
108
108
  avs_result: { code: response[:avsresult] },
109
- cvv_result: response[:cardidresult]
110
- )
109
+ cvv_result: response[:cardidresult])
111
110
  end
112
111
 
113
112
  def url
@@ -119,7 +118,7 @@ module ActiveMerchant #:nodoc:
119
118
  end
120
119
 
121
120
  def parse(xml)
122
- response = {message: 'Global Error Receipt', complete: false}
121
+ response = { message: 'Global Error Receipt', complete: false }
123
122
 
124
123
  xml = REXML::Document.new(xml)
125
124
  xml.elements.each('//Result/*') do |node|
@@ -163,7 +162,7 @@ module ActiveMerchant #:nodoc:
163
162
  SubTotal: amount(money),
164
163
  Tax1: options[:tax1],
165
164
  Tax2: options[:tax2],
166
- ShippingTotal: options[:shipping_total],
165
+ ShippingTotal: options[:shipping_total]
167
166
  }
168
167
 
169
168
  if creditcard
@@ -263,8 +263,7 @@ module ActiveMerchant
263
263
  test: test?,
264
264
  authorization: response[:CrossReference],
265
265
  cvv_result: CVV_CODE[response[:AVSCV2Check]],
266
- avs_result: { code: AVS_CODE[response[:AVSCV2Check]] }
267
- )
266
+ avs_result: { code: AVS_CODE[response[:AVSCV2Check]] })
268
267
  end
269
268
 
270
269
  # Put the passed data into a format that can be submitted to PSL
@@ -20,7 +20,7 @@ module ActiveMerchant #:nodoc:
20
20
  purchase: 'CustomerCreditCardCharge',
21
21
  refund: 'CustomerCreditCardTxnVoidOrRefund',
22
22
  void: 'CustomerCreditCardTxnVoid',
23
- query: 'MerchantAccountQuery',
23
+ query: 'MerchantAccountQuery'
24
24
  }
25
25
 
26
26
  # Creates a new QbmsGateway
@@ -147,8 +147,7 @@ module ActiveMerchant #:nodoc:
147
147
  authorization: response[:credit_card_trans_id],
148
148
  fraud_review: fraud_review?(response),
149
149
  avs_result: { code: avs_result(response) },
150
- cvv_result: cvv_result(response)
151
- )
150
+ cvv_result: cvv_result(response))
152
151
  end
153
152
 
154
153
  def success?(response)
@@ -168,7 +167,7 @@ module ActiveMerchant #:nodoc:
168
167
  if status_code != 0
169
168
  return {
170
169
  status_code: status_code,
171
- status_message: signon.attributes['statusMessage'],
170
+ status_message: signon.attributes['statusMessage']
172
171
  }
173
172
  end
174
173
 
@@ -176,7 +175,7 @@ module ActiveMerchant #:nodoc:
176
175
 
177
176
  results = {
178
177
  status_code: response.attributes['statusCode'].to_i,
179
- status_message: response.attributes['statusMessage'],
178
+ status_message: response.attributes['statusMessage']
180
179
  }
181
180
 
182
181
  response.elements.each do |e|
@@ -219,8 +219,7 @@ module ActiveMerchant #:nodoc:
219
219
  test: test?,
220
220
  authorization: authorization,
221
221
  avs_result: { code: response[:AVSResponseCode] },
222
- cvv_result: response[:CVV2ResponseCode]
223
- )
222
+ cvv_result: response[:CVV2ResponseCode])
224
223
  end
225
224
 
226
225
  # Parse the SOAP response
@@ -151,8 +151,9 @@ module ActiveMerchant #:nodoc:
151
151
  if address = options[:billing_address] || options[:address]
152
152
  card_address[:streetAddress] = address[:address1]
153
153
  card_address[:city] = address[:city]
154
- card_address[:region] = address[:state] || address[:region]
155
- card_address[:country] = address[:country]
154
+ region = address[:state] || address[:region]
155
+ card_address[:region] = region if region.present?
156
+ card_address[:country] = address[:country] if address[:country].present?
156
157
  card_address[:postalCode] = address[:zip] if address[:zip]
157
158
  end
158
159
  post[:card][:address] = card_address
@@ -259,7 +260,7 @@ module ActiveMerchant #:nodoc:
259
260
  hmac_signature = OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha1'), oauth_signing_key, oauth_signature_base_string)
260
261
 
261
262
  # append signature to required OAuth parameters
262
- oauth_parameters[:oauth_signature] = CGI.escape(Base64.encode64(hmac_signature).chomp.gsub(/\n/, ''))
263
+ oauth_parameters[:oauth_signature] = CGI.escape(Base64.encode64(hmac_signature).chomp.delete("\n"))
263
264
 
264
265
  # prepare Authorization header string
265
266
  oauth_parameters = Hash[oauth_parameters.sort_by { |k, _| k }]
@@ -68,7 +68,7 @@ module ActiveMerchant
68
68
  commit(synchronized_path("/payments/#{identification}/refund"), post)
69
69
  end
70
70
 
71
- def verify(credit_card, options={})
71
+ def verify(credit_card, options = {})
72
72
  MultiResponse.run(:use_first_response) do |r|
73
73
  r.process { authorize(100, credit_card, options) }
74
74
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -155,8 +155,7 @@ module ActiveMerchant
155
155
 
156
156
  Response.new(success, message_from(success, response), response,
157
157
  test: test?,
158
- authorization: authorization_from(response)
159
- )
158
+ authorization: authorization_from(response))
160
159
  end
161
160
 
162
161
  def authorization_from(response)
@@ -264,7 +263,7 @@ module ActiveMerchant
264
263
  end
265
264
 
266
265
  def format_order_id(order_id)
267
- truncate(order_id.to_s.gsub(/#/, ''), 20)
266
+ truncate(order_id.to_s.delete('#'), 20)
268
267
  end
269
268
 
270
269
  def headers
@@ -166,8 +166,7 @@ module ActiveMerchant #:nodoc:
166
166
 
167
167
  Response.new(successful?(response), message_from(response), response,
168
168
  test: test?,
169
- authorization: response[:transaction]
170
- )
169
+ authorization: response[:transaction])
171
170
  end
172
171
 
173
172
  def successful?(response)
@@ -16,12 +16,12 @@ module ActiveMerchant #:nodoc:
16
16
  'S' => 'D'
17
17
  }
18
18
 
19
- def initialize(options={})
19
+ def initialize(options = {})
20
20
  requires!(options, :username, :password, :merchant, :pem, :pem_password)
21
21
  super
22
22
  end
23
23
 
24
- def purchase(amount, payment_method, options={})
24
+ def purchase(amount, payment_method, options = {})
25
25
  post = {}
26
26
  add_invoice(post, amount, options)
27
27
  add_order_number(post, options)
@@ -34,7 +34,7 @@ module ActiveMerchant #:nodoc:
34
34
  commit('capture', post)
35
35
  end
36
36
 
37
- def authorize(amount, payment_method, options={})
37
+ def authorize(amount, payment_method, options = {})
38
38
  post = {}
39
39
  add_invoice(post, amount, options)
40
40
  add_order_number(post, options)
@@ -47,7 +47,7 @@ module ActiveMerchant #:nodoc:
47
47
  commit('preauth', post)
48
48
  end
49
49
 
50
- def capture(amount, authorization, options={})
50
+ def capture(amount, authorization, options = {})
51
51
  post = {}
52
52
  add_invoice(post, amount, options)
53
53
  add_reference(post, authorization, options)
@@ -57,7 +57,7 @@ module ActiveMerchant #:nodoc:
57
57
  commit('captureWithoutAuth', post)
58
58
  end
59
59
 
60
- def refund(amount, authorization, options={})
60
+ def refund(amount, authorization, options = {})
61
61
  post = {}
62
62
  add_invoice(post, amount, options)
63
63
  add_reference(post, authorization, options)
@@ -69,7 +69,7 @@ module ActiveMerchant #:nodoc:
69
69
  end
70
70
 
71
71
  # Credit requires the merchant account to be enabled for "Adhoc Refunds"
72
- def credit(amount, payment_method, options={})
72
+ def credit(amount, payment_method, options = {})
73
73
  post = {}
74
74
  add_invoice(post, amount, options)
75
75
  add_order_number(post, options)
@@ -80,7 +80,7 @@ module ActiveMerchant #:nodoc:
80
80
  commit('refund', post)
81
81
  end
82
82
 
83
- def void(authorization, options={})
83
+ def void(authorization, options = {})
84
84
  post = {}
85
85
  add_reference(post, authorization, options)
86
86
  add_customer_data(post, options)
@@ -110,7 +110,7 @@ module ActiveMerchant #:nodoc:
110
110
 
111
111
  private
112
112
 
113
- CURRENCY_CODES = Hash.new { |h, k| raise ArgumentError.new("Unsupported currency: #{k}") }
113
+ CURRENCY_CODES = Hash.new { |_h, k| raise ArgumentError.new("Unsupported currency: #{k}") }
114
114
  CURRENCY_CODES['AUD'] = 'AUD'
115
115
  CURRENCY_CODES['INR'] = 'INR'
116
116
 
@@ -280,7 +280,7 @@ module ActiveMerchant #:nodoc:
280
280
  '12' => STANDARD_ERROR_CODE[:card_declined],
281
281
  '06' => STANDARD_ERROR_CODE[:processing_error],
282
282
  '01' => STANDARD_ERROR_CODE[:call_issuer],
283
- '04' => STANDARD_ERROR_CODE[:pickup_card],
283
+ '04' => STANDARD_ERROR_CODE[:pickup_card]
284
284
  }
285
285
 
286
286
  def error_code_from(succeeded, response)
@@ -300,7 +300,7 @@ module ActiveMerchant
300
300
  end
301
301
  xml.tag! 'supplementarydata' do
302
302
  xml.tag! 'item', 'type' => 'mobile' do
303
- xml.tag! 'field01', payment.source.to_s.gsub('_', '-')
303
+ xml.tag! 'field01', payment.source.to_s.tr('_', '-')
304
304
  end
305
305
  end
306
306
  end
@@ -316,6 +316,7 @@ module ActiveMerchant
316
316
  else
317
317
  xml.tag! 'cavv', three_d_secure[:cavv]
318
318
  xml.tag! 'xid', three_d_secure[:xid]
319
+ version = '1'
319
320
  end
320
321
  xml.tag! 'eci', three_d_secure[:eci]
321
322
  xml.tag! 'message_version', version
@@ -322,7 +322,7 @@ module ActiveMerchant #:nodoc:
322
322
  end
323
323
 
324
324
  def add_threeds(data, options)
325
- data[:threeds] = {threeDSInfo: 'CardData'} if options[:execute_threed] == true
325
+ data[:threeds] = { threeDSInfo: 'CardData' } if options[:execute_threed] == true
326
326
  end
327
327
 
328
328
  def determine_3ds_action(threeds_hash)
@@ -334,7 +334,7 @@ module ActiveMerchant #:nodoc:
334
334
  def commit(data, options = {})
335
335
  if data[:threeds]
336
336
  action = determine_3ds_action(data[:threeds])
337
- request = <<-EOS
337
+ request = <<-REQUEST
338
338
  <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://webservice.sis.sermepa.es" xmlns:intf="http://webservice.sis.sermepa.es" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
339
339
  <soapenv:Header/>
340
340
  <soapenv:Body>
@@ -345,14 +345,14 @@ module ActiveMerchant #:nodoc:
345
345
  </intf:#{action}>
346
346
  </soapenv:Body>
347
347
  </soapenv:Envelope>
348
- EOS
348
+ REQUEST
349
349
  parse(ssl_post(threeds_url, request, headers(action)), action)
350
350
  else
351
351
  parse(ssl_post(url, "entrada=#{CGI.escape(xml_request_from(data, options))}", headers), action)
352
352
  end
353
353
  end
354
354
 
355
- def headers(action=nil)
355
+ def headers(action = nil)
356
356
  if action
357
357
  {
358
358
  'Content-Type' => 'text/xml',
@@ -476,7 +476,7 @@ module ActiveMerchant #:nodoc:
476
476
  if validate_signature(params)
477
477
  message = response_text(params[:ds_response])
478
478
  options[:authorization] = build_authorization(params)
479
- success = is_success_response?(params[:ds_response])
479
+ success = success_response?(params[:ds_response])
480
480
  else
481
481
  message = 'Response failed validation check'
482
482
  end
@@ -490,7 +490,7 @@ module ActiveMerchant #:nodoc:
490
490
  end
491
491
  message = response_text_3ds(xml, params)
492
492
  options[:authorization] = build_authorization(params)
493
- success = params.size > 0 && is_success_response?(params[:ds_response])
493
+ success = params.size > 0 && success_response?(params[:ds_response])
494
494
  else
495
495
  # Some kind of programmer error with the request!
496
496
  message = "#{code} ERROR"
@@ -559,7 +559,7 @@ module ActiveMerchant #:nodoc:
559
559
  message
560
560
  end
561
561
 
562
- def is_success_response?(code)
562
+ def success_response?(code)
563
563
  (code.to_i < 100) || [400, 481, 500, 900].include?(code.to_i)
564
564
  end
565
565