activemerchant 1.114.0 → 1.120.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (206) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +183 -0
  3. data/README.md +4 -2
  4. data/lib/active_merchant.rb +1 -1
  5. data/lib/active_merchant/billing/avs_result.rb +1 -1
  6. data/lib/active_merchant/billing/check.rb +10 -0
  7. data/lib/active_merchant/billing/compatibility.rb +3 -3
  8. data/lib/active_merchant/billing/credit_card.rb +3 -0
  9. data/lib/active_merchant/billing/credit_card_methods.rb +80 -15
  10. data/lib/active_merchant/billing/gateways/adyen.rb +44 -20
  11. data/lib/active_merchant/billing/gateways/allied_wallet.rb +7 -7
  12. data/lib/active_merchant/billing/gateways/authorize_net.rb +50 -12
  13. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -4
  14. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +5 -1
  15. data/lib/active_merchant/billing/gateways/axcessms.rb +8 -9
  16. data/lib/active_merchant/billing/gateways/balanced.rb +4 -3
  17. data/lib/active_merchant/billing/gateways/bambora_apac.rb +7 -7
  18. data/lib/active_merchant/billing/gateways/bank_frick.rb +7 -7
  19. data/lib/active_merchant/billing/gateways/banwire.rb +1 -1
  20. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +6 -4
  21. data/lib/active_merchant/billing/gateways/beanstream.rb +3 -3
  22. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +4 -5
  23. data/lib/active_merchant/billing/gateways/blue_pay.rb +2 -3
  24. data/lib/active_merchant/billing/gateways/blue_snap.rb +22 -18
  25. data/lib/active_merchant/billing/gateways/bogus.rb +19 -19
  26. data/lib/active_merchant/billing/gateways/borgun.rb +11 -11
  27. data/lib/active_merchant/billing/gateways/bpoint.rb +8 -8
  28. data/lib/active_merchant/billing/gateways/braintree.rb +1 -1
  29. data/lib/active_merchant/billing/gateways/braintree_blue.rb +60 -17
  30. data/lib/active_merchant/billing/gateways/bridge_pay.rb +7 -7
  31. data/lib/active_merchant/billing/gateways/cams.rb +8 -8
  32. data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
  33. data/lib/active_merchant/billing/gateways/card_save.rb +1 -1
  34. data/lib/active_merchant/billing/gateways/card_stream.rb +2 -2
  35. data/lib/active_merchant/billing/gateways/cardknox.rb +7 -7
  36. data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
  37. data/lib/active_merchant/billing/gateways/cashnet.rb +7 -2
  38. data/lib/active_merchant/billing/gateways/cecabank.rb +5 -5
  39. data/lib/active_merchant/billing/gateways/cenpos.rb +10 -10
  40. data/lib/active_merchant/billing/gateways/checkout.rb +2 -2
  41. data/lib/active_merchant/billing/gateways/checkout_v2.rb +38 -20
  42. data/lib/active_merchant/billing/gateways/clearhaus.rb +7 -7
  43. data/lib/active_merchant/billing/gateways/commercegate.rb +1 -1
  44. data/lib/active_merchant/billing/gateways/conekta.rb +2 -2
  45. data/lib/active_merchant/billing/gateways/creditcall.rb +10 -10
  46. data/lib/active_merchant/billing/gateways/credorax.rb +39 -23
  47. data/lib/active_merchant/billing/gateways/ct_payment.rb +10 -10
  48. data/lib/active_merchant/billing/gateways/culqi.rb +9 -9
  49. data/lib/active_merchant/billing/gateways/cyber_source.rb +81 -39
  50. data/lib/active_merchant/billing/gateways/d_local.rb +12 -12
  51. data/lib/active_merchant/billing/gateways/data_cash.rb +2 -3
  52. data/lib/active_merchant/billing/gateways/decidir.rb +31 -10
  53. data/lib/active_merchant/billing/gateways/dibs.rb +8 -8
  54. data/lib/active_merchant/billing/gateways/digitzs.rb +5 -5
  55. data/lib/active_merchant/billing/gateways/ebanx.rb +9 -9
  56. data/lib/active_merchant/billing/gateways/efsnet.rb +2 -3
  57. data/lib/active_merchant/billing/gateways/elavon.rb +296 -225
  58. data/lib/active_merchant/billing/gateways/element.rb +8 -8
  59. data/lib/active_merchant/billing/gateways/evo_ca.rb +5 -6
  60. data/lib/active_merchant/billing/gateways/eway.rb +3 -4
  61. data/lib/active_merchant/billing/gateways/eway_managed.rb +6 -7
  62. data/lib/active_merchant/billing/gateways/eway_rapid.rb +19 -6
  63. data/lib/active_merchant/billing/gateways/exact.rb +8 -9
  64. data/lib/active_merchant/billing/gateways/ezic.rb +7 -7
  65. data/lib/active_merchant/billing/gateways/fat_zebra.rb +4 -4
  66. data/lib/active_merchant/billing/gateways/federated_canada.rb +2 -3
  67. data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
  68. data/lib/active_merchant/billing/gateways/first_pay.rb +6 -6
  69. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +7 -7
  70. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +21 -10
  71. data/lib/active_merchant/billing/gateways/flo2cash.rb +8 -8
  72. data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
  73. data/lib/active_merchant/billing/gateways/forte.rb +26 -8
  74. data/lib/active_merchant/billing/gateways/global_collect.rb +35 -16
  75. data/lib/active_merchant/billing/gateways/global_transport.rb +7 -7
  76. data/lib/active_merchant/billing/gateways/hdfc.rb +9 -9
  77. data/lib/active_merchant/billing/gateways/hps.rb +72 -9
  78. data/lib/active_merchant/billing/gateways/iats_payments.rb +9 -4
  79. data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
  80. data/lib/active_merchant/billing/gateways/inspire.rb +3 -4
  81. data/lib/active_merchant/billing/gateways/instapay.rb +1 -2
  82. data/lib/active_merchant/billing/gateways/ipp.rb +5 -5
  83. data/lib/active_merchant/billing/gateways/iridium.rb +14 -15
  84. data/lib/active_merchant/billing/gateways/iveri.rb +7 -7
  85. data/lib/active_merchant/billing/gateways/ixopay.rb +7 -7
  86. data/lib/active_merchant/billing/gateways/jetpay.rb +1 -2
  87. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +4 -5
  88. data/lib/active_merchant/billing/gateways/kushki.rb +6 -6
  89. data/lib/active_merchant/billing/gateways/latitude19.rb +14 -14
  90. data/lib/active_merchant/billing/gateways/linkpoint.rb +4 -5
  91. data/lib/active_merchant/billing/gateways/litle.rb +32 -16
  92. data/lib/active_merchant/billing/gateways/mastercard.rb +10 -10
  93. data/lib/active_merchant/billing/gateways/mercado_pago.rb +9 -9
  94. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +1 -2
  95. data/lib/active_merchant/billing/gateways/merchant_one.rb +1 -1
  96. data/lib/active_merchant/billing/gateways/merchant_partners.rb +10 -10
  97. data/lib/active_merchant/billing/gateways/merchant_ware.rb +5 -7
  98. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +4 -6
  99. data/lib/active_merchant/billing/gateways/mercury.rb +4 -4
  100. data/lib/active_merchant/billing/gateways/metrics_global.rb +4 -5
  101. data/lib/active_merchant/billing/gateways/micropayment.rb +8 -8
  102. data/lib/active_merchant/billing/gateways/migs.rb +3 -4
  103. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +2 -4
  104. data/lib/active_merchant/billing/gateways/monei.rb +7 -7
  105. data/lib/active_merchant/billing/gateways/moneris.rb +4 -3
  106. data/lib/active_merchant/billing/gateways/money_movers.rb +2 -3
  107. data/lib/active_merchant/billing/gateways/mundipagg.rb +37 -10
  108. data/lib/active_merchant/billing/gateways/nab_transact.rb +2 -4
  109. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +7 -7
  110. data/lib/active_merchant/billing/gateways/net_registry.rb +1 -2
  111. data/lib/active_merchant/billing/gateways/netaxept.rb +6 -6
  112. data/lib/active_merchant/billing/gateways/netbanx.rb +45 -10
  113. data/lib/active_merchant/billing/gateways/netbilling.rb +4 -5
  114. data/lib/active_merchant/billing/gateways/network_merchants.rb +2 -3
  115. data/lib/active_merchant/billing/gateways/nmi.rb +21 -7
  116. data/lib/active_merchant/billing/gateways/ogone.rb +3 -3
  117. data/lib/active_merchant/billing/gateways/omise.rb +13 -13
  118. data/lib/active_merchant/billing/gateways/openpay.rb +3 -4
  119. data/lib/active_merchant/billing/gateways/opp.rb +9 -9
  120. data/lib/active_merchant/billing/gateways/optimal_payment.rb +2 -3
  121. data/lib/active_merchant/billing/gateways/orbital.rb +225 -105
  122. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +3 -4
  123. data/lib/active_merchant/billing/gateways/pagarme.rb +8 -8
  124. data/lib/active_merchant/billing/gateways/pago_facil.rb +2 -2
  125. data/lib/active_merchant/billing/gateways/pay_conex.rb +8 -8
  126. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +6 -7
  127. data/lib/active_merchant/billing/gateways/pay_hub.rb +7 -8
  128. data/lib/active_merchant/billing/gateways/pay_junction.rb +2 -3
  129. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +9 -9
  130. data/lib/active_merchant/billing/gateways/pay_secure.rb +2 -3
  131. data/lib/active_merchant/billing/gateways/paybox_direct.rb +23 -1
  132. data/lib/active_merchant/billing/gateways/payeezy.rb +62 -20
  133. data/lib/active_merchant/billing/gateways/payex.rb +6 -7
  134. data/lib/active_merchant/billing/gateways/payflow.rb +1 -1
  135. data/lib/active_merchant/billing/gateways/payment_express.rb +11 -7
  136. data/lib/active_merchant/billing/gateways/paymentez.rb +26 -6
  137. data/lib/active_merchant/billing/gateways/paymill.rb +7 -7
  138. data/lib/active_merchant/billing/gateways/paypal.rb +10 -2
  139. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +1 -0
  140. data/lib/active_merchant/billing/gateways/paypal_express.rb +1 -1
  141. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
  142. data/lib/active_merchant/billing/gateways/payscout.rb +1 -2
  143. data/lib/active_merchant/billing/gateways/paystation.rb +3 -4
  144. data/lib/active_merchant/billing/gateways/payu_in.rb +3 -3
  145. data/lib/active_merchant/billing/gateways/payu_latam.rb +17 -10
  146. data/lib/active_merchant/billing/gateways/payway.rb +8 -9
  147. data/lib/active_merchant/billing/gateways/payway_dot_com.rb +253 -0
  148. data/lib/active_merchant/billing/gateways/pin.rb +11 -0
  149. data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -2
  150. data/lib/active_merchant/billing/gateways/pro_pay.rb +8 -8
  151. data/lib/active_merchant/billing/gateways/psigate.rb +2 -3
  152. data/lib/active_merchant/billing/gateways/psl_card.rb +1 -2
  153. data/lib/active_merchant/billing/gateways/qbms.rb +1 -2
  154. data/lib/active_merchant/billing/gateways/quantum.rb +1 -2
  155. data/lib/active_merchant/billing/gateways/quickbooks.rb +1 -1
  156. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +3 -4
  157. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +1 -2
  158. data/lib/active_merchant/billing/gateways/qvalent.rb +31 -17
  159. data/lib/active_merchant/billing/gateways/realex.rb +1 -1
  160. data/lib/active_merchant/billing/gateways/redsys.rb +105 -9
  161. data/lib/active_merchant/billing/gateways/s5.rb +7 -7
  162. data/lib/active_merchant/billing/gateways/safe_charge.rb +51 -18
  163. data/lib/active_merchant/billing/gateways/sage.rb +3 -5
  164. data/lib/active_merchant/billing/gateways/sage_pay.rb +2 -3
  165. data/lib/active_merchant/billing/gateways/sallie_mae.rb +1 -2
  166. data/lib/active_merchant/billing/gateways/secure_net.rb +1 -2
  167. data/lib/active_merchant/billing/gateways/secure_pay.rb +3 -4
  168. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +2 -4
  169. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +1 -2
  170. data/lib/active_merchant/billing/gateways/securion_pay.rb +5 -6
  171. data/lib/active_merchant/billing/gateways/skip_jack.rb +2 -3
  172. data/lib/active_merchant/billing/gateways/smart_ps.rb +5 -6
  173. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +7 -7
  174. data/lib/active_merchant/billing/gateways/spreedly_core.rb +6 -6
  175. data/lib/active_merchant/billing/gateways/stripe.rb +18 -18
  176. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +91 -25
  177. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +3 -4
  178. data/lib/active_merchant/billing/gateways/telr.rb +8 -8
  179. data/lib/active_merchant/billing/gateways/trans_first.rb +2 -2
  180. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +12 -12
  181. data/lib/active_merchant/billing/gateways/transact_pro.rb +9 -9
  182. data/lib/active_merchant/billing/gateways/trust_commerce.rb +1 -2
  183. data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -1
  184. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +32 -32
  185. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +3 -4
  186. data/lib/active_merchant/billing/gateways/vanco.rb +3 -3
  187. data/lib/active_merchant/billing/gateways/verifi.rb +1 -2
  188. data/lib/active_merchant/billing/gateways/viaklix.rb +1 -2
  189. data/lib/active_merchant/billing/gateways/visanet_peru.rb +10 -10
  190. data/lib/active_merchant/billing/gateways/vpos.rb +172 -0
  191. data/lib/active_merchant/billing/gateways/webpay.rb +2 -2
  192. data/lib/active_merchant/billing/gateways/wepay.rb +3 -2
  193. data/lib/active_merchant/billing/gateways/wirecard.rb +1 -2
  194. data/lib/active_merchant/billing/gateways/worldpay.rb +43 -22
  195. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +14 -16
  196. data/lib/active_merchant/billing/gateways/worldpay_us.rb +7 -7
  197. data/lib/active_merchant/billing/response.rb +3 -2
  198. data/lib/active_merchant/country.rb +1 -1
  199. data/lib/active_merchant/network_connection_retries.rb +2 -2
  200. data/lib/active_merchant/post_data.rb +1 -1
  201. data/lib/active_merchant/posts_data.rb +1 -1
  202. data/lib/active_merchant/version.rb +1 -1
  203. data/lib/certs/cacert.pem +1582 -2431
  204. data/lib/support/ssl_verify.rb +2 -2
  205. data/lib/support/ssl_version.rb +2 -2
  206. metadata +5 -3
