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
@@ -19,32 +19,32 @@ module ActiveMerchant #:nodoc:
19
19
  }
20
20
 
21
21
  AVS_CODE_TRANSLATOR = {
22
- '0' => "Approved, Address verification was not requested.",
23
- 'A' => "Approved, Address matches only.",
24
- 'B' => "Address Match. Street Address math for international transaction Postal Code not verified because of incompatible formats (Acquirer sent both street address and Postal Code)",
25
- 'C' => "Serv Unavailable. Street address and Postal Code not verified for international transaction because of incompatible formats (Acquirer sent both street and Postal Code).",
26
- 'D' => "Exact Match, Street Address and Postal Code match for international transaction.",
27
- 'F' => "Exact Match, Street Address and Postal Code match. Applies to UK only.",
28
- 'G' => "Ver Unavailable, Non-U.S. Issuer does not participate.",
29
- 'I' => "Ver Unavailable, Address information not verified for international transaction",
30
- 'M' => "Exact Match, Street Address and Postal Code match for international transaction",
31
- 'N' => "No - Address and ZIP Code does not match",
32
- 'P' => "Zip Match, Postal Codes match for international transaction Street address not verified because of incompatible formats (Acquirer sent both street address and Postal Code).",
33
- 'R' => "Retry - Issuer system unavailable",
34
- 'S' => "Serv Unavailable, Service not supported",
35
- 'U' => "Ver Unavailable, Address unavailable.",
36
- 'W' => "ZIP match - Nine character numeric ZIP match only.",
37
- 'X' => "Exact match, Address and nine-character ZIP match.",
38
- 'Y' => "Exact Match, Address and five character ZIP match.",
39
- 'Z' => "Zip Match, Five character numeric ZIP match only.",
40
- '1' => "Cardholder name and ZIP match AMEX only.",
41
- '2' => "Cardholder name, address, and ZIP match AMEX only.",
42
- '3' => "Cardholder name and address match AMEX only.",
43
- '4' => "Cardholder name match AMEX only.",
44
- '5' => "Cardholder name incorrect, ZIP match AMEX only.",
45
- '6' => "Cardholder name incorrect, address and ZIP match AMEX only.",
46
- '7' => "Cardholder name incorrect, address match AMEX only.",
47
- '8' => "Cardholder, all do not match AMEX only."
22
+ '0' => 'Approved, Address verification was not requested.',
23
+ 'A' => 'Approved, Address matches only.',
24
+ 'B' => 'Address Match. Street Address math for international transaction Postal Code not verified because of incompatible formats (Acquirer sent both street address and Postal Code)',
25
+ 'C' => 'Serv Unavailable. Street address and Postal Code not verified for international transaction because of incompatible formats (Acquirer sent both street and Postal Code).',
26
+ 'D' => 'Exact Match, Street Address and Postal Code match for international transaction.',
27
+ 'F' => 'Exact Match, Street Address and Postal Code match. Applies to UK only.',
28
+ 'G' => 'Ver Unavailable, Non-U.S. Issuer does not participate.',
29
+ 'I' => 'Ver Unavailable, Address information not verified for international transaction',
30
+ 'M' => 'Exact Match, Street Address and Postal Code match for international transaction',
31
+ 'N' => 'No - Address and ZIP Code does not match',
32
+ 'P' => 'Zip Match, Postal Codes match for international transaction Street address not verified because of incompatible formats (Acquirer sent both street address and Postal Code).',
33
+ 'R' => 'Retry - Issuer system unavailable',
34
+ 'S' => 'Serv Unavailable, Service not supported',
35
+ 'U' => 'Ver Unavailable, Address unavailable.',
36
+ 'W' => 'ZIP match - Nine character numeric ZIP match only.',
37
+ 'X' => 'Exact match, Address and nine-character ZIP match.',
38
+ 'Y' => 'Exact Match, Address and five character ZIP match.',
39
+ 'Z' => 'Zip Match, Five character numeric ZIP match only.',
40
+ '1' => 'Cardholder name and ZIP match AMEX only.',
41
+ '2' => 'Cardholder name, address, and ZIP match AMEX only.',
42
+ '3' => 'Cardholder name and address match AMEX only.',
43
+ '4' => 'Cardholder name match AMEX only.',
44
+ '5' => 'Cardholder name incorrect, ZIP match AMEX only.',
45
+ '6' => 'Cardholder name incorrect, address and ZIP match AMEX only.',
46
+ '7' => 'Cardholder name incorrect, address match AMEX only.',
47
+ '8' => 'Cardholder, all do not match AMEX only.'
48
48
  }
