activemerchant 1.79.2 → 1.80.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +33 -0
  3. data/README.md +10 -2
  4. data/lib/active_merchant.rb +1 -1
  5. data/lib/active_merchant/billing/check.rb +4 -4
  6. data/lib/active_merchant/billing/compatibility.rb +1 -1
  7. data/lib/active_merchant/billing/credit_card.rb +21 -21
  8. data/lib/active_merchant/billing/credit_card_formatting.rb +2 -2
  9. data/lib/active_merchant/billing/credit_card_methods.rb +2 -2
  10. data/lib/active_merchant/billing/gateway.rb +13 -13
  11. data/lib/active_merchant/billing/gateways/adyen.rb +31 -15
  12. data/lib/active_merchant/billing/gateways/allied_wallet.rb +22 -22
  13. data/lib/active_merchant/billing/gateways/authorize_net.rb +72 -72
  14. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -3
  15. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +3 -3
  16. data/lib/active_merchant/billing/gateways/axcessms.rb +51 -51
  17. data/lib/active_merchant/billing/gateways/balanced.rb +29 -29
  18. data/lib/active_merchant/billing/gateways/bank_frick.rb +3 -3
  19. data/lib/active_merchant/billing/gateways/banwire.rb +8 -8
  20. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +5 -5
  21. data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +6 -6
  22. data/lib/active_merchant/billing/gateways/be2bill.rb +2 -2
  23. data/lib/active_merchant/billing/gateways/beanstream.rb +1 -1
  24. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +69 -69
  25. data/lib/active_merchant/billing/gateways/blue_pay.rb +19 -19
  26. data/lib/active_merchant/billing/gateways/blue_snap.rb +42 -42
  27. data/lib/active_merchant/billing/gateways/bogus.rb +10 -10
  28. data/lib/active_merchant/billing/gateways/borgun.rb +10 -10
  29. data/lib/active_merchant/billing/gateways/bpoint.rb +1 -1
  30. data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +2 -2
  31. data/lib/active_merchant/billing/gateways/braintree_blue.rb +94 -94
  32. data/lib/active_merchant/billing/gateways/braintree_orange.rb +1 -1
  33. data/lib/active_merchant/billing/gateways/bridge_pay.rb +39 -39
  34. data/lib/active_merchant/billing/gateways/cams.rb +12 -12
  35. data/lib/active_merchant/billing/gateways/card_connect.rb +38 -13
  36. data/lib/active_merchant/billing/gateways/card_stream.rb +116 -116
  37. data/lib/active_merchant/billing/gateways/cardknox.rb +7 -7
  38. data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
  39. data/lib/active_merchant/billing/gateways/cashnet.rb +10 -10
  40. data/lib/active_merchant/billing/gateways/cc5.rb +3 -5
  41. data/lib/active_merchant/billing/gateways/cecabank.rb +6 -6
  42. data/lib/active_merchant/billing/gateways/cenpos.rb +36 -36
  43. data/lib/active_merchant/billing/gateways/checkout.rb +5 -5
  44. data/lib/active_merchant/billing/gateways/checkout_v2.rb +31 -31
  45. data/lib/active_merchant/billing/gateways/clearhaus.rb +5 -5
  46. data/lib/active_merchant/billing/gateways/commercegate.rb +6 -6
  47. data/lib/active_merchant/billing/gateways/conekta.rb +24 -19
  48. data/lib/active_merchant/billing/gateways/creditcall.rb +41 -41
  49. data/lib/active_merchant/billing/gateways/credorax.rb +104 -103
  50. data/lib/active_merchant/billing/gateways/culqi.rb +25 -25
  51. data/lib/active_merchant/billing/gateways/cyber_source.rb +65 -65
  52. data/lib/active_merchant/billing/gateways/data_cash.rb +4 -4
  53. data/lib/active_merchant/billing/gateways/dibs.rb +24 -24
  54. data/lib/active_merchant/billing/gateways/digitzs.rb +35 -35
  55. data/lib/active_merchant/billing/gateways/ebanx.rb +26 -26
  56. data/lib/active_merchant/billing/gateways/efsnet.rb +10 -10
  57. data/lib/active_merchant/billing/gateways/elavon.rb +5 -5
  58. data/lib/active_merchant/billing/gateways/element.rb +35 -35
  59. data/lib/active_merchant/billing/gateways/epay.rb +4 -4
  60. data/lib/active_merchant/billing/gateways/evo_ca.rb +1 -1
  61. data/lib/active_merchant/billing/gateways/eway.rb +65 -65
  62. data/lib/active_merchant/billing/gateways/eway_managed.rb +11 -11
  63. data/lib/active_merchant/billing/gateways/eway_rapid.rb +31 -31
  64. data/lib/active_merchant/billing/gateways/exact.rb +12 -12
  65. data/lib/active_merchant/billing/gateways/ezic.rb +13 -13
  66. data/lib/active_merchant/billing/gateways/fat_zebra.rb +24 -24
  67. data/lib/active_merchant/billing/gateways/federated_canada.rb +3 -3
  68. data/lib/active_merchant/billing/gateways/first_giving.rb +16 -16
  69. data/lib/active_merchant/billing/gateways/first_pay.rb +7 -4
  70. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +71 -71
  71. data/lib/active_merchant/billing/gateways/flo2cash.rb +12 -12
  72. data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
  73. data/lib/active_merchant/billing/gateways/forte.rb +26 -16
  74. data/lib/active_merchant/billing/gateways/garanti.rb +10 -12
  75. data/lib/active_merchant/billing/gateways/global_collect.rb +88 -88
  76. data/lib/active_merchant/billing/gateways/global_transport.rb +4 -4
  77. data/lib/active_merchant/billing/gateways/hdfc.rb +33 -33
  78. data/lib/active_merchant/billing/gateways/hps.rb +28 -28
  79. data/lib/active_merchant/billing/gateways/iats_payments.rb +26 -26
  80. data/lib/active_merchant/billing/gateways/inspire.rb +15 -15
  81. data/lib/active_merchant/billing/gateways/instapay.rb +4 -4
  82. data/lib/active_merchant/billing/gateways/ipp.rb +17 -17
  83. data/lib/active_merchant/billing/gateways/iridium.rb +207 -207
  84. data/lib/active_merchant/billing/gateways/iveri.rb +8 -8
  85. data/lib/active_merchant/billing/gateways/jetpay.rb +134 -134
  86. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +141 -141
  87. data/lib/active_merchant/billing/gateways/komoju.rb +15 -15
  88. data/lib/active_merchant/billing/gateways/kushki.rb +31 -37
  89. data/lib/active_merchant/billing/gateways/latitude19.rb +64 -64
  90. data/lib/active_merchant/billing/gateways/linkpoint.rb +22 -22
  91. data/lib/active_merchant/billing/gateways/litle.rb +4 -4
  92. data/lib/active_merchant/billing/gateways/mastercard.rb +3 -3
  93. data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
  94. data/lib/active_merchant/billing/gateways/mercado_pago.rb +28 -28
  95. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +9 -9
  96. data/lib/active_merchant/billing/gateways/merchant_one.rb +6 -6
  97. data/lib/active_merchant/billing/gateways/merchant_partners.rb +24 -24
  98. data/lib/active_merchant/billing/gateways/merchant_ware.rb +49 -49
  99. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +36 -36
  100. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +4 -4
  101. data/lib/active_merchant/billing/gateways/mercury.rb +28 -28
  102. data/lib/active_merchant/billing/gateways/metrics_global.rb +7 -7
  103. data/lib/active_merchant/billing/gateways/micropayment.rb +31 -31
  104. data/lib/active_merchant/billing/gateways/migs.rb +11 -9
  105. data/lib/active_merchant/billing/gateways/modern_payments.rb +1 -1
  106. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +16 -16
  107. data/lib/active_merchant/billing/gateways/monei.rb +5 -5
  108. data/lib/active_merchant/billing/gateways/moneris.rb +26 -26
  109. data/lib/active_merchant/billing/gateways/moneris_us.rb +81 -37
  110. data/lib/active_merchant/billing/gateways/money_movers.rb +3 -3
  111. data/lib/active_merchant/billing/gateways/mundipagg.rb +1 -1
  112. data/lib/active_merchant/billing/gateways/nab_transact.rb +6 -6
  113. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +3 -3
  114. data/lib/active_merchant/billing/gateways/netaxept.rb +15 -15
  115. data/lib/active_merchant/billing/gateways/netbanx.rb +2 -2
  116. data/lib/active_merchant/billing/gateways/netbilling.rb +1 -1
  117. data/lib/active_merchant/billing/gateways/netpay.rb +5 -5
  118. data/lib/active_merchant/billing/gateways/nmi.rb +18 -18
  119. data/lib/active_merchant/billing/gateways/ogone.rb +22 -22
  120. data/lib/active_merchant/billing/gateways/omise.rb +3 -3
  121. data/lib/active_merchant/billing/gateways/openpay.rb +6 -4
  122. data/lib/active_merchant/billing/gateways/opp.rb +4 -4
  123. data/lib/active_merchant/billing/gateways/optimal_payment.rb +2 -2
  124. data/lib/active_merchant/billing/gateways/orbital.rb +61 -61
  125. data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +4 -4
  126. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +5 -5
  127. data/lib/active_merchant/billing/gateways/pagarme.rb +27 -27
  128. data/lib/active_merchant/billing/gateways/pago_facil.rb +8 -8
  129. data/lib/active_merchant/billing/gateways/pay_conex.rb +25 -25
  130. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +32 -32
  131. data/lib/active_merchant/billing/gateways/pay_hub.rb +29 -29
  132. data/lib/active_merchant/billing/gateways/pay_junction.rb +7 -7
  133. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +30 -30
  134. data/lib/active_merchant/billing/gateways/pay_secure.rb +4 -4
  135. data/lib/active_merchant/billing/gateways/paybox_direct.rb +15 -15
  136. data/lib/active_merchant/billing/gateways/payeezy.rb +5 -5
  137. data/lib/active_merchant/billing/gateways/payex.rb +4 -4
  138. data/lib/active_merchant/billing/gateways/payflow.rb +7 -7
  139. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +23 -22
  140. data/lib/active_merchant/billing/gateways/payflow_express.rb +2 -2
  141. data/lib/active_merchant/billing/gateways/payment_express.rb +40 -37
  142. data/lib/active_merchant/billing/gateways/paymentez.rb +11 -3
  143. data/lib/active_merchant/billing/gateways/paymill.rb +115 -115
  144. data/lib/active_merchant/billing/gateways/paypal.rb +1 -1
  145. data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +1 -1
  146. data/lib/active_merchant/billing/gateways/payscout.rb +1 -1
  147. data/lib/active_merchant/billing/gateways/paystation.rb +14 -14
  148. data/lib/active_merchant/billing/gateways/payu_in.rb +43 -43
  149. data/lib/active_merchant/billing/gateways/payu_latam.rb +41 -41
  150. data/lib/active_merchant/billing/gateways/payway.rb +6 -6
  151. data/lib/active_merchant/billing/gateways/pin.rb +7 -7
  152. data/lib/active_merchant/billing/gateways/plugnpay.rb +62 -62
  153. data/lib/active_merchant/billing/gateways/pro_pay.rb +123 -123
  154. data/lib/active_merchant/billing/gateways/psigate.rb +16 -16
  155. data/lib/active_merchant/billing/gateways/psl_card.rb +13 -13
  156. data/lib/active_merchant/billing/gateways/qbms.rb +52 -52
  157. data/lib/active_merchant/billing/gateways/quantum.rb +5 -5
  158. data/lib/active_merchant/billing/gateways/quickbooks.rb +10 -10
  159. data/lib/active_merchant/billing/gateways/quickpay.rb +1 -1
  160. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +11 -11
  161. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +3 -3
  162. data/lib/active_merchant/billing/gateways/qvalent.rb +55 -55
  163. data/lib/active_merchant/billing/gateways/realex.rb +16 -15
  164. data/lib/active_merchant/billing/gateways/redsys.rb +128 -121
  165. data/lib/active_merchant/billing/gateways/s5.rb +5 -5
  166. data/lib/active_merchant/billing/gateways/safe_charge.rb +16 -16
  167. data/lib/active_merchant/billing/gateways/sage.rb +20 -20
  168. data/lib/active_merchant/billing/gateways/sage_pay.rb +32 -32
  169. data/lib/active_merchant/billing/gateways/sallie_mae.rb +11 -11
  170. data/lib/active_merchant/billing/gateways/secure_net.rb +19 -19
  171. data/lib/active_merchant/billing/gateways/secure_pay.rb +5 -5
  172. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +7 -7
  173. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +9 -9
  174. data/lib/active_merchant/billing/gateways/securion_pay.rb +12 -12
  175. data/lib/active_merchant/billing/gateways/skip_jack.rb +28 -28
  176. data/lib/active_merchant/billing/gateways/smart_ps.rb +31 -31
  177. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +3 -3
  178. data/lib/active_merchant/billing/gateways/spreedly_core.rb +1 -1
  179. data/lib/active_merchant/billing/gateways/stripe.rb +63 -63
  180. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +5 -5
  181. data/lib/active_merchant/billing/gateways/telr.rb +26 -26
  182. data/lib/active_merchant/billing/gateways/trans_first.rb +28 -28
  183. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +224 -224
  184. data/lib/active_merchant/billing/gateways/transact_pro.rb +7 -7
  185. data/lib/active_merchant/billing/gateways/transnational.rb +1 -1
  186. data/lib/active_merchant/billing/gateways/trexle.rb +5 -5
  187. data/lib/active_merchant/billing/gateways/trust_commerce.rb +38 -38
  188. data/lib/active_merchant/billing/gateways/usa_epay.rb +3 -3
  189. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +37 -37
  190. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +3 -3
  191. data/lib/active_merchant/billing/gateways/vanco.rb +25 -25
  192. data/lib/active_merchant/billing/gateways/verifi.rb +40 -40
  193. data/lib/active_merchant/billing/gateways/viaklix.rb +5 -5
  194. data/lib/active_merchant/billing/gateways/visanet_peru.rb +64 -36
  195. data/lib/active_merchant/billing/gateways/webpay.rb +8 -8
  196. data/lib/active_merchant/billing/gateways/wepay.rb +25 -25
  197. data/lib/active_merchant/billing/gateways/wirecard.rb +26 -26
  198. data/lib/active_merchant/billing/gateways/worldpay.rb +15 -15
  199. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +42 -42
  200. data/lib/active_merchant/billing/gateways/worldpay_us.rb +17 -17
  201. data/lib/active_merchant/billing/model.rb +2 -2
  202. data/lib/active_merchant/billing/network_tokenization_credit_card.rb +1 -1
  203. data/lib/active_merchant/billing/rails.rb +1 -1
  204. data/lib/active_merchant/connection.rb +10 -8
  205. data/lib/active_merchant/country.rb +1 -1
  206. data/lib/active_merchant/net_http_ssl_connection.rb +1 -0
  207. data/lib/active_merchant/network_connection_retries.rb +12 -12
  208. data/lib/active_merchant/post_data.rb +1 -1
  209. data/lib/active_merchant/posts_data.rb +1 -1
  210. data/lib/active_merchant/version.rb +1 -1
  211. data/lib/certs/cacert.pem +37 -0
  212. data/lib/support/gateway_support.rb +2 -2
  213. data/lib/support/ssl_verify.rb +5 -5
  214. data/lib/support/ssl_version.rb +7 -7
  215. metadata +3 -7
  216. data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +0 -246
  217. data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +0 -13
  218. data/lib/active_merchant/billing/gateways/ideal/ideal_response.rb +0 -29
  219. data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +0 -66