@@ -15,15 +15,26 @@ module ActiveMerchant #:nodoc:
15
15
 
16
16
  VERSION = '4.1.0'
17
17
 
18
- def initialize(options={})
18
+ def initialize(options = {})
19
19
  requires!(options, :client_login_id, :client_password)
20
20
  super
21
21
  end
22
22
 
23
- def purchase(money, payment, options={})
23
+ def purchase(money, payment, options = {})
24
24
  post = {}
25
- post[:sg_APIType] = 1 if options[:three_d_secure]
26
- trans_type = options[:three_d_secure] ? 'Sale3D' : 'Sale'
25
+
26
+ # Determine if 3DS is requested, or there is standard external MPI data
27
+ if options[:three_d_secure]
28
+ if options[:three_d_secure].is_a?(Hash)
29
+ add_external_mpi_data(post, options)
30
+ else
31
+ post[:sg_APIType] = 1
32
+ trans_type = 'Sale3D'
33
+ end
34
+ end
35
+
36
+ trans_type ||= 'Sale'
37
+
27
38
  add_transaction_data(trans_type, post, money, options)
28
39
  add_payment(post, payment, options)
29
40
  add_customer_details(post, payment, options)
@@ -31,8 +42,10 @@ module ActiveMerchant #:nodoc:
31
42
  commit(post)