49
49
 
50
50
  STANDARD_ERROR_CODE_MAPPING = {
@@ -173,7 +173,7 @@ module ActiveMerchant #:nodoc:
173
173
  begin
174
174
  raw_response = ssl_post(live_url, post.to_json, {'Content-Type' => 'application/json'} )
175
175
  response = parse(raw_response)
176
- success = (response['RESPONSE_CODE'] == "00")
176
+ success = (response['RESPONSE_CODE'] == '00')
177
177
  rescue ResponseError => e
178
178
  raw_response = e.response.body
179
179
  response = response_error(raw_response)
@@ -200,13 +200,13 @@ module ActiveMerchant #:nodoc:
200
200
 
201
201
  def json_error(raw_response)
202
202
  {
203
- error_message: "Invalid response received from the Payhub API. Please contact wecare@payhub.com if you continue to receive this message." +
203
+ error_message: 'Invalid response received from the Payhub API. Please contact wecare@payhub.com if you continue to receive this message.' +
204
204
  " (The raw response returned by the API was #{raw_response.inspect})"
205
205
  }
206
206
  end
207
207
 
208
208
  def response_message(response)
209
- (response['RESPONSE_TEXT'] || response["RESPONSE_CODE"] || response[:error_message])
209
+ (response['RESPONSE_TEXT'] || response['RESPONSE_CODE'] || response[:error_message])
210
210
  end
211
211
  end
212
212
  end
@@ -101,19 +101,19 @@ module ActiveMerchant #:nodoc:
101
101
 
102
102
  class_attribute :test_url, :live_url
103
103
 
104
- self.test_url = "https://www.payjunctionlabs.com/quick_link"
105
- self.live_url = "https://payjunction.com/quick_link"
104
+ self.test_url = 'https://www.payjunctionlabs.com/quick_link'
105
+ self.live_url = 'https://payjunction.com/quick_link'
106
106
 
107
107
  TEST_LOGIN = 'pj-ql-01'
108
108
  TEST_PASSWORD = 'pj-ql-01p'
109
109
 
110
- SUCCESS_CODES = ["00", "85"]
110
+ SUCCESS_CODES = ['00', '85']
111
111
  SUCCESS_MESSAGE = 'The transaction was approved.'
112
112
 
113
113
  FAILURE_MESSAGE = 'The transaction was declined.'
114
114
 
115
115
  DECLINE_CODES = {
116
- "AE" => 'Address verification failed because address did not match.',
116
+ 'AE' => 'Address verification failed because address did not match.',
117
117
  'ZE' => 'Address verification failed because zip did not match.',
118
118
  'XE' => 'Address verification failed because zip and address did not match.',
119
119
  'YE' => 'Address verification failed because zip and address did not match.',
@@ -144,8 +144,8 @@ module ActiveMerchant #:nodoc:
144
144
  '96' => 'Declined because of a system error.',
145
145
  'N7' => 'Declined because of a CVV2/CVC2 mismatch.',
146
146
  'M4' => 'Declined.',
147
- "FE" => "There was a format error with your Trinity Gateway Service (API) request.",
148
- "LE" => "Could not log you in (problem with dc_logon and/or dc_password).",
147
+ 'FE' => 'There was a format error with your Trinity Gateway Service (API) request.',
148
+ 'LE' => 'Could not log you in (problem with dc_logon and/or dc_password).',
149
149
  'NL' => 'Aborted because of a system error, please try again later. ',
150
150
  'AB' => 'Aborted because of an upstream system error, please try again later.'
151
151
  }
@@ -366,7 +366,7 @@ module ActiveMerchant #:nodoc:
366
366
  params[:version] = API_VERSION
367
367
  params[:transaction_type] = action
368
368
 
369
- params.reject{|k,v| v.blank?}.collect{ |k, v| "dc_#{k.to_s}=#{CGI.escape(v.to_s)}" }.join("&")
369
+ params.reject{|k,v| v.blank?}.collect{ |k, v| "dc_#{k.to_s}=#{CGI.escape(v.to_s)}" }.join('&')
370
370
  end
371
371
 
372
372
  def parse(body)
@@ -1,14 +1,14 @@
1
1
  module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  class PayJunctionV2Gateway < Gateway
4
- self.display_name = "PayJunction"
5
- self.homepage_url = "https://www.payjunction.com/"
4
+ self.display_name = 'PayJunction'
5
+ self.homepage_url = 'https://www.payjunction.com/'
6
6
 
7
- self.test_url = "https://api.payjunctionlabs.com/transactions"
8
- self.live_url = "https://api.payjunction.com/transactions"
7
+ self.test_url = 'https://api.payjunctionlabs.com/transactions'
8
+ self.live_url = 'https://api.payjunction.com/transactions'
9
9
 
10
- self.supported_countries = ["US"]
11
- self.default_currency = "USD"
10
+ self.supported_countries = ['US']
11
+ self.default_currency = 'USD'
12
12
  self.money_format = :dollars
13
13
  self.supported_cardtypes = [:visa, :master, :american_express, :discover]
14
14
 
@@ -22,51 +22,51 @@ module ActiveMerchant #:nodoc:
22
22
  add_invoice(post, amount, options)
23
23
  add_payment_method(post, payment_method)
24
24
 
25
- commit("purchase", post)
25
+ commit('purchase', post)
26
26
  end
27
27
 
28
28
  def authorize(amount, payment_method, options={})
29
29
  post = {}
30
- post[:status] = "HOLD"
30
+ post[:status] = 'HOLD'
31
31
  add_invoice(post, amount, options)
32
32
  add_payment_method(post, payment_method)
33
33
 
34
- commit("authorize", post)
34
+ commit('authorize', post)
35
35
  end
36
36
 
37
37
  def capture(amount, authorization, options={})
38
38
  post = {}
39
- post[:status] = "CAPTURE"
39
+ post[:status] = 'CAPTURE'
40
40
  post[:transactionId] = authorization
41
41
  add_invoice(post, amount, options)
42
42
 
43
- commit("capture", post)
43
+ commit('capture', post)
44
44
  end
45
45
 
46
46
  def void(authorization, options={})
47
47
  post = {}
48
- post[:status] = "VOID"
48
+ post[:status] = 'VOID'
49
49
  post[:transactionId] = authorization
50
50
 
51
- commit("void", post)
51
+ commit('void', post)
52
52
  end
53
53
 
54
54
  def refund(amount, authorization, options={})
55
55
  post = {}
56
- post[:action] = "REFUND"
56
+ post[:action] = 'REFUND'
57
57
  post[:transactionId] = authorization
58
58
  add_invoice(post, amount, options)
59
59
 
60
- commit("refund", post)
60
+ commit('refund', post)
61
61
  end
62
62
 
63
63
  def credit(amount, payment_method, options={})
64
64
  post = {}
65
- post[:action] = "REFUND"
65
+ post[:action] = 'REFUND'
66
66
  add_invoice(post, amount, options)
67
67
  add_payment_method(post, payment_method)
68
68
 
69
- commit("credit", post)
69
+ commit('credit', post)
70
70
  end
71
71
 
72
72
  def verify(credit_card, options={})
@@ -129,7 +129,7 @@ module ActiveMerchant #:nodoc:
129
129
  end
130
130
 
131
131
  def ssl_invoke(action, params)
132
- if ["purchase", "authorize", "refund", "credit"].include?(action)
132
+ if ['purchase', 'authorize', 'refund', 'credit'].include?(action)
133
133
  ssl_post(url(), post_data(params), headers)
134
134
  else
135
135
  ssl_request(:put, url(params), post_data(params), headers)
@@ -138,10 +138,10 @@ module ActiveMerchant #:nodoc:
138
138
 
139
139
  def headers
140
140
  {
141
- "Authorization" => "Basic " + Base64.encode64("#{@options[:api_login]}:#{@options[:api_password]}").strip,
142
- "Content-Type" => "application/x-www-form-urlencoded;charset=UTF-8",
143
- "Accept" => "application/json",
144
- "X-PJ-Application-Key" => "#{@options[:api_key]}"
141
+ 'Authorization' => 'Basic ' + Base64.encode64("#{@options[:api_login]}:#{@options[:api_password]}").strip,
142
+ 'Content-Type' => 'application/x-www-form-urlencoded;charset=UTF-8',
143
+ 'Accept' => 'application/json',
144
+ 'X-PJ-Application-Key' => "#{@options[:api_key]}"
145
145
  }
146
146
  end
147
147
 
@@ -157,33 +157,33 @@ module ActiveMerchant #:nodoc:
157
157
  begin
158
158
  JSON.parse(body)
159
159
  rescue JSON::ParserError
160
- message = "Invalid JSON response received from PayJunctionV2Gateway. Please contact PayJunctionV2Gateway if you continue to receive this message."
160
+ message = 'Invalid JSON response received from PayJunctionV2Gateway. Please contact PayJunctionV2Gateway if you continue to receive this message.'
161
161
  message += " (The raw response returned by the API was #{body.inspect})"
162
162
  {
163
- "errors" => [{
164
- "message" => message
163
+ 'errors' => [{
164
+ 'message' => message
165
165
  }]
166
166
  }
167
167
  end
168
168
  end
169
169
 
170
170
  def success_from(response)
171
- return response["response"]["approved"] if response["response"]
171
+ return response['response']['approved'] if response['response']
172
172
  false
173
173
  end
174
174
 
175
175
  def message_from(response)
176
- return response["response"]["message"] if response["response"]
176
+ return response['response']['message'] if response['response']
177
177
 
178
- response["errors"].inject(""){ |message,error| error["message"] + "|" + message } if response["errors"]
178
+ response['errors'].inject(''){ |message,error| error['message'] + '|' + message } if response['errors']
179
179
  end
180
180
 
181
181
  def authorization_from(response)
182
- response["transactionId"]
182
+ response['transactionId']
183
183
  end
184
184
 
185
185
  def error_from(response)
186
- response["response"]["code"] if response["response"]
186
+ response['response']['code'] if response['response']
187
187
  end
188
188
  end
189
189
  end
@@ -41,7 +41,7 @@ module ActiveMerchant #:nodoc:
41
41
  private
42
42
  # Used for capturing, which is currently not supported.
43
43
  def add_reference(post, identification)
44
- auth, trans_id = identification.split(";")
44
+ auth, trans_id = identification.split(';')
45
45
  post[:authnum] = auth
46
46
  post[:transid] = trans_id
47
47
  end
@@ -79,7 +79,7 @@ module ActiveMerchant #:nodoc:
79
79
  end
80
80
 
81
81
  def authorization_from(response)
82
- [ response[:authnum], response[:transid] ].compact.join(";")
82
+ [ response[:authnum], response[:transid] ].compact.join(';')
83
83
  end
84
84
 
85
85
  def test_response?(response)
@@ -93,7 +93,7 @@ module ActiveMerchant #:nodoc:
93
93
  def parse(body)
94
94
  response = {}
95
95
  body.to_s.each_line do |l|
96
- key, value = l.split(":", 2)
96
+ key, value = l.split(':', 2)
97
97
  response[key.to_s.downcase.to_sym] = value.strip
98
98
  end
99
99
  response
@@ -104,7 +104,7 @@ module ActiveMerchant #:nodoc:
104
104
  parameters[:merchant_id] = @options[:login]
105
105
  parameters[:password] = @options[:password]
106
106
 
107
- parameters.reject{|k,v| v.blank?}.collect { |key, value| "#{key.to_s.upcase}=#{CGI.escape(value.to_s)}" }.join("&")
107
+ parameters.reject{|k,v| v.blank?}.collect { |key, value| "#{key.to_s.upcase}=#{CGI.escape(value.to_s)}" }.join('&')
108
108
  end
109
109
  end
110
110
  end
@@ -21,20 +21,20 @@ module ActiveMerchant #:nodoc:
21
21
  }
22
22
 
23
23
  CURRENCY_CODES = {
24
- "AUD"=> '036',
25
- "CAD"=> '124',
26
- "CZK"=> '203',
27
- "DKK"=> '208',
28
- "HKD"=> '344',
29
- "ICK"=> '352',
30
- "JPY"=> '392',
31
- "NOK"=> '578',
32
- "SGD"=> '702',
33
- "SEK"=> '752',
34
- "CHF"=> '756',
35
- "GBP"=> '826',
36
- "USD"=> '840',
37
- "EUR"=> '978'
24
+ 'AUD'=> '036',
25
+ 'CAD'=> '124',
26
+ 'CZK'=> '203',
27
+ 'DKK'=> '208',
28
+ 'HKD'=> '344',
29
+ 'ICK'=> '352',
30
+ 'JPY'=> '392',
31
+ 'NOK'=> '578',
32
+ 'SGD'=> '702',
33
+ 'SEK'=> '752',
34
+ 'CHF'=> '756',
35
+ 'GBP'=> '826',
36
+ 'USD'=> '840',
37
+ 'EUR'=> '978'
38
38
  }
39
39
 
40
40
  SUCCESS_CODES = ['00000']
@@ -187,7 +187,7 @@ module ActiveMerchant #:nodoc:
187
187
  :archivage => parameters[:order_id]
188
188
  )
189
189
 
190
- parameters.collect { |key, value| "#{key.to_s.upcase}=#{CGI.escape(value.to_s)}" }.join("&")
190
+ parameters.collect { |key, value| "#{key.to_s.upcase}=#{CGI.escape(value.to_s)}" }.join('&')
191
191
  end
192
192
 
193
193
  def unique_id(seed = 0)
@@ -159,8 +159,8 @@ module ActiveMerchant
159
159
  def add_echeck(params, echeck, options)
160
160
  tele_check = {}
161
161
 
162
- tele_check[:check_number] = echeck.number || "001"
163
- tele_check[:check_type] = "P"
162
+ tele_check[:check_number] = echeck.number || '001'
163
+ tele_check[:check_type] = 'P'
164
164
  tele_check[:routing_number] = echeck.routing_number
165
165
  tele_check[:account_number] = echeck.account_number
166
166
  tele_check[:accountholder_name] = "#{echeck.first_name} #{echeck.last_name}"
@@ -281,7 +281,7 @@ module ActiveMerchant
281
281
 
282
282
  def post_data(params)
283
283
  return nil unless params
284
- params.reject { |k, v| v.blank? }.collect { |k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join("&")
284
+ params.reject { |k, v| v.blank? }.collect { |k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join('&')
285
285
  end
286
286
 
287
287
  def generate_hmac(nonce, current_timestamp, payload)
@@ -291,7 +291,7 @@ module ActiveMerchant
291
291
  current_timestamp.to_s,
292
292
  @options[:token],
293
293
  payload
294
- ].join("")
294
+ ].join('')
295
295
  hash = Base64.strict_encode64(OpenSSL::HMAC.hexdigest('sha256', @options[:apisecret], message))
296
296
  hash
297
297
  end
@@ -379,7 +379,7 @@ module ActiveMerchant
379
379
  end
380
380
 
381
381
  def json_error(raw_response)
382
- {"error" => "Unable to parse response: #{raw_response.inspect}"}
382
+ {'error' => "Unable to parse response: #{raw_response.inspect}"}
383
383
  end
384
384
  end
385
385
  end
@@ -1,4 +1,4 @@
1
- require "nokogiri"
1
+ require 'nokogiri'
2
2
 
3
3
  module ActiveMerchant #:nodoc:
4
4
  module Billing #:nodoc:
@@ -16,7 +16,7 @@ module ActiveMerchant #:nodoc:
16
16
  self.supported_cardtypes = [:visa, :master, :american_express, :discover]
17
17
  self.homepage_url = 'http://payex.com/'
18
18
  self.display_name = 'Payex'
19
- self.default_currency = "EUR"
19
+ self.default_currency = 'EUR'
20
20
 
21
21
  TRANSACTION_STATUS = {
22
22
  sale: '0',
@@ -360,11 +360,11 @@ module ActiveMerchant #:nodoc:
360
360
  response = {}
361
361
 
362
362
  xmldoc = Nokogiri::XML(xml)
363
- body = xmldoc.xpath("//soap:Body/*[1]")[0].inner_text
363
+ body = xmldoc.xpath('//soap:Body/*[1]')[0].inner_text
364
364
 
365
365
  doc = Nokogiri::XML(body)
366
366
 
367
- doc.root.xpath("*").each do |node|
367
+ doc.root.xpath('*').each do |node|
368
368
  if (node.elements.size == 0)
369
369
  response[node.name.downcase.to_sym] = node.text
370
370
  else
@@ -56,8 +56,8 @@ module ActiveMerchant #:nodoc:
56
56
  end
57
57
 
58
58
  def verify_credentials
59
- response = void("0")
60
- response.params["result"] != "26"
59
+ response = void('0')
60
+ response.params['result'] != '26'
61
61
  end
62
62
 
63
63
  # Adds or modifies a recurring Payflow profile. See the Payflow Pro Recurring Billing Guide for more details:
@@ -252,8 +252,8 @@ module ActiveMerchant #:nodoc:
252
252
  end
253
253
 
254
254
  def expdate(creditcard)
255
- year = sprintf("%.4i", creditcard.year.to_s.sub(/^0+/, ''))
256
- month = sprintf("%.2i", creditcard.month.to_s.sub(/^0+/, ''))
255
+ year = sprintf('%.4i', creditcard.year.to_s.sub(/^0+/, ''))
256
+ month = sprintf('%.2i', creditcard.month.to_s.sub(/^0+/, ''))
257
257
 
258
258
  "#{year}#{month}"
259
259
  end
@@ -309,10 +309,10 @@ module ActiveMerchant #:nodoc:
309
309
  end
310
310
  end
311
311
  if action != :add
312
- xml.tag! "ProfileID", options[:profile_id]
312
+ xml.tag! 'ProfileID', options[:profile_id]
313
313
  end
314
314
  if action == :inquiry
315
- xml.tag! "PaymentHistory", ( options[:history] ? 'Y' : 'N' )
315
+ xml.tag! 'PaymentHistory', ( options[:history] ? 'Y' : 'N' )
316
316
  end
317
317
  end
318
318
  end
@@ -335,7 +335,7 @@ module ActiveMerchant #:nodoc:
335
335
 
336
336
  def format_rp_date(time)
337
337
  case time
338
- when Time, Date then time.strftime("%m%d%Y")
338
+ when Time, Date then time.strftime('%m%d%Y')
339
339
  else
340
340
  time.to_s
341
341
  end