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
@@ -47,9 +47,9 @@ module ActiveMerchant #:nodoc:
47
47
  money = amount(money)
48
48
  case normalize(paysource)
49
49
  when /1$/
50
- Response.new(true, SUCCESS_MESSAGE, {paid_amount: money}, test: true)
50
+ Response.new(true, SUCCESS_MESSAGE, { paid_amount: money }, test: true)
51
51
  when /2$/
52
- Response.new(false, FAILURE_MESSAGE, {paid_amount: money, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
52
+ Response.new(false, FAILURE_MESSAGE, { paid_amount: money, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
53
53
  else
54
54
  raise Error, error_message(paysource)
55
55
  end
@@ -61,9 +61,9 @@ module ActiveMerchant #:nodoc:
61
61
  when /1$/
62
62
  raise Error, REFUND_ERROR_MESSAGE
63
63
  when /2$/
64
- Response.new(false, FAILURE_MESSAGE, {paid_amount: money, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
64
+ Response.new(false, FAILURE_MESSAGE, { paid_amount: money, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
65
65
  else
66
- Response.new(true, SUCCESS_MESSAGE, {paid_amount: money}, test: true)
66
+ Response.new(true, SUCCESS_MESSAGE, { paid_amount: money }, test: true)
67
67
  end
68
68
  end
69
69
 
@@ -73,9 +73,9 @@ module ActiveMerchant #:nodoc:
73
73
  when /1$/
74
74
  raise Error, CAPTURE_ERROR_MESSAGE
75
75
  when /2$/
76
- Response.new(false, FAILURE_MESSAGE, {paid_amount: money, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
76
+ Response.new(false, FAILURE_MESSAGE, { paid_amount: money, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
77
77
  else
78
- Response.new(true, SUCCESS_MESSAGE, {paid_amount: money}, test: true)
78
+ Response.new(true, SUCCESS_MESSAGE, { paid_amount: money }, test: true)
79
79
  end
80
80
  end
81
81
 
@@ -84,18 +84,18 @@ module ActiveMerchant #:nodoc:
84
84
  when /1$/
85
85
  raise Error, VOID_ERROR_MESSAGE
86
86
  when /2$/
87
- Response.new(false, FAILURE_MESSAGE, {authorization: reference, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
87
+ Response.new(false, FAILURE_MESSAGE, { authorization: reference, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
88
88
  else
89
- Response.new(true, SUCCESS_MESSAGE, {authorization: reference}, test: true)
89
+ Response.new(true, SUCCESS_MESSAGE, { authorization: reference }, test: true)
90
90
  end
91
91
  end
92
92
 
93
93
  def store(paysource, options = {})
94
94
  case normalize(paysource)
95
95
  when /1$/
96
- Response.new(true, SUCCESS_MESSAGE, {billingid: '1'}, test: true, authorization: AUTHORIZATION)
96
+ Response.new(true, SUCCESS_MESSAGE, { billingid: '1' }, test: true, authorization: AUTHORIZATION)
97
97
  when /2$/
98
- Response.new(false, FAILURE_MESSAGE, {billingid: nil, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
98
+ Response.new(false, FAILURE_MESSAGE, { billingid: nil, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
99
99
  else
100
100
  raise Error, error_message(paysource)
101
101
  end
@@ -106,7 +106,7 @@ module ActiveMerchant #:nodoc:
106
106
  when /1$/
107
107
  Response.new(true, SUCCESS_MESSAGE, {}, test: true)
108
108
  when /2$/
109
- Response.new(false, FAILURE_MESSAGE, {error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
109
+ Response.new(false, FAILURE_MESSAGE, { error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
110
110
  else
111
111
  raise Error, UNSTORE_ERROR_MESSAGE
112
112
  end
@@ -118,9 +118,9 @@ module ActiveMerchant #:nodoc:
118
118
  money = amount(money)
119
119
  case money
120
120
  when /00$/
121
- Response.new(true, SUCCESS_MESSAGE, {authorized_amount: money}, test: true, authorization: AUTHORIZATION, emv_authorization: AUTHORIZATION_EMV_SUCCESS)
121
+ Response.new(true, SUCCESS_MESSAGE, { authorized_amount: money }, test: true, authorization: AUTHORIZATION, emv_authorization: AUTHORIZATION_EMV_SUCCESS)
122
122
  when /05$/
123
- Response.new(false, FAILURE_MESSAGE, {authorized_amount: money, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error], emv_authorization: AUTHORIZATION_EMV_DECLINE)
123
+ Response.new(false, FAILURE_MESSAGE, { authorized_amount: money, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error], emv_authorization: AUTHORIZATION_EMV_DECLINE)
124
124
  else
125
125
  raise Error, error_message(paysource)
126
126
  end
@@ -130,9 +130,9 @@ module ActiveMerchant #:nodoc:
130
130
  money = amount(money)
131
131
  case normalize(paysource)
132
132
  when /1$/, AUTHORIZATION
133
- Response.new(true, SUCCESS_MESSAGE, {authorized_amount: money}, test: true, authorization: AUTHORIZATION)
133
+ Response.new(true, SUCCESS_MESSAGE, { authorized_amount: money }, test: true, authorization: AUTHORIZATION)
134
134
  when /2$/
135
- Response.new(false, FAILURE_MESSAGE, {authorized_amount: money, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
135
+ Response.new(false, FAILURE_MESSAGE, { authorized_amount: money, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
136
136
  else
137
137
  raise Error, error_message(paysource)
138
138
  end
@@ -142,9 +142,9 @@ module ActiveMerchant #:nodoc:
142
142
  money = amount(money)
143
143
  case money
144
144
  when /00$/
145
- Response.new(true, SUCCESS_MESSAGE, {paid_amount: money}, test: true, authorization: AUTHORIZATION, emv_authorization: AUTHORIZATION_EMV_SUCCESS)
145
+ Response.new(true, SUCCESS_MESSAGE, { paid_amount: money }, test: true, authorization: AUTHORIZATION, emv_authorization: AUTHORIZATION_EMV_SUCCESS)
146
146
  when /05$/
147
- Response.new(false, FAILURE_MESSAGE, {paid_amount: money, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error], emv_authorization: AUTHORIZATION_EMV_DECLINE)
147
+ Response.new(false, FAILURE_MESSAGE, { paid_amount: money, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error], emv_authorization: AUTHORIZATION_EMV_DECLINE)
148
148
  else
149
149
  raise Error, error_message(paysource)
150
150
  end
@@ -154,9 +154,9 @@ module ActiveMerchant #:nodoc:
154
154
  money = amount(money)
155
155
  case normalize(paysource)
156
156
  when /1$/, AUTHORIZATION
157
- Response.new(true, SUCCESS_MESSAGE, {paid_amount: money}, test: true, authorization: AUTHORIZATION)
157
+ Response.new(true, SUCCESS_MESSAGE, { paid_amount: money }, test: true, authorization: AUTHORIZATION)
158
158
  when /2$/
159
- Response.new(false, FAILURE_MESSAGE, {paid_amount: money, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
159
+ Response.new(false, FAILURE_MESSAGE, { paid_amount: money, error: FAILURE_MESSAGE }, test: true, error_code: STANDARD_ERROR_CODE[:processing_error])
160
160
  else
161
161
  raise Error, error_message(paysource)
162
162
  end
@@ -16,12 +16,12 @@ module ActiveMerchant #:nodoc:
16
16
 
17
17
  self.homepage_url = 'https://www.borgun.is/'
18
18
 
19
- def initialize(options={})
19
+ def initialize(options = {})
20
20
  requires!(options, :processor, :merchant_id, :username, :password)
21
21
  super
22
22
  end
23
23
 
24
- def purchase(money, payment, options={})
24
+ def purchase(money, payment, options = {})
25
25
  post = {}
26
26
  post[:TransType] = '1'
27
27
  add_invoice(post, money, options)
@@ -29,7 +29,7 @@ module ActiveMerchant #:nodoc:
29
29
  commit('sale', post)
30
30
  end
31
31
 
32
- def authorize(money, payment, options={})
32
+ def authorize(money, payment, options = {})
33
33
  post = {}
34
34
  post[:TransType] = '5'
35
35
  add_invoice(post, money, options)
@@ -37,7 +37,7 @@ module ActiveMerchant #:nodoc:
37
37
  commit('authonly', post, options)
38
38
  end
39
39
 
40
- def capture(money, authorization, options={})
40
+ def capture(money, authorization, options = {})
41
41
  post = {}
42
42
  post[:TransType] = '1'
43
43
  add_invoice(post, money, options)
@@ -45,7 +45,7 @@ module ActiveMerchant #:nodoc:
45
45
  commit('capture', post)
46
46
  end
47
47
 
48
- def refund(money, authorization, options={})
48
+ def refund(money, authorization, options = {})
49
49
  post = {}
50
50
  post[:TransType] = '3'
51
51
  add_invoice(post, money, options)
@@ -53,7 +53,7 @@ module ActiveMerchant #:nodoc:
53
53
  commit('refund', post)
54
54
  end
55
55
 
56
- def void(authorization, options={})
56
+ def void(authorization, options = {})
57
57
  post = {}
58
58
  # TransType, TrAmount, and currency must match original values from auth or purchase.
59
59
  _, _, _, _, _, transtype, tramount, currency = split_authorization(authorization)
@@ -76,7 +76,7 @@ module ActiveMerchant #:nodoc:
76
76
 
77
77
  private
78
78
 
79
- CURRENCY_CODES = Hash.new { |h, k| raise ArgumentError.new("Unsupported currency for HDFC: #{k}") }
79
+ CURRENCY_CODES = Hash.new { |_h, k| raise ArgumentError.new("Unsupported currency for HDFC: #{k}") }
80
80
  CURRENCY_CODES['ISK'] = '352'
81
81
  CURRENCY_CODES['EUR'] = '978'
82
82
  CURRENCY_CODES['USD'] = '840'
@@ -125,7 +125,7 @@ module ActiveMerchant #:nodoc:
125
125
  response
126
126
  end
127
127
 
128
- def commit(action, post, options={})
128
+ def commit(action, post, options = {})
129
129
  post[:Version] = '1000'
130
130
  post[:Processor] = @options[:processor]
131
131
  post[:MerchantID] = @options[:merchant_id]
@@ -176,11 +176,11 @@ module ActiveMerchant #:nodoc:
176
176
 
177
177
  def headers
178
178
  {
179
- 'Authorization' => 'Basic ' + Base64.strict_encode64(@options[:username].to_s + ':' + @options[:password].to_s),
179
+ 'Authorization' => 'Basic ' + Base64.strict_encode64(@options[:username].to_s + ':' + @options[:password].to_s)
180
180
  }
181
181
  end
182
182
 
183
- def build_request(action, post, options={})
183
+ def build_request(action, post, options = {})
184
184
  mode = action == 'void' ? 'cancel' : 'get'
185
185
  xml = Builder::XmlMarkup.new indent: 18
186
186
  xml.instruct!(:xml, version: '1.0', encoding: 'utf-8')
@@ -205,7 +205,7 @@ module ActiveMerchant #:nodoc:
205
205
  end
206
206
 
207
207
  def envelope(mode)
208
- <<-EOS
208
+ <<-XML
209
209
  <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:aut="http://Borgun/Heimir/pub/ws/Authorization">
210
210
  <soapenv:Header/>
211
211
  <soapenv:Body>
@@ -216,7 +216,7 @@ module ActiveMerchant #:nodoc:
216
216
  </aut:#{mode}AuthorizationInput>
217
217
  </soapenv:Body>
218
218
  </soapenv:Envelope>
219
- EOS
219
+ XML
220
220
  end
221
221
 
222
222
  def url(action)
@@ -12,12 +12,12 @@ module ActiveMerchant #:nodoc:
12
12
  self.homepage_url = 'https://www.bpoint.com.au/bpoint'
13
13
  self.display_name = 'BPoint'
14
14
 
15
- def initialize(options={})
15
+ def initialize(options = {})
16
16
  requires!(options, :username, :password, :merchant_number)
17
17
  super
18
18
  end
19
19
 
20
- def store(credit_card, options={})
20
+ def store(credit_card, options = {})
21
21
  options[:crn1] ||= 'DEFAULT'
22
22
  request_body = soap_request do |xml|
23
23
  add_token(xml, credit_card, options)
@@ -25,7 +25,7 @@ module ActiveMerchant #:nodoc:
25
25
  commit(request_body)
26
26
  end
27
27
 
28
- def purchase(amount, credit_card, options={})
28
+ def purchase(amount, credit_card, options = {})
29
29
  request_body = soap_request do |xml|
30
30
  process_payment(xml) do |payment_xml|
31
31
  add_purchase(payment_xml, amount, credit_card, options)
@@ -34,7 +34,7 @@ module ActiveMerchant #:nodoc:
34
34
  commit(request_body)
35
35
  end
36
36
 
37
- def authorize(amount, credit_card, options={})
37
+ def authorize(amount, credit_card, options = {})
38
38
  request_body = soap_request do |xml|
39
39
  process_payment(xml) do |payment_xml|
40
40
  add_authorize(payment_xml, amount, credit_card, options)
@@ -43,7 +43,7 @@ module ActiveMerchant #:nodoc:
43
43
  commit(request_body)
44
44
  end
45
45
 
46
- def capture(amount, authorization, options={})
46
+ def capture(amount, authorization, options = {})
47
47
  request_body = soap_request do |xml|
48
48
  process_payment(xml) do |payment_xml|
49
49
  add_capture(payment_xml, amount, authorization, options)
@@ -52,7 +52,7 @@ module ActiveMerchant #:nodoc:
52
52
  commit(request_body)
53
53
  end
54
54
 
55
- def refund(amount, authorization, options={})
55
+ def refund(amount, authorization, options = {})
56
56
  request_body = soap_request do |xml|
57
57
  process_payment(xml) do |payment_xml|
58
58
  add_refund(payment_xml, amount, authorization, options)
@@ -61,7 +61,7 @@ module ActiveMerchant #:nodoc:
61
61
  commit(request_body)
62
62
  end
63
63
 
64
- def void(authorization, options={})
64
+ def void(authorization, options = {})
65
65
  request_body = soap_request do |xml|
66
66
  process_payment(xml) do |payment_xml|
67
67
  add_void(payment_xml, authorization, options)
@@ -70,7 +70,7 @@ module ActiveMerchant #:nodoc:
70
70
  commit(request_body)
71
71
  end
72
72
 
73
- def verify(credit_card, options={})
73
+ def verify(credit_card, options = {})
74
74
  MultiResponse.run(:use_first_response) do |r|
75
75
  r.process { authorize(100, credit_card, options) }
76
76
  r.process(:ignore_result) { void(r.authorization, options.merge(amount: 100)) }
@@ -7,7 +7,7 @@ module ActiveMerchant #:nodoc:
7
7
 
8
8
  self.abstract_class = true
9
9
 
10
- def self.new(options={})
10
+ def self.new(options = {})
11
11
  if options.has_key?(:login)
12
12
  BraintreeOrangeGateway.new(options)
13
13
  else
@@ -163,12 +163,10 @@ module ActiveMerchant #:nodoc:
163
163
  email: scrub_email(options[:email]),
164
164
  phone: options[:phone] || (options[:billing_address][:phone] if options[:billing_address] &&
165
165
  options[:billing_address][:phone]),
166
- credit_card: credit_card_params
167
- )
166
+ credit_card: credit_card_params)
168
167
  Response.new(result.success?, message_from_result(result),
169
168
  braintree_customer: (customer_hash(@braintree_gateway.customer.find(vault_id), :include_credit_cards) if result.success?),
170
- customer_vault_id: (result.customer.id if result.success?)
171
- )
169
+ customer_vault_id: (result.customer.id if result.success?))
172
170
  end
173
171
  end
174
172
 
@@ -182,7 +180,7 @@ module ActiveMerchant #:nodoc:
182
180
  Response.new(true, 'OK')
183
181
  end
184
182
  end
185
- alias_method :delete, :unstore
183
+ alias delete unstore
186
184
 
187
185
  def supports_network_tokenization?
188
186
  true
@@ -205,9 +203,9 @@ module ActiveMerchant #:nodoc:
205
203
  def check_customer_exists(customer_vault_id)
206
204
  commit do
207
205
  @braintree_gateway.customer.find(customer_vault_id)
208
- ActiveMerchant::Billing::Response.new(true, 'Customer found', {exists: true}, authorization: customer_vault_id)
206
+ ActiveMerchant::Billing::Response.new(true, 'Customer found', { exists: true }, authorization: customer_vault_id)
209
207
  rescue Braintree::NotFoundError
210
- ActiveMerchant::Billing::Response.new(true, 'Customer not found', {exists: false})
208
+ ActiveMerchant::Billing::Response.new(true, 'Customer not found', { exists: false })
211
209
  end
212
210
  end
213
211
 
@@ -234,7 +232,7 @@ module ActiveMerchant #:nodoc:
234
232
  phone: options[:phone] || (options[:billing_address][:phone] if options[:billing_address] &&
235
233
  options[:billing_address][:phone]),
236
234
  id: options[:customer],
237
- device_data: options[:device_data],
235
+ device_data: options[:device_data]
238
236
  }.merge credit_card_params
239
237
  result = @braintree_gateway.customer.create(merge_credit_card_options(parameters, options))
240
238
  Response.new(result.success?, message_from_result(result),
@@ -243,8 +241,7 @@ module ActiveMerchant #:nodoc:
243
241
  customer_vault_id: (result.customer.id if result.success?),
244
242
  credit_card_token: (result.customer.credit_cards[0].token if result.success?)
245
243
  },
246
- authorization: (result.customer.id if result.success?)
247
- )
244
+ authorization: (result.customer.id if result.success?))
248
245
  end
249
246
  end
250
247
 
@@ -258,7 +255,7 @@ module ActiveMerchant #:nodoc:
258
255
  cvv: credit_card.verification_value,
259
256
  expiration_month: credit_card.month.to_s.rjust(2, '0'),
260
257
  expiration_year: credit_card.year.to_s,
261
- device_data: options[:device_data],
258
+ device_data: options[:device_data]
262
259
  }
263
260
  if options[:billing_address]
264
261
  address = map_address(options[:billing_address])
@@ -320,7 +317,7 @@ module ActiveMerchant #:nodoc:
320
317
  company: address[:company],
321
318
  locality: address[:city],
322
319
  region: address[:state],
323
- postal_code: scrub_zip(address[:zip]),
320
+ postal_code: scrub_zip(address[:zip])
324
321
  }
325
322
 
326
323
  mapped[:country_code_alpha2] = (address[:country] || address[:country_code_alpha2]) if address[:country] || address[:country_code_alpha2]
@@ -464,7 +461,7 @@ module ActiveMerchant #:nodoc:
464
461
  end
465
462
  end
466
463
 
467
- def customer_hash(customer, include_credit_cards=false)
464
+ def customer_hash(customer, include_credit_cards = false)
468
465
  hash = {
469
466
  'email' => customer.email,
470
467
  'phone' => customer.phone,
@@ -508,7 +505,7 @@ module ActiveMerchant #:nodoc:
508
505
  customer_details = {
509
506
  'id' => transaction.customer_details.id,
510
507
  'email' => transaction.customer_details.email,
511
- 'phone' => transaction.customer_details.phone,
508
+ 'phone' => transaction.customer_details.phone
512
509
  }
513
510
 
514
511
  billing_details = {
@@ -518,7 +515,7 @@ module ActiveMerchant #:nodoc:
518
515
  'locality' => transaction.billing_details.locality,
519
516
  'region' => transaction.billing_details.region,
520
517
  'postal_code' => transaction.billing_details.postal_code,
521
- 'country_name' => transaction.billing_details.country_name,
518
+ 'country_name' => transaction.billing_details.country_name
522
519
  }
523
520
 
524
521
  shipping_details = {
@@ -528,7 +525,7 @@ module ActiveMerchant #:nodoc:
528
525
  'locality' => transaction.shipping_details.locality,
529
526
  'region' => transaction.shipping_details.region,
530
527
  'postal_code' => transaction.shipping_details.postal_code,
531
- 'country_name' => transaction.shipping_details.country_name,
528
+ 'country_name' => transaction.shipping_details.country_name
532
529
  }
533
530
  credit_card_details = {
534
531
  'masked_number' => transaction.credit_card_details.masked_number,
@@ -578,7 +575,7 @@ module ActiveMerchant #:nodoc:
578
575
  options: {
579
576
  store_in_vault: options[:store] ? true : false,
580
577
  submit_for_settlement: options[:submit_for_settlement],
581
- hold_in_escrow: options[:hold_in_escrow],
578
+ hold_in_escrow: options[:hold_in_escrow]
582
579
  }
583
580
  }
584
581
 
@@ -13,12 +13,12 @@ module ActiveMerchant #:nodoc:
13
13
  self.default_currency = 'USD'
14
14
  self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
15
15
 
16
- def initialize(options={})
16
+ def initialize(options = {})
17
17
  requires!(options, :user_name, :password)
18
18
  super
19
19
  end
20
20
 
21
- def purchase(amount, payment_method, options={})
21
+ def purchase(amount, payment_method, options = {})
22
22
  post = initialize_required_fields('Sale')
23
23
 
24
24
  # Allow the same amount in multiple transactions.
@@ -30,7 +30,7 @@ module ActiveMerchant #:nodoc:
30
30
  commit(post)
31
31
  end
32
32
 
33
- def authorize(amount, payment_method, options={})
33
+ def authorize(amount, payment_method, options = {})
34
34
  post = initialize_required_fields('Auth')
35
35
 
36
36
  add_invoice(post, amount, options)
@@ -40,7 +40,7 @@ module ActiveMerchant #:nodoc:
40
40
  commit(post)
41
41
  end
42
42
 
43
- def capture(amount, authorization, options={})
43
+ def capture(amount, authorization, options = {})
44
44
  post = initialize_required_fields('Force')
45
45
 
46
46
  add_invoice(post, amount, options)
@@ -50,7 +50,7 @@ module ActiveMerchant #:nodoc:
50
50
  commit(post)
51
51
  end
52
52
 
53
- def refund(amount, authorization, options={})
53
+ def refund(amount, authorization, options = {})
54
54
  post = initialize_required_fields('Return')
55
55
 
56
56
  add_invoice(post, amount, options)
@@ -59,7 +59,7 @@ module ActiveMerchant #:nodoc:
59
59
  commit(post)
60
60
  end
61
61
 
62
- def void(authorization, options={})
62
+ def void(authorization, options = {})
63
63
  post = initialize_required_fields('Void')
64
64
 
65
65
  add_reference(post, authorization)
@@ -74,7 +74,7 @@ module ActiveMerchant #:nodoc:
74
74
  end
75
75
  end
76
76
 
77
- def store(creditcard, options={})
77
+ def store(creditcard, options = {})
78
78
  post = initialize_required_fields('')
79
79
  post[:transaction] = 'Create'
80
80
  post[:CardNumber] = creditcard.number