32
43
  end
33
44
 
34
- def authorize(money, payment, options={})
45
+ def authorize(money, payment, options = {})
35
46
  post = {}
47
+
48
+ add_external_mpi_data(post, options) if options[:three_d_secure]&.is_a?(Hash)
36
49
  add_transaction_data('Auth', post, money, options)
37
50
  add_payment(post, payment, options)
38
51
  add_customer_details(post, payment, options)
@@ -40,10 +53,10 @@ module ActiveMerchant #:nodoc:
40
53
  commit(post)
41
54
  end
42
55
 
43
- def capture(money, authorization, options={})
56
+ def capture(money, authorization, options = {})
44
57
  post = {}
45
58
  auth, transaction_id, token, exp_month, exp_year, _, original_currency = authorization.split('|')
46
- add_transaction_data('Settle', post, money, options.merge!({currency: original_currency}))
59
+ add_transaction_data('Settle', post, money, options.merge!({ currency: original_currency }))
47
60
  post[:sg_AuthCode] = auth
48
61
  post[:sg_TransactionID] = transaction_id
49
62
  post[:sg_CCToken] = token
@@ -53,10 +66,10 @@ module ActiveMerchant #:nodoc:
53
66
  commit(post)
54
67
  end
55
68
 
56
- def refund(money, authorization, options={})
69
+ def refund(money, authorization, options = {})
57
70
  post = {}