@@ -2,21 +2,21 @@ module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  class SecureNetGateway < Gateway
4
4
 
5
- API_VERSION = "4.0"
5
+ API_VERSION = '4.0'
6
6
 
7
7
  TRANSACTIONS = {
8
- :auth_only => "0000",
9
- :auth_capture => "0100",
10
- :prior_auth_capture => "0200",
11
- :void => "0400",
12
- :credit => "0500"
8
+ :auth_only => '0000',
9
+ :auth_capture => '0100',
10
+ :prior_auth_capture => '0200',
11
+ :void => '0400',
12
+ :credit => '0500'
13
13
  }
14
14
 
15
15
  XML_ATTRIBUTES = {
16
- 'xmlns' => "http://gateway.securenet.com/API/Contracts",
17
- 'xmlns:i' => "http://www.w3.org/2001/XMLSchema-instance"
16
+ 'xmlns' => 'http://gateway.securenet.com/API/Contracts',
17
+ 'xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance'
18
18
  }
19
- NIL_ATTRIBUTE = { 'i:nil' => "true" }
19
+ NIL_ATTRIBUTE = { 'i:nil' => 'true' }
20
20
 
21
21
  self.supported_countries = ['US']
22
22
  self.supported_cardtypes = [:visa, :master, :american_express, :discover]