58
71
  auth, transaction_id, token, exp_month, exp_year, _, original_currency = authorization.split('|')
59
- add_transaction_data('Credit', post, money, options.merge!({currency: original_currency}))
72
+ add_transaction_data('Credit', post, money, options.merge!({ currency: original_currency }))
60
73
  post[:sg_CreditType] = 2
61
74
  post[:sg_AuthCode] = auth
62
75
  post[:sg_TransactionID] = transaction_id
@@ -67,19 +80,21 @@ module ActiveMerchant #:nodoc:
67
80
  commit(post)
68
81
  end
69
82
 
70
- def credit(money, payment, options={})
83
+ def credit(money, payment, options = {})
71
84
  post = {}
85
+
72
86
  add_payment(post, payment, options)
73
87
  add_transaction_data('Credit', post, money, options)
88
+
74
89
  post[:sg_CreditType] = 1
75
90
 
76
91
  commit(post)
77
92
  end
78
93
 
79
- def void(authorization, options={})
94
+ def void(authorization, options = {})
80
95
  post = {}
81
96
  auth, transaction_id, token, exp_month, exp_year, original_amount, original_currency = authorization.split('|')
82
- add_transaction_data('Void', post, (original_amount.to_f * 100), options.merge!({currency: original_currency}))
97
+ add_transaction_data('Void', post, (original_amount.to_f * 100), options.merge!({ currency: original_currency }))
83
98
  post[:sg_CreditType] = 2
84
99
  post[:sg_AuthCode] = auth
85
100
  post[:sg_TransactionID] = transaction_id
@@ -90,7 +105,7 @@ module ActiveMerchant #:nodoc:
90
105
  commit(post)
91
106
  end
92
107
 
93
- def verify(credit_card, options={})
108
+ def verify(credit_card, options = {})
94
109
  MultiResponse.run(:use_first_response) do |r|
95
110
  r.process { authorize(100, credit_card, options) }
96
111
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -130,13 +145,21 @@ module ActiveMerchant #:nodoc:
130
145
  post[:sg_MerchantName] = options[:merchant_name] if options[:merchant_name]
131
146
  end
132
147
 
133
- def add_payment(post, payment, options={})
134
- post[:sg_NameOnCard] = payment.name
135
- post[:sg_CardNumber] = payment.number
148
+ def add_payment(post, payment, options = {})
136
149
  post[:sg_ExpMonth] = format(payment.month, :two_digits)
137
150
  post[:sg_ExpYear] = format(payment.year, :two_digits)
138
- post[:sg_CVV2] = payment.verification_value
139
- post[:sg_StoredCredentialMode] = (options[:stored_credential_mode] == true ? 1 : 0)
151
+ post[:sg_CardNumber] = payment.number
152
+
153
+ if payment.is_a?(NetworkTokenizationCreditCard) && payment.source == :network_token
154
+ post[:sg_CAVV] = payment.payment_cryptogram
155
+ post[:sg_ECI] = options[:three_d_secure] && options[:three_d_secure][:eci] || '05'
156
+ post[:sg_IsExternalMPI] = 1
157
+ post[:sg_ExternalTokenProvider] = 5
158
+ else
159
+ post[:sg_CVV2] = payment.verification_value
160
+ post[:sg_NameOnCard] = payment.name
161
+ post[:sg_StoredCredentialMode] = (options[:stored_credential_mode] == true ? 1 : 0)
162
+ end
140
163
  end
141
164
 
142
165
  def add_customer_details(post, payment, options)
@@ -154,6 +177,16 @@ module ActiveMerchant #:nodoc:
154
177
  post[:sg_Email] = options[:email]
155
178
  end
156
179
 
180
+ def add_external_mpi_data(post, options)
181
+ post[:sg_ECI] = options[:three_d_secure][:eci] if options[:three_d_secure][:eci]
182
+ post[:sg_CAVV] = options[:three_d_secure][:cavv] if options[:three_d_secure][:cavv]
183
+ post[:sg_dsTransID] = options[:three_d_secure][:ds_transaction_id] if options[:three_d_secure][:ds_transaction_id]
184
+ post[:sg_threeDSProtocolVersion] = options[:three_d_secure][:ds_transaction_id] ? '2' : '1'
185
+ post[:sg_Xid] = options[:three_d_secure][:xid]
186
+ post[:sg_IsExternalMPI] = 1
187
+ post[:sg_EnablePartialApproval] = options[:is_partial_approval]
188
+ end
189
+
157
190
  def parse(xml)
158
191
  response = {}
159
192
 
@@ -77,7 +77,7 @@ module ActiveMerchant #:nodoc:
77
77
  commit(:credit, post, source)
78
78
  end
79
79
 
80
- def refund(money, reference, options={})
80
+ def refund(money, reference, options = {})
81
81
  post = {}
82
82
  add_reference(post, reference)
83
83
  add_transaction_data(post, money, options)
@@ -264,8 +264,7 @@ module ActiveMerchant #:nodoc:
264
264
  test: test?,
265
265
  authorization: authorization_from(response, source),
266
266
  avs_result: { code: response[:avs_result] },
267
- cvv_result: response[:cvv_result]
268
- )
267
+ cvv_result: response[:cvv_result])
269
268
  end
270
269
 
271
270
  def url(params, source)
@@ -382,8 +381,7 @@ module ActiveMerchant #:nodoc:
382
381
  end
383
382
 
384
383
  Response.new(success, message, response,
385
- authorization: response[:guid]
386
- )
384
+ authorization: response[:guid])
387
385
  end
388
386
 
389
387
  ENVELOPE_NAMESPACES = {
@@ -162,7 +162,7 @@ module ActiveMerchant #:nodoc:
162
162
  commit(:unstore, post)
163
163
  end
164
164
 
165
- def verify(credit_card, options={})
165
+ def verify(credit_card, options = {})
166
166
  MultiResponse.run(:use_first_response) do |r|
167
167
  r.process { authorize(100, credit_card, options) }
168
168
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -353,8 +353,7 @@ module ActiveMerchant #:nodoc:
353
353
  street_match: AVS_CODE[response['AddressResult']],
354
354
  postal_match: AVS_CODE[response['PostCodeResult']]
355
355
  },
356
- cvv_result: CVV_CODE[response['CV2Result']]
357
- )
356
+ cvv_result: CVV_CODE[response['CV2Result']])
358
357
  end
359
358
 
360
359
  def authorization_from(response, params, action)
@@ -122,8 +122,7 @@ module ActiveMerchant #:nodoc:
122
122
  response = parse(ssl_post(self.live_url, parameters.to_post_data) || '')
123
123
  Response.new(successful?(response), message_from(response), response,
124
124
  test: test?,
125
- authorization: response['refcode']
126
- )
125
+ authorization: response['refcode'])
127
126
  end
128
127
 
129
128
  def successful?(response)
@@ -83,8 +83,7 @@ module ActiveMerchant #:nodoc:
83
83
  test: test?,
84
84
  authorization: build_authorization(response),
85
85
  avs_result: { code: response[:avs_result_code] },
86
- cvv_result: response[:card_code_response_code]
87
- )
86
+ cvv_result: response[:card_code_response_code])
88
87
  end
89
88
 
90
89
  def build_request(request)
@@ -61,8 +61,7 @@ module ActiveMerchant #:nodoc:
61
61
  authorization: response[:transaction_id],
62
62
  fraud_review: fraud_review?(response),
63
63
  avs_result: { code: response[:avs_result_code] },
64
- cvv_result: response[:card_code]
65
- )
64
+ cvv_result: response[:card_code])
66
65
  end
67
66
 
68
67
  def success?(response)
@@ -115,7 +114,7 @@ module ActiveMerchant #:nodoc:
115
114
  post[:description] = options[:description]
116
115
  end
117
116
 
118
- def add_creditcard(post, creditcard, options={})
117
+ def add_creditcard(post, creditcard, options = {})
119
118
  post[:card_num] = creditcard.number
120
119
  post[:card_code] = creditcard.verification_value if creditcard.verification_value?
121
120
  post[:exp_date] = expdate(creditcard)
@@ -123,7 +122,7 @@ module ActiveMerchant #:nodoc:
123
122
  post[:last_name] = creditcard.last_name
124
123
  end
125
124
 
126
- def add_payment_source(params, source, options={})
125
+ def add_payment_source(params, source, options = {})
127
126
  add_creditcard(params, source, options)
128
127
  end
129
128
 
@@ -185,8 +185,7 @@ module ActiveMerchant #:nodoc:
185
185
 
186
186
  Response.new(success?(response), message_from(response), response,
187
187
  test: test?,
188
- authorization: authorization_from(response)
189
- )
188
+ authorization: authorization_from(response))
190
189
  end
191
190
 
192
191
  def build_periodic_item(action, money, credit_card, options)
@@ -242,8 +241,7 @@ module ActiveMerchant #:nodoc:
242
241
 
243
242
  Response.new(success?(response), message_from(response), response,
244
243
  test: test?,
245
- authorization: authorization_from(response)
246
- )
244
+ authorization: authorization_from(response))
247
245
  end
248
246
 
249
247
  def success?(response)
@@ -86,8 +86,7 @@ module ActiveMerchant #:nodoc:
86
86
 
87
87
  Response.new(response[:result_code] == 1, message_from(response), response,
88
88
  test: test?,
89
- authorization: response[:merchant_transaction_reference]
90
- )
89
+ authorization: response[:merchant_transaction_reference])
91
90
  end
92
91
 
93
92
  def message_from(result)
@@ -31,17 +31,17 @@ module ActiveMerchant #:nodoc:
31
31
  'expired_token' => STANDARD_ERROR_CODE[:card_declined]
32
32
  }
33
33
 
34
- def initialize(options={})
34
+ def initialize(options = {})
35
35
  requires!(options, :secret_key)
36
36
  super
37
37
  end
38
38
 
39
- def purchase(money, payment, options={})
39
+ def purchase(money, payment, options = {})
40
40
  post = create_post_for_auth_or_purchase(money, payment, options)
41
41
  commit('charges', post, options)
42
42
  end
43
43
 
44
- def authorize(money, payment, options={})
44
+ def authorize(money, payment, options = {})
45
45
  post = create_post_for_auth_or_purchase(money, payment, options)
46
46
  post[:captured] = 'false'
47
47
  commit('charges', post, options)
@@ -63,7 +63,7 @@ module ActiveMerchant #:nodoc:
63
63
  commit("charges/#{CGI.escape(authorization)}/refund", {}, options)
64
64
  end
65
65
 
66
- def verify(credit_card, options={})
66
+ def verify(credit_card, options = {})
67
67
  MultiResponse.run(:use_first_response) do |r|
68
68
  r.process { authorize(100, credit_card, options) }
69
69
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -190,8 +190,7 @@ module ActiveMerchant #:nodoc:
190
190
  response,
191
191
  test: test?,
192
192
  authorization: (success ? response['id'] : response['error']['charge']),
193
- error_code: (success ? nil : STANDARD_ERROR_CODE_MAPPING[response['error']['code']])
194
- )
193
+ error_code: (success ? nil : STANDARD_ERROR_CODE_MAPPING[response['error']['code']]))
195
194
  end
196
195
 
197
196
  def headers(options = {})
@@ -213,7 +213,7 @@ module ActiveMerchant #:nodoc:
213
213
  #
214
214
  # * <tt>:force_settlement</tt> -- Force the settlement to occur as soon as possible. This option is not supported by other gateways. See the SkipJack API reference for more details
215
215
  def capture(money, authorization, options = {})
216
- post = { }
216
+ post = {}
217
217
  add_status_action(post, 'SETTLE')
218
218
  add_forced_settlement(post, options)
219
219
  add_transaction_id(post, authorization)
@@ -267,8 +267,7 @@ module ActiveMerchant #:nodoc:
267
267
  test: test?,
268
268
  authorization: response[:szTransactionFileName] || parameters[:szTransactionId],
269
269
  avs_result: { code: response[:szAVSResponseCode] },
270
- cvv_result: response[:szCVV2ResponseCode]
271
- )
270
+ cvv_result: response[:szCVV2ResponseCode])
272
271
  end
273
272
 
274
273
  def url_for(action)
@@ -123,7 +123,7 @@ module ActiveMerchant #:nodoc:
123
123
  commit(nil, nil, post)
124
124
  end
125
125
 
126
- alias_method :unstore, :delete
126
+ alias unstore delete
127
127
 
128
128
  private
129
129
 
@@ -133,9 +133,9 @@ module ActiveMerchant #:nodoc:
133
133
  post[:ipaddress] = options[:ip] if options.has_key? :ip
134
134
  end
135
135
 
136
- def add_address(post, address, prefix='')
136
+ def add_address(post, address, prefix = '')
137
137
  prefix += '_' unless prefix.blank?
138
- unless address.blank? or address.values.blank?
138
+ unless address.blank? || address.values.blank?
139
139
  post[prefix + 'address1'] = address[:address1].to_s
140
140
  post[prefix + 'address2'] = address[:address2].to_s unless address[:address2].blank?
141
141
  post[prefix + 'company'] = address[:company].to_s
@@ -163,7 +163,7 @@ module ActiveMerchant #:nodoc:
163
163
  post[:orderid] = options[:order_id].to_s.gsub(/[^\w.]/, '')
164
164
  end
165
165
 
166
- def add_payment_source(params, source, options={})
166
+ def add_payment_source(params, source, options = {})
167
167
  case determine_funding_source(source)
168
168
  when :vault then add_customer_vault_id(params, source)
169
169
  when :credit_card then add_creditcard(params, source, options)
@@ -230,8 +230,7 @@ module ActiveMerchant #:nodoc:
230
230
  authorization: (response['transactionid'] || response['customer_vault_id']),
231
231
  test: test?,
232
232
  cvv_result: response['cvvresponse'],
233
- avs_result: { code: response['avsresponse'] }
234
- )
233
+ avs_result: { code: response['avsresponse'] })
235
234
  end
236
235
 
237
236
  def expdate(creditcard)
@@ -39,11 +39,11 @@ module ActiveMerchant #:nodoc:
39
39
  commit('CaptureTransaction', do_capture(money, authorization, options), options)
40
40
  end
41
41
 
42
- def refund(money, authorization, options={})
42
+ def refund(money, authorization, options = {})
43
43
  commit('RefundTransaction', do_refund(money, authorization, options), options)
44
44
  end
45
45
 
46
- def void(authorization, options={})
46
+ def void(authorization, options = {})
47
47
  commit('CancelTransaction', do_void(authorization, options), options)
48
48
  end
49
49
 
@@ -139,7 +139,7 @@ module ActiveMerchant #:nodoc:
139
139
  soap.tag!('cardExpireYear', card.year.to_s)
140
140
  end
141
141
 
142
- def fill_order_info(soap, money, options, skip_currency=false)
142
+ def fill_order_info(soap, money, options, skip_currency = false)
143
143
  soap.tag!('orderID', options[:order_id].to_s)
144
144
  soap.tag!('orderDescription', "Order #{options[:order_id]}")
145
145
  soap.tag!('amount', amount(money).to_s)
@@ -157,8 +157,8 @@ module ActiveMerchant #:nodoc:
157
157
  end
158
158
 
159
159
  def commit(soap_action, soap, options)
160
- headers = {'SOAPAction' => "\"urn:Interface##{soap_action}\"",
161
- 'Content-Type' => 'text/xml; charset=utf-8'}
160
+ headers = { 'SOAPAction' => "\"urn:Interface##{soap_action}\"",
161
+ 'Content-Type' => 'text/xml; charset=utf-8' }
162
162
  response_string = ssl_post(test? ? self.test_url : self.live_url, soap, headers)
163
163
  response = parse(response_string, soap_action)
164
164
  return Response.new(response['errorcode'] == '000',
@@ -179,9 +179,9 @@ module ActiveMerchant #:nodoc:
179
179
  'xmlns:types' => 'urn:Interface/encodedTypes',
180
180
  'xmlns:soap' => 'http://schemas.xmlsoap.org/soap/envelope/'
181
181
  }) do
182
- retval.tag!('soap:Body', {'soap:encodingStyle' => 'http://schemas.xmlsoap.org/soap/encoding/'}) do
182
+ retval.tag!('soap:Body', { 'soap:encodingStyle' => 'http://schemas.xmlsoap.org/soap/encoding/' }) do
183
183
  retval.tag!("tns:#{request}") do
184
- retval.tag!("#{request}Request", {'xsi:type' => "tns:#{request}Request"}) do
184
+ retval.tag!("#{request}Request", { 'xsi:type' => "tns:#{request}Request" }) do
185
185
  yield retval
186
186
  end
187
187
  end
@@ -56,7 +56,7 @@ module ActiveMerchant #:nodoc:
56
56
  commit("gateways/#{@options[:gateway_token]}/authorize.xml", request)
57
57
  end
58
58
 
59
- def capture(money, authorization, options={})
59
+ def capture(money, authorization, options = {})
60
60
  request = build_xml_request('transaction') do |doc|
61
61
  add_invoice(doc, money, options)
62
62
  end
@@ -64,7 +64,7 @@ module ActiveMerchant #:nodoc:
64
64
  commit("transactions/#{authorization}/capture.xml", request)
65
65
  end
66
66
 
67
- def refund(money, authorization, options={})
67
+ def refund(money, authorization, options = {})
68
68
  request = build_xml_request('transaction') do |doc|
69
69
  add_invoice(doc, money, options)
70
70
  add_extra_options(:gateway_specific_fields, doc, options)
@@ -73,7 +73,7 @@ module ActiveMerchant #:nodoc:
73
73
  commit("transactions/#{authorization}/credit.xml", request)
74
74
  end
75
75
 
76
- def void(authorization, options={})
76
+ def void(authorization, options = {})
77
77
  commit("transactions/#{authorization}/void.xml", '')
78
78
  end
79
79
 
@@ -98,7 +98,7 @@ module ActiveMerchant #:nodoc:
98
98
  #
99
99
  # credit_card - The CreditCard to store
100
100
  # options - A standard ActiveMerchant options hash
101
- def store(credit_card, options={})
101
+ def store(credit_card, options = {})
102
102
  retain = (options.has_key?(:retain) ? options[:retain] : true)
103
103
  save_card(retain, credit_card, options)
104
104
  end
@@ -108,7 +108,7 @@ module ActiveMerchant #:nodoc:
108
108
  #
109
109
  # credit_card - The CreditCard to store
110
110
  # options - A standard ActiveMerchant options hash
111
- def unstore(authorization, options={})
111
+ def unstore(authorization, options = {})
112
112
  commit("payment_methods/#{authorization}/redact.xml", '', :put)
113
113
  end
114
114
 
@@ -117,7 +117,7 @@ module ActiveMerchant #:nodoc:
117
117
  commit("transactions/#{transaction_token}.xml", nil, :get)
118
118
  end
119
119
 
120
- alias_method :status, :find
120
+ alias status find
121
121
 
122
122
  def supports_scrubbing?
123
123
  true