@@ -77,7 +77,7 @@ module ActiveMerchant #:nodoc:
77
77
  def commit(request)
78
78
  xml = build_request(request)
79
79
  url = test? ? self.test_url : self.live_url
80
- data = ssl_post(url, xml, "Content-Type" => "text/xml")
80
+ data = ssl_post(url, xml, 'Content-Type' => 'text/xml')
81
81
  response = parse(data)
82
82
 
83
83
  Response.new(success?(response), message_from(response), response,
@@ -92,7 +92,7 @@ module ActiveMerchant #:nodoc:
92
92
  xml = Builder::XmlMarkup.new
93
93
 
94
94
  xml.instruct!
95
- xml.tag!("TRANSACTION", XML_ATTRIBUTES) do
95
+ xml.tag!('TRANSACTION', XML_ATTRIBUTES) do
96
96
  xml << request
97
97
  end
98
98
 
@@ -116,7 +116,7 @@ module ActiveMerchant #:nodoc:
116
116
  transaction_id, amount_in_ref, last_four = split_authorization(authorization)
117
117
 
118
118
  xml.tag! 'AMOUNT', amount(money) || amount_in_ref
119
- xml.tag!("CARD") do
119
+ xml.tag!('CARD') do
120
120
  xml.tag! 'CARDNUMBER', last_four
121
121
  end
122
122
 
@@ -128,7 +128,7 @@ module ActiveMerchant #:nodoc:
128
128
  end
129
129
 
130
130
  def add_credit_card(xml, creditcard)
131
- xml.tag!("CARD") do
131
+ xml.tag!('CARD') do
132
132
  xml.tag! 'CARDCODE', creditcard.verification_value if creditcard.verification_value?
133
133
  xml.tag! 'CARDNUMBER', creditcard.number
134
134
  xml.tag! 'EXPDATE', expdate(creditcard)
@@ -149,7 +149,7 @@ module ActiveMerchant #:nodoc:
149
149
  return unless creditcard
150
150
 
151
151
  if address = options[:billing_address] || options[:address]
152
- xml.tag!("CUSTOMER_BILL") do
152
+ xml.tag!('CUSTOMER_BILL') do
153
153
  xml.tag! 'ADDRESS', address[:address1].to_s
154
154
  xml.tag! 'CITY', address[:city].to_s
155
155
  xml.tag! 'COMPANY', address[:company].to_s
@@ -167,7 +167,7 @@ module ActiveMerchant #:nodoc:
167
167
  end
168
168
 
169
169
  if address = options[:shipping_address]
170
- xml.tag!("CUSTOMER_SHIP") do
170
+ xml.tag!('CUSTOMER_SHIP') do
171
171
  xml.tag! 'ADDRESS', address[:address1].to_s
172
172
  xml.tag! 'CITY', address[:city].to_s
173
173
  xml.tag! 'COMPANY', address[:company].to_s
@@ -193,7 +193,7 @@ module ActiveMerchant #:nodoc:
193
193
  end
194
194
 
195
195
  def add_merchant_key(xml, options)
196
- xml.tag!("MERCHANT_KEY") do
196
+ xml.tag!('MERCHANT_KEY') do
197
197
  xml.tag! 'GROUPID', 0
198
198
  xml.tag! 'SECUREKEY', @options[:password]
199
199
  xml.tag! 'SECURENETID', @options[:login]
@@ -236,7 +236,7 @@ module ActiveMerchant #:nodoc:
236
236
  def parse(xml)
237
237
  response = {}
238
238
  xml = REXML::Document.new(xml)
239
- root = REXML::XPath.first(xml, "//GATEWAYRESPONSE")
239
+ root = REXML::XPath.first(xml, '//GATEWAYRESPONSE')
240
240
  if root
241
241
  root.elements.to_a.each do |node|
242
242
  recurring_parse_element(response, node)
@@ -255,12 +255,12 @@ module ActiveMerchant #:nodoc:
255
255
  end
256
256
 
257
257
  def split_authorization(authorization)
258
- transaction_id, amount, last_four = authorization.split("|")
258
+ transaction_id, amount, last_four = authorization.split('|')
259
259
  [transaction_id, amount, last_four]
260
260
  end
261
261
 
262
262
  def build_authorization(response)
263
- [response[:transactionid], response[:transactionamount], response[:last4_digits]].join("|")
263
+ [response[:transactionid], response[:transactionamount], response[:last4_digits]].join('|')
264
264
  end
265
265
 
266
266
  end
@@ -95,14 +95,14 @@ module ActiveMerchant #:nodoc:
95
95
  post[:version] = API_VERSION
96
96
  post[:login] = @options[:login]
97
97
  post[:tran_key] = @options[:password]
98
- post[:relay_response] = "FALSE"
98
+ post[:relay_response] = 'FALSE'
99
99
  post[:type] = action
100
- post[:delim_data] = "TRUE"
101
- post[:delim_char] = ","
102
- post[:encap_char] = "$"
100
+ post[:delim_data] = 'TRUE'
101
+ post[:delim_char] = ','
102
+ post[:encap_char] = '$'
103
103
  post[:solution_ID] = application_id if application_id
104
104
 
105
- request = post.merge(parameters).collect { |key, value| "x_#{key}=#{CGI.escape(value.to_s)}" }.join("&")
105
+ request = post.merge(parameters).collect { |key, value| "x_#{key}=#{CGI.escape(value.to_s)}" }.join('&')
106
106
  request
107
107
  end
108
108
 
@@ -43,9 +43,9 @@ module ActiveMerchant #:nodoc:
43
43
  }
44
44
 
45
45
  PERIODIC_ACTIONS = {
46
- :add_triggered => "add",
47
- :remove_triggered => "delete",
48
- :trigger => "trigger"
46
+ :add_triggered => 'add',
47
+ :remove_triggered => 'delete',
48
+ :trigger => 'trigger'
49
49
  }
50
50
 
51
51
  PERIODIC_TYPES = {
@@ -167,8 +167,8 @@ module ActiveMerchant #:nodoc:
167
167
 
168
168
  xml.tag! 'RequestType', 'Payment'
169
169
  xml.tag! 'Payment' do
170
- xml.tag! 'TxnList', "count" => 1 do
171
- xml.tag! 'Txn', "ID" => 1 do
170
+ xml.tag! 'TxnList', 'count' => 1 do
171
+ xml.tag! 'Txn', 'ID' => 1 do
172
172
  xml.tag! 'txnType', TRANSACTIONS[action]
173
173
  xml.tag! 'txnSource', 23
174
174
  xml << body
@@ -226,8 +226,8 @@ module ActiveMerchant #:nodoc:
226
226
 
227
227
  xml.tag! 'RequestType', 'Periodic'
228
228
  xml.tag! 'Periodic' do
229
- xml.tag! 'PeriodicList', "count" => 1 do
230
- xml.tag! 'PeriodicItem', "ID" => 1 do
229
+ xml.tag! 'PeriodicList', 'count' => 1 do
230
+ xml.tag! 'PeriodicItem', 'ID' => 1 do
231
231
  xml << body
232
232
  end
233
233
  end
@@ -8,15 +8,15 @@ module ActiveMerchant #:nodoc:
8
8
  self.live_url = self.test_url = 'https://tx.securepaytech.com/web/HttpPostPurchase'
9
9
 
10
10
  PAYMENT_GATEWAY_RESPONSES = {
11
- 1 => "Transaction OK",
12
- 2 => "Insufficient funds",
13
- 3 => "Card expired",
14
- 4 => "Card declined",
15
- 5 => "Server error",
16
- 6 => "Communications error",
17
- 7 => "Unsupported transaction type",
18
- 8 => "Bad or malformed request",
19
- 9 => "Invalid card number"
11
+ 1 => 'Transaction OK',
12
+ 2 => 'Insufficient funds',
13
+ 3 => 'Card expired',
14
+ 4 => 'Card declined',
15
+ 5 => 'Server error',
16
+ 6 => 'Communications error',
17
+ 7 => 'Unsupported transaction type',
18
+ 8 => 'Bad or malformed request',
19
+ 9 => 'Invalid card number'
20
20
  }
21
21
 
22
22
  self.default_currency = 'NZD'
@@ -44,7 +44,7 @@ module ActiveMerchant #:nodoc:
44
44
 
45
45
  def authorize(money, payment, options={})
46
46
  post = create_post_for_auth_or_purchase(money, payment, options)
47
- post[:captured] = "false"
47
+ post[:captured] = 'false'
48
48
  commit('charges', post, options)
49
49
  end
50
50
 
@@ -79,7 +79,7 @@ module ActiveMerchant #:nodoc:
79
79
  #create customer and save card
80
80
  r.process { create_customer_add_card(r.authorization, options) }
81
81
  #void the charge
82
- r.process(:ignore_result) { void(r.params["metadata"]["chargeId"], options) }
82
+ r.process(:ignore_result) { void(r.params['metadata']['chargeId'], options) }
83
83
  end
84
84
  else
85
85
  verify(credit_card, options)
@@ -183,14 +183,14 @@ module ActiveMerchant #:nodoc:
183
183
 
184
184
  def commit(url, parameters = nil, options = {}, method = nil)
185
185
  response = api_request(url, parameters, options, method)
186
- success = !response.key?("error")
186
+ success = !response.key?('error')
187
187
 
188
188
  Response.new(success,
189
- (success ? "Transaction approved" : response["error"]["message"]),
189
+ (success ? 'Transaction approved' : response['error']['message']),
190
190
  response,
191
191
  test: test?,
192
- authorization: (success ? response["id"] : response["error"]["charge"]),
193
- error_code: (success ? nil : STANDARD_ERROR_CODE_MAPPING[response["error"]["code"]])
192
+ authorization: (success ? response['id'] : response['error']['charge']),
193
+ error_code: (success ? nil : STANDARD_ERROR_CODE_MAPPING[response['error']['code']])
194
194
  )
195
195
  end
196
196
 
@@ -198,8 +198,8 @@ module ActiveMerchant #:nodoc:
198
198
  secret_key = options[:secret_key] || @options[:secret_key]
199
199
 
200
200
  headers = {
201
- "Authorization" => "Basic " + Base64.encode64(secret_key.to_s + ":").strip,
202
- "User-Agent" => "SecurionPay/v1 ActiveMerchantBindings/#{ActiveMerchant::VERSION}"
201
+ 'Authorization' => 'Basic ' + Base64.encode64(secret_key.to_s + ':').strip,
202
+ 'User-Agent' => "SecurionPay/v1 ActiveMerchantBindings/#{ActiveMerchant::VERSION}"
203
203
  }
204
204
  headers
205
205
  end
@@ -224,11 +224,11 @@ module ActiveMerchant #:nodoc:
224
224
  end
225
225
  post_data(h)
226
226
  elsif value.is_a?(Array)
227
- value.map { |v| "#{key}[]=#{CGI.escape(v.to_s)}" }.join("&")
227
+ value.map { |v| "#{key}[]=#{CGI.escape(v.to_s)}" }.join('&')
228
228
  else
229
229
  "#{key}=#{CGI.escape(value.to_s)}"
230
230
  end
231
- end.compact.join("&")
231
+ end.compact.join('&')
232
232
  end
233
233
 
234
234
  def api_request(endpoint, parameters = nil, options = {}, method = nil)
@@ -253,8 +253,8 @@ module ActiveMerchant #:nodoc:
253
253
  msg = 'Invalid response received from the SecurionPay API.'
254
254
  msg += " (The raw response returned by the API was #{raw_response.inspect})"
255
255
  {
256
- "error" => {
257
- "message" => msg
256
+ 'error' => {
257
+ 'message' => msg
258
258
  }
259
259
  }
260
260
  end
@@ -6,11 +6,11 @@ module ActiveMerchant #:nodoc:
6
6
  class SkipJackGateway < Gateway
7
7
  API_VERSION = '?.?'
8
8
 
9
- self.live_url = "https://www.skipjackic.com"
10
- self.test_url = "https://developer.skipjackic.com"
9
+ self.live_url = 'https://www.skipjackic.com'
10
+ self.test_url = 'https://developer.skipjackic.com'
11
11
 
12
- BASIC_PATH = "/scripts/evolvcc.dll"
13
- ADVANCED_PATH = "/evolvcc/evolvcc.aspx"
12
+ BASIC_PATH = '/scripts/evolvcc.dll'
13
+ ADVANCED_PATH = '/evolvcc/evolvcc.aspx'
14
14
 
15
15
  ACTIONS = {
16
16
  :authorization => 'AuthorizeAPI',
@@ -25,34 +25,34 @@ module ActiveMerchant #:nodoc:
25
25
  CARD_CODE_ERRORS = %w( N S "" )
26
26
 
27
27
  CARD_CODE_MESSAGES = {
28
- "M" => "Card verification number matched",
29
- "N" => "Card verification number didn't match",
30
- "P" => "Card verification number was not processed",
31
- "S" => "Card verification number should be on card but was not indicated",
32
- "U" => "Issuer was not certified for card verification",
33
- "" => "Transaction failed because incorrect card verification number was entered or no number was entered"
28
+ 'M' => 'Card verification number matched',
29
+ 'N' => "Card verification number didn't match",
30
+ 'P' => 'Card verification number was not processed',
31
+ 'S' => 'Card verification number should be on card but was not indicated',
32
+ 'U' => 'Issuer was not certified for card verification',
33
+ '' => 'Transaction failed because incorrect card verification number was entered or no number was entered'
34
34
  }
35
35
 
36
36
  AVS_ERRORS = %w( A B C E I N O P R W Z )
37
37
 
38
38
  AVS_MESSAGES = {
39
- "A" => "Street address matches billing information, zip/postal code does not",
40
- "B" => "Street address match for international transaction. Postal code not verified due to incompatible formats",
41
- "C" => "Street address and postal code not verified for internation transaction due to incompatible formats",
42
- "D" => "Street address and postal code match for international transaction",
43
- "E" => "Address verification service error",
44
- "I" => "Address information not verified by international issuer",
45
- "M" => "Street address and postal code match for international transaction",
46
- "N" => "Neither street address nor zip/postal match billing information",
47
- "O" => "Non-US issuer does not participate",
48
- "P" => "Postal codes match for international transaction but street address not verified due to incompatible formats",
49
- "R" => "Payment gateway was unavailable or timed out",
50
- "S" => "Address verification service not supported by issuer",
51
- "U" => "Address information is unavailable",
52
- "W" => "9-digit zip/postal code matches billing information, street address does not",
53
- "X" => "Street address and 9-digit zip/postal code matches billing information",
54
- "Y" => "Street address and 5-digit zip/postal code matches billing information",
55
- "Z" => "5-digit zip/postal code matches billing information, street address does not",
39
+ 'A' => 'Street address matches billing information, zip/postal code does not',
40
+ 'B' => 'Street address match for international transaction. Postal code not verified due to incompatible formats',
41
+ 'C' => 'Street address and postal code not verified for internation transaction due to incompatible formats',
42
+ 'D' => 'Street address and postal code match for international transaction',
43
+ 'E' => 'Address verification service error',
44
+ 'I' => 'Address information not verified by international issuer',
45
+ 'M' => 'Street address and postal code match for international transaction',
46
+ 'N' => 'Neither street address nor zip/postal match billing information',
47
+ 'O' => 'Non-US issuer does not participate',
48
+ 'P' => 'Postal codes match for international transaction but street address not verified due to incompatible formats',
49
+ 'R' => 'Payment gateway was unavailable or timed out',
50
+ 'S' => 'Address verification service not supported by issuer',
51
+ 'U' => 'Address information is unavailable',
52
+ 'W' => '9-digit zip/postal code matches billing information, street address does not',
53
+ 'X' => 'Street address and 9-digit zip/postal code matches billing information',
54
+ 'Y' => 'Street address and 5-digit zip/postal code matches billing information',
55
+ 'Z' => '5-digit zip/postal code matches billing information, street address does not',
56
56
  }
57
57
 
58
58
  CHANGE_STATUS_ERROR_MESSAGES = {
@@ -355,7 +355,7 @@ module ActiveMerchant #:nodoc:
355
355
  add_credentials(params, action)
356
356
  add_amount(params, action, money)
357
357
  sorted_params = params.to_a.sort{|a,b| a.to_s <=> b.to_s}.reverse
358
- sorted_params.collect { |key, value| "#{key.to_s}=#{CGI.escape(value.to_s)}" }.join("&")
358
+ sorted_params.collect { |key, value| "#{key.to_s}=#{CGI.escape(value.to_s)}" }.join('&')
359
359
  end
360
360
 
361
361
  def add_transaction_id(post, transaction_id)
@@ -25,7 +25,7 @@ module ActiveMerchant #:nodoc:
25
25
  add_invoice(post, options)
26
26
  add_payment_source(post, creditcard,options)
27
27
  add_address(post, options[:billing_address] || options[:address])
28
- add_address(post, options[:shipping_address], "shipping")
28
+ add_address(post, options[:shipping_address], 'shipping')
29
29
  add_customer_data(post, options)
30
30
  add_currency(post, money, options)
31
31
  add_taxes(post, options)
@@ -38,7 +38,7 @@ module ActiveMerchant #:nodoc:
38
38
  add_invoice(post, options)
39
39
  add_payment_source(post, payment_source, options)
40
40
  add_address(post, options[:billing_address] || options[:address])
41
- add_address(post, options[:shipping_address], "shipping")
41
+ add_address(post, options[:shipping_address], 'shipping')
42
42
  add_customer_data(post, options)
43
43
  add_currency(post, money, options)
44
44
  add_taxes(post, options)
@@ -89,7 +89,7 @@ module ActiveMerchant #:nodoc:
89
89
  # CreditCard object.
90
90
  def update(vault_id, creditcard, options = {})
91
91
  post = {}
92
- post[:customer_vault] = "update_customer"
92
+ post[:customer_vault] = 'update_customer'
93
93
  add_customer_vault_id(post, vault_id)
94
94
  add_creditcard(post, creditcard, options)
95
95
  add_address(post, options[:billing_address] || options[:address])
@@ -109,7 +109,7 @@ module ActiveMerchant #:nodoc:
109
109
 
110
110
  def delete(vault_id)
111
111
  post = {}
112
- post[:customer_vault] = "delete_customer"
112
+ post[:customer_vault] = 'delete_customer'
113
113
  add_customer_vault_id(post, vault_id)
114
114
  commit(nil, nil, post)
115
115
  end
@@ -138,17 +138,17 @@ module ActiveMerchant #:nodoc:
138
138
  end
139
139
  end
140
140
 
141
- def add_address(post, address,prefix="")
142
- prefix +="_" unless prefix.blank?
141
+ def add_address(post, address,prefix='')
142
+ prefix +='_' unless prefix.blank?
143
143
  unless address.blank? or address.values.blank?
144
- post[prefix+"address1"] = address[:address1].to_s
145
- post[prefix+"address2"] = address[:address2].to_s unless address[:address2].blank?
146
- post[prefix+"company"] = address[:company].to_s
147
- post[prefix+"phone"] = address[:phone].to_s
148
- post[prefix+"zip"] = address[:zip].to_s
149
- post[prefix+"city"] = address[:city].to_s
150
- post[prefix+"country"] = address[:country].to_s
151
- post[prefix+"state"] = address[:state].blank? ? 'n/a' : address[:state]
144
+ post[prefix+'address1'] = address[:address1].to_s
145
+ post[prefix+'address2'] = address[:address2].to_s unless address[:address2].blank?
146
+ post[prefix+'company'] = address[:company].to_s
147
+ post[prefix+'phone'] = address[:phone].to_s
148
+ post[prefix+'zip'] = address[:zip].to_s
149
+ post[prefix+'city'] = address[:city].to_s
150
+ post[prefix+'country'] = address[:country].to_s
151
+ post[prefix+'state'] = address[:state].blank? ? 'n/a' : address[:state]
152
152
  end
153
153
  end
154
154
 
@@ -182,7 +182,7 @@ module ActiveMerchant #:nodoc:
182
182
 
183
183
  def add_creditcard(post, creditcard, options)
184
184
  if options[:store]
185
- post[:customer_vault] = "add_customer"
185
+ post[:customer_vault] = 'add_customer'
186
186
  post[:customer_vault_id] = options[:store] unless options[:store] == true
187
187
  end
188
188
  post[:ccnumber] = creditcard.number
@@ -194,7 +194,7 @@ module ActiveMerchant #:nodoc:
194
194
 
195
195
  def add_check(post, check, options)
196
196
  if options[:store]
197
- post[:customer_vault] = "add_customer"
197
+ post[:customer_vault] = 'add_customer'
198
198
  post[:customer_vault_id] = options[:store] unless options[:store] == true
199
199
  end
200
200
 
@@ -207,7 +207,7 @@ module ActiveMerchant #:nodoc:
207
207
  end
208
208
 
209
209
  def add_sku(post,options)
210
- post["product_sku_#"] = options[:sku] || options["product_sku_#"]
210
+ post['product_sku_#'] = options[:sku] || options['product_sku_#']
211
211
  end
212
212
 
213
213
  def add_transaction(post, auth)
@@ -231,31 +231,31 @@ module ActiveMerchant #:nodoc:
231
231
  def commit(action, money, parameters)
232
232
  parameters[:amount] = localized_amount(money, parameters[:currency] || default_currency) if money
233
233
  response = parse( ssl_post(self.live_url, post_data(action,parameters)) )
234
- Response.new(response["response"] == "1", message_from(response), response,
235
- :authorization => (response["transactionid"] || response["customer_vault_id"]),
234
+ Response.new(response['response'] == '1', message_from(response), response,
235
+ :authorization => (response['transactionid'] || response['customer_vault_id']),
236
236
  :test => test?,
237
- :cvv_result => response["cvvresponse"],
238
- :avs_result => { :code => response["avsresponse"] }
237
+ :cvv_result => response['cvvresponse'],
238
+ :avs_result => { :code => response['avsresponse'] }
239
239
  )
240
240
 
241
241
  end
242
242
 
243
243
  def expdate(creditcard)
244
- year = sprintf("%.04i", creditcard.year)
245
- month = sprintf("%.02i", creditcard.month)
244
+ year = sprintf('%.04i', creditcard.year)
245
+ month = sprintf('%.02i', creditcard.month)
246
246
 
247
247
  "#{month}#{year[-2..-1]}"
248
248
  end
249
249
 
250
250
 
251
251
  def message_from(response)
252
- case response["responsetext"]
253
- when "SUCCESS", "Approved", nil # This is dubious, but responses from UPDATE are nil.
254
- "This transaction has been approved"
255
- when "DECLINE"
256
- "This transaction has been declined"
252
+ case response['responsetext']
253
+ when 'SUCCESS', 'Approved', nil # This is dubious, but responses from UPDATE are nil.
254
+ 'This transaction has been approved'
255
+ when 'DECLINE'
256
+ 'This transaction has been declined'
257
257
  else
258
- response["responsetext"]
258
+ response['responsetext']
259
259
  end
260
260
  end
261
261
 
@@ -265,7 +265,7 @@ module ActiveMerchant #:nodoc:
265
265
  post[:password] = @options[:password]
266
266
  post[:type] = action if action
267
267
 
268
- request = post.merge(parameters).map {|key,value| "#{key}=#{CGI.escape(value.to_s)}"}.join("&")
268
+ request = post.merge(parameters).map {|key,value| "#{key}=#{CGI.escape(value.to_s)}"}.join('&')
269
269
  request
270
270
  end
271
271
 
@@ -274,7 +274,7 @@ module ActiveMerchant #:nodoc:
274
274
  when source.is_a?(String) then :vault
275
275
  when CreditCard.card_companies.keys.include?(card_brand(source)) then :credit_card
276
276
  when card_brand(source) == 'check' then :check
277
- else raise ArgumentError, "Unsupported funding source provided"
277
+ else raise ArgumentError, 'Unsupported funding source provided'
278
278
  end
279
279
  end
280
280
  end