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
@@ -179,28 +179,28 @@ module ActiveMerchant
179
179
  add_auth(post)
180
180
  post.merge!('order.type' => TRANSACTIONS[action])
181
181
 
182
- request = post.map { |k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join("&")
182
+ request = post.map { |k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join('&')
183
183
  response = ssl_post(self.live_url, request)
184
184
 
185
185
  params = {}
186
186
  CGI.parse(response).each_pair do |key, value|
187
- actual_key = key.split(".").last
187
+ actual_key = key.split('.').last
188
188
  params[actual_key.underscore.to_sym] = value[0]
189
189
  end
190
190
 
191
191
  message = "#{SUMMARY_CODES[params[:summary_code]]} - #{RESPONSE_CODES[params[:response_code]]}"
192
192
 
193
- success = (params[:summary_code] ? (params[:summary_code] == "0") : (params[:response_code] == "00"))
193
+ success = (params[:summary_code] ? (params[:summary_code] == '0') : (params[:response_code] == '00'))
194
194
 
195
195
  Response.new(success, message, params,
196
- :test => (@options[:merchant].to_s == "TEST"),
196
+ :test => (@options[:merchant].to_s == 'TEST'),
197
197
  :authorization => post[:order_number]
198
198
  )
199
199
  rescue ActiveMerchant::ResponseError => e
200
200
  raise unless e.response.code == '403'
201
- return Response.new(false, "Invalid credentials", {}, :test => test?)
201
+ return Response.new(false, 'Invalid credentials', {}, :test => test?)
202
202
  rescue ActiveMerchant::ClientCertificateError
203
- return Response.new(false, "Invalid certificate", {}, :test => test?)
203
+ return Response.new(false, 'Invalid certificate', {}, :test => test?)
204
204
  end
205
205
  end
206
206
  end
@@ -113,7 +113,7 @@ module ActiveMerchant #:nodoc:
113
113
  end
114
114
 
115
115
  def add_invoice(post, options)
116
- post[:description] = options[:description] || "Active Merchant Purchase"
116
+ post[:description] = options[:description] || 'Active Merchant Purchase'
117
117
  end
118
118
 
119
119
  def add_capture(post, options)
@@ -148,8 +148,8 @@ module ActiveMerchant #:nodoc:
148
148
 
149
149
  def headers(params = {})
150
150
  result = {
151
- "Content-Type" => "application/json",
152
- "Authorization" => "Basic #{Base64.strict_encode64(options[:api_key] + ':').strip}"
151
+ 'Content-Type' => 'application/json',
152
+ 'Authorization' => "Basic #{Base64.strict_encode64(options[:api_key] + ':').strip}"
153
153
  }
154
154
 
155
155
  result['X-Partner-Key'] = params[:partner_key] if params[:partner_key]
@@ -167,9 +167,9 @@ module ActiveMerchant #:nodoc:
167
167
  body = parse(e.response.body)
168
168
  end
169
169
 
170
- if body["response"]
170
+ if body['response']
171
171
  success_response(body)
172
- elsif body["error"]
172
+ elsif body['error']
173
173
  error_response(body)
174
174
  end
175
175
 
@@ -178,7 +178,7 @@ module ActiveMerchant #:nodoc:
178
178
  end
179
179
 
180
180
  def success_response(body)
181
- response = body["response"]
181
+ response = body['response']
182
182
  Response.new(
183
183
  true,
184
184
  response['status_message'],
@@ -199,7 +199,7 @@ module ActiveMerchant #:nodoc:
199
199
  end
200
200
 
201
201
  def unparsable_response(raw_response)
202
- message = "Invalid JSON response received from Pin Payments. Please contact support@pin.net.au if you continue to receive this message."
202
+ message = 'Invalid JSON response received from Pin Payments. Please contact support@pin.net.au if you continue to receive this message.'
203
203
  message += " (The raw response returned by the API was #{raw_response.inspect})"
204
204
  return Response.new(false, message)
205
205
  end
@@ -3,80 +3,80 @@ module ActiveMerchant
3
3
  class PlugnpayGateway < Gateway
4
4
  class PlugnpayPostData < PostData
5
5
  # Fields that will be sent even if they are blank
6
- self.required_fields = [ :publisher_name, :publisher_password,
7
- :card_amount, :card_name, :card_number, :card_exp, :orderID ]
6
+ self.required_fields = [:publisher_name, :publisher_password,
7
+ :card_amount, :card_name, :card_number, :card_exp, :orderID]
8
8
  end
9
9
  self.live_url = self.test_url = 'https://pay1.plugnpay.com/payment/pnpremote.cgi'
10
10
 
11
11
  CARD_CODE_MESSAGES = {
12
- "M" => "Card verification number matched",
13
- "N" => "Card verification number didn't match",
14
- "P" => "Card verification number was not processed",
15
- "S" => "Card verification number should be on card but was not indicated",
16
- "U" => "Issuer was not certified for card verification"
12
+ 'M' => 'Card verification number matched',
13
+ 'N' => "Card verification number didn't match",
14
+ 'P' => 'Card verification number was not processed',
15
+ 'S' => 'Card verification number should be on card but was not indicated',
16
+ 'U' => 'Issuer was not certified for card verification'
17
17
  }
18
18
 
19
19
  CARD_CODE_ERRORS = %w( N S )
20
20
 
21
21
  AVS_MESSAGES = {
22
- "A" => "Street address matches billing information, zip/postal code does not",
23
- "B" => "Address information not provided for address verification check",
24
- "E" => "Address verification service error",
25
- "G" => "Non-U.S. card-issuing bank",
26
- "N" => "Neither street address nor zip/postal match billing information",
27
- "P" => "Address verification not applicable for this transaction",
28
- "R" => "Payment gateway was unavailable or timed out",
29
- "S" => "Address verification service not supported by issuer",
30
- "U" => "Address information is unavailable",
31
- "W" => "9-digit zip/postal code matches billing information, street address does not",
32
- "X" => "Street address and 9-digit zip/postal code matches billing information",
33
- "Y" => "Street address and 5-digit zip/postal code matches billing information",
34
- "Z" => "5-digit zip/postal code matches billing information, street address does not",
22
+ 'A' => 'Street address matches billing information, zip/postal code does not',
23
+ 'B' => 'Address information not provided for address verification check',
24
+ 'E' => 'Address verification service error',
25
+ 'G' => 'Non-U.S. card-issuing bank',
26
+ 'N' => 'Neither street address nor zip/postal match billing information',
27
+ 'P' => 'Address verification not applicable for this transaction',
28
+ 'R' => 'Payment gateway was unavailable or timed out',
29
+ 'S' => 'Address verification service not supported by issuer',
30
+ 'U' => 'Address information is unavailable',
31
+ 'W' => '9-digit zip/postal code matches billing information, street address does not',
32
+ 'X' => 'Street address and 9-digit zip/postal code matches billing information',
33
+ 'Y' => 'Street address and 5-digit zip/postal code matches billing information',
34
+ 'Z' => '5-digit zip/postal code matches billing information, street address does not',
35
35
  }
36
36
 
37
37
  AVS_ERRORS = %w( A E N R W Z )
38
38
 
39
39
  PAYMENT_GATEWAY_RESPONSES = {
40
- "P01" => "AVS Mismatch Failure",
41
- "P02" => "CVV2 Mismatch Failure",
42
- "P21" => "Transaction may not be marked",
43
- "P30" => "Test Tran. Bad Card",
44
- "P35" => "Test Tran. Problem",
45
- "P40" => "Username already exists",
46
- "P41" => "Username is blank",
47
- "P50" => "Fraud Screen Failure",
48
- "P51" => "Missing PIN Code",
49
- "P52" => "Invalid Bank Acct. No.",
50
- "P53" => "Invalid Bank Routing No.",
51
- "P54" => "Invalid/Missing Check No.",
52
- "P55" => "Invalid Credit Card No.",
53
- "P56" => "Invalid CVV2/CVC2 No.",
54
- "P57" => "Expired. CC Exp. Date",
55
- "P58" => "Missing Data",
56
- "P59" => "Missing Email Address",
57
- "P60" => "Zip Code does not match Billing State.",
58
- "P61" => "Invalid Billing Zip Code",
59
- "P62" => "Zip Code does not match Shipping State.",
60
- "P63" => "Invalid Shipping Zip Code",
61
- "P64" => "Invalid Credit Card CVV2/CVC2 Format.",
62
- "P65" => "Maximum number of attempts has been exceeded.",
63
- "P66" => "Credit Card number has been flagged and can not be used to access this service.",
64
- "P67" => "IP Address is on Blocked List.",
65
- "P68" => "Billing country does not match ipaddress country.",
66
- "P69" => "US based ipaddresses are currently blocked.",
67
- "P70" => "Credit Cards issued from this bank are currently not being accepted.",
68
- "P71" => "Credit Cards issued from this bank are currently not being accepted.",
69
- "P72" => "Daily volume exceeded.",
70
- "P73" => "Too many transactions within allotted time.",
71
- "P91" => "Missing/incorrect password",
72
- "P92" => "Account not configured for mobil administration",
73
- "P93" => "IP Not registered to username.",
74
- "P94" => "Mode not permitted for this account.",
75
- "P95" => "Currently Blank",
76
- "P96" => "Currently Blank",
77
- "P97" => "Processor not responding",
78
- "P98" => "Missing merchant/publisher name",
79
- "P99" => "Currently Blank"
40
+ 'P01' => 'AVS Mismatch Failure',
41
+ 'P02' => 'CVV2 Mismatch Failure',
42
+ 'P21' => 'Transaction may not be marked',
43
+ 'P30' => 'Test Tran. Bad Card',
44
+ 'P35' => 'Test Tran. Problem',
45
+ 'P40' => 'Username already exists',
46
+ 'P41' => 'Username is blank',
47
+ 'P50' => 'Fraud Screen Failure',
48
+ 'P51' => 'Missing PIN Code',
49
+ 'P52' => 'Invalid Bank Acct. No.',
50
+ 'P53' => 'Invalid Bank Routing No.',
51
+ 'P54' => 'Invalid/Missing Check No.',
52
+ 'P55' => 'Invalid Credit Card No.',
53
+ 'P56' => 'Invalid CVV2/CVC2 No.',
54
+ 'P57' => 'Expired. CC Exp. Date',
55
+ 'P58' => 'Missing Data',
56
+ 'P59' => 'Missing Email Address',
57
+ 'P60' => 'Zip Code does not match Billing State.',
58
+ 'P61' => 'Invalid Billing Zip Code',
59
+ 'P62' => 'Zip Code does not match Shipping State.',
60
+ 'P63' => 'Invalid Shipping Zip Code',
61
+ 'P64' => 'Invalid Credit Card CVV2/CVC2 Format.',
62
+ 'P65' => 'Maximum number of attempts has been exceeded.',
63
+ 'P66' => 'Credit Card number has been flagged and can not be used to access this service.',
64
+ 'P67' => 'IP Address is on Blocked List.',
65
+ 'P68' => 'Billing country does not match ipaddress country.',
66
+ 'P69' => 'US based ipaddresses are currently blocked.',
67
+ 'P70' => 'Credit Cards issued from this bank are currently not being accepted.',
68
+ 'P71' => 'Credit Cards issued from this bank are currently not being accepted.',
69
+ 'P72' => 'Daily volume exceeded.',
70
+ 'P73' => 'Too many transactions within allotted time.',
71
+ 'P91' => 'Missing/incorrect password',
72
+ 'P92' => 'Account not configured for mobil administration',
73
+ 'P93' => 'IP Not registered to username.',
74
+ 'P94' => 'Mode not permitted for this account.',
75
+ 'P95' => 'Currently Blank',
76
+ 'P96' => 'Currently Blank',
77
+ 'P97' => 'Processor not responding',
78
+ 'P98' => 'Missing merchant/publisher name',
79
+ 'P99' => 'Currently Blank'
80
80
  }
81
81
 
82
82
  TRANSACTIONS = {
@@ -273,8 +273,8 @@ module ActiveMerchant
273
273
  end
274
274
 
275
275
  def expdate(creditcard)
276
- year = sprintf("%.4i", creditcard.year)
277
- month = sprintf("%.2i", creditcard.month)
276
+ year = sprintf('%.4i', creditcard.year)
277
+ month = sprintf('%.2i', creditcard.month)
278
278
 
279
279
  "#{month}/#{year[-2..-1]}"
280
280
  end
@@ -15,122 +15,122 @@ module ActiveMerchant #:nodoc:
15
15
  self.display_name = 'ProPay'
16
16
 
17
17
  STATUS_RESPONSE_CODES = {
18
- "00" => "Success",
19
- "20" => "Invalid username",
20
- "21" => "Invalid transType",
21
- "22" => "Invalid Currency Code",
22
- "23" => "Invalid accountType",
23
- "24" => "Invalid sourceEmail",
24
- "25" => "Invalid firstName",
25
- "26" => "Invalid mInitial",
26
- "27" => "Invalid lastName",
27
- "28" => "Invalid billAddr",
28
- "29" => "Invalid aptNum",
29
- "30" => "Invalid city",
30
- "31" => "Invalid state",
31
- "32" => "Invalid billZip",
32
- "33" => "Invalid mailAddr",
33
- "34" => "Invalid mailApt",
34
- "35" => "Invalid mailCity",
35
- "36" => "Invalid mailState",
36
- "37" => "Invalid mailZip",
37
- "38" => "Invalid dayPhone",
38
- "39" => "Invalid evenPhone",
39
- "40" => "Invalid ssn",
40
- "41" => "Invalid dob",
41
- "42" => "Invalid recEmail",
42
- "43" => "Invalid knownAccount",
43
- "44" => "Invalid amount",
44
- "45" => "Invalid invNum",
45
- "46" => "Invalid rtNum",
46
- "47" => "Invalid accntNum",
47
- "48" => "Invalid ccNum",
48
- "49" => "Invalid expDate",
49
- "50" => "Invalid cvv2",
50
- "51" => "Invalid transNum and/or Unable to act perform actions on transNum due to funding",
51
- "52" => "Invalid splitNum",
52
- "53" => "A ProPay account with this email address already exists AND/OR User has no account number",
53
- "54" => "A ProPay account with this social security number already exists",
54
- "55" => "The email address provided does not correspond to a ProPay account.",
55
- "56" => "Recipient’s email address shouldn’t have a ProPay account and does",
56
- "57" => "Cannot settle transaction because it already expired",
57
- "58" => "Credit card declined",
58
- "59" => "Invalid Credential or IP address not allowed",
59
- "60" => "Credit card authorization timed out; retry at a later time",
60
- "61" => "Amount exceeds single transaction limit",
61
- "62" => "Amount exceeds monthly volume limit",
62
- "63" => "Insufficient funds in account",
63
- "64" => "Over credit card use limit",
64
- "65" => "Miscellaneous error",
65
- "66" => "Denied a ProPay account",
66
- "67" => "Unauthorized service requested",
67
- "68" => "Account not affiliated",
68
- "69" => "Duplicate invoice number (The same card was charged for the same amount with the same invoice number (including blank invoices) in a 1 minute period. Details about the original transaction are included whenever a 69 response is returned. These details include a repeat of the auth code, the original AVS response, and the original CVV response.)",
69
- "70" => "Duplicate external ID",
70
- "71" => "Account previously set up, but problem affiliating it with partner",
71
- "72" => "The ProPay Account has already been upgraded to a Premium Account",
72
- "73" => "Invalid Destination Account",
73
- "74" => "Account or Trans Error",
74
- "75" => "Money already pulled",
75
- "76" => "Not Premium (used only for push/pull transactions)",
76
- "77" => "Empty results",
77
- "78" => "Invalid Authentication",
78
- "79" => "Generic account status error",
79
- "80" => "Invalid Password",
80
- "81" => "Account Expired",
81
- "82" => "InvalidUserID",
82
- "83" => "BatchTransCountError",
83
- "84" => "InvalidBeginDate",
84
- "85" => "InvalidEndDate",
85
- "86" => "InvalidExternalID",
86
- "87" => "DuplicateUserID",
87
- "88" => "Invalid track 1",
88
- "89" => "Invalid track 2",
89
- "90" => "Transaction already refunded",
90
- "91" => "Duplicate Batch ID"
18
+ '00' => 'Success',
19
+ '20' => 'Invalid username',
20
+ '21' => 'Invalid transType',
21
+ '22' => 'Invalid Currency Code',
22
+ '23' => 'Invalid accountType',
23
+ '24' => 'Invalid sourceEmail',
24
+ '25' => 'Invalid firstName',
25
+ '26' => 'Invalid mInitial',
26
+ '27' => 'Invalid lastName',
27
+ '28' => 'Invalid billAddr',
28
+ '29' => 'Invalid aptNum',
29
+ '30' => 'Invalid city',
30
+ '31' => 'Invalid state',
31
+ '32' => 'Invalid billZip',
32
+ '33' => 'Invalid mailAddr',
33
+ '34' => 'Invalid mailApt',
34
+ '35' => 'Invalid mailCity',
35
+ '36' => 'Invalid mailState',
36
+ '37' => 'Invalid mailZip',
37
+ '38' => 'Invalid dayPhone',
38
+ '39' => 'Invalid evenPhone',
39
+ '40' => 'Invalid ssn',
40
+ '41' => 'Invalid dob',
41
+ '42' => 'Invalid recEmail',
42
+ '43' => 'Invalid knownAccount',
43
+ '44' => 'Invalid amount',
44
+ '45' => 'Invalid invNum',
45
+ '46' => 'Invalid rtNum',
46
+ '47' => 'Invalid accntNum',
47
+ '48' => 'Invalid ccNum',
48
+ '49' => 'Invalid expDate',
49
+ '50' => 'Invalid cvv2',
50
+ '51' => 'Invalid transNum and/or Unable to act perform actions on transNum due to funding',
51
+ '52' => 'Invalid splitNum',
52
+ '53' => 'A ProPay account with this email address already exists AND/OR User has no account number',
53
+ '54' => 'A ProPay account with this social security number already exists',
54
+ '55' => 'The email address provided does not correspond to a ProPay account.',
55
+ '56' => 'Recipient’s email address shouldn’t have a ProPay account and does',
56
+ '57' => 'Cannot settle transaction because it already expired',
57
+ '58' => 'Credit card declined',
58
+ '59' => 'Invalid Credential or IP address not allowed',
59
+ '60' => 'Credit card authorization timed out; retry at a later time',
60
+ '61' => 'Amount exceeds single transaction limit',
61
+ '62' => 'Amount exceeds monthly volume limit',
62
+ '63' => 'Insufficient funds in account',
63
+ '64' => 'Over credit card use limit',
64
+ '65' => 'Miscellaneous error',
65
+ '66' => 'Denied a ProPay account',
66
+ '67' => 'Unauthorized service requested',
67
+ '68' => 'Account not affiliated',
68
+ '69' => 'Duplicate invoice number (The same card was charged for the same amount with the same invoice number (including blank invoices) in a 1 minute period. Details about the original transaction are included whenever a 69 response is returned. These details include a repeat of the auth code, the original AVS response, and the original CVV response.)',
69
+ '70' => 'Duplicate external ID',
70
+ '71' => 'Account previously set up, but problem affiliating it with partner',
71
+ '72' => 'The ProPay Account has already been upgraded to a Premium Account',
72
+ '73' => 'Invalid Destination Account',
73
+ '74' => 'Account or Trans Error',
74
+ '75' => 'Money already pulled',
75
+ '76' => 'Not Premium (used only for push/pull transactions)',
76
+ '77' => 'Empty results',
77
+ '78' => 'Invalid Authentication',
78
+ '79' => 'Generic account status error',
79
+ '80' => 'Invalid Password',
80
+ '81' => 'Account Expired',
81
+ '82' => 'InvalidUserID',
82
+ '83' => 'BatchTransCountError',
83
+ '84' => 'InvalidBeginDate',
84
+ '85' => 'InvalidEndDate',
85
+ '86' => 'InvalidExternalID',
86
+ '87' => 'DuplicateUserID',
87
+ '88' => 'Invalid track 1',
88
+ '89' => 'Invalid track 2',
89
+ '90' => 'Transaction already refunded',
90
+ '91' => 'Duplicate Batch ID'
91
91
  }
92
92
 
93
93
  TRANSACTION_RESPONSE_CODES = {
94
- "00" => "Success",
95
- "1" => "Transaction blocked by issuer",
96
- "4" => "Pick up card and deny transaction",
97
- "5" => "Problem with the account",
98
- "6" => "Customer requested stop to recurring payment",
99
- "7" => "Customer requested stop to all recurring payments",
100
- "8" => "Honor with ID only",
101
- "9" => "Unpaid items on customer account",
102
- "12" => "Invalid transaction",
103
- "13" => "Amount Error",
104
- "14" => "Invalid card number",
105
- "15" => "No such issuer. Could not route transaction",
106
- "16" => "Refund error",
107
- "17" => "Over limit",
108
- "19" => "Reenter transaction or the merchant account may be boarded incorrectly",
109
- "25" => "Invalid terminal 41 Lost card",
110
- "43" => "Stolen card",
111
- "51" => "Insufficient funds",
112
- "52" => "No such account",
113
- "54" => "Expired card",
114
- "55" => "Incorrect PIN",
115
- "57" => "Bank does not allow this type of purchase",
116
- "58" => "Credit card network does not allow this type of purchase for your merchant account.",
117
- "61" => "Exceeds issuer withdrawal limit",
118
- "62" => "Issuer does not allow this card to be charged for your business.",
119
- "63" => "Security Violation",
120
- "65" => "Activity limit exceeded",
121
- "75" => "PIN tries exceeded",
122
- "76" => "Unable to locate account",
123
- "78" => "Account not recognized",
124
- "80" => "Invalid Date",
125
- "82" => "Invalid CVV2",
126
- "83" => "Cannot verify the PIN",
127
- "85" => "Service not supported for this card",
128
- "93" => "Cannot complete transaction. Customer should call 800 number.",
129
- "95" => "Misc Error Transaction failure",
130
- "96" => "Issuer system malfunction or timeout.",
131
- "97" => "Approved for a lesser amount. ProPay will not settle and consider this a decline.",
132
- "98" => "Failure HV",
133
- "99" => "Generic decline or unable to parse issuer response code"
94
+ '00' => 'Success',
95
+ '1' => 'Transaction blocked by issuer',
96
+ '4' => 'Pick up card and deny transaction',
97
+ '5' => 'Problem with the account',
98
+ '6' => 'Customer requested stop to recurring payment',
99
+ '7' => 'Customer requested stop to all recurring payments',
100
+ '8' => 'Honor with ID only',
101
+ '9' => 'Unpaid items on customer account',
102
+ '12' => 'Invalid transaction',
103
+ '13' => 'Amount Error',
104
+ '14' => 'Invalid card number',
105
+ '15' => 'No such issuer. Could not route transaction',
106
+ '16' => 'Refund error',
107
+ '17' => 'Over limit',
108
+ '19' => 'Reenter transaction or the merchant account may be boarded incorrectly',
109
+ '25' => 'Invalid terminal 41 Lost card',
110
+ '43' => 'Stolen card',
111
+ '51' => 'Insufficient funds',
112
+ '52' => 'No such account',
113
+ '54' => 'Expired card',
114
+ '55' => 'Incorrect PIN',
115
+ '57' => 'Bank does not allow this type of purchase',
116
+ '58' => 'Credit card network does not allow this type of purchase for your merchant account.',
117
+ '61' => 'Exceeds issuer withdrawal limit',
118
+ '62' => 'Issuer does not allow this card to be charged for your business.',
119
+ '63' => 'Security Violation',
120
+ '65' => 'Activity limit exceeded',
121
+ '75' => 'PIN tries exceeded',
122
+ '76' => 'Unable to locate account',
123
+ '78' => 'Account not recognized',
124
+ '80' => 'Invalid Date',
125
+ '82' => 'Invalid CVV2',
126
+ '83' => 'Cannot verify the PIN',
127
+ '85' => 'Service not supported for this card',
128
+ '93' => 'Cannot complete transaction. Customer should call 800 number.',
129
+ '95' => 'Misc Error Transaction failure',
130
+ '96' => 'Issuer system malfunction or timeout.',
131
+ '97' => 'Approved for a lesser amount. ProPay will not settle and consider this a decline.',
132
+ '98' => 'Failure HV',
133
+ '99' => 'Generic decline or unable to parse issuer response code'
134
134
  }
135
135
 
136
136
  def initialize(options={})
@@ -145,7 +145,7 @@ module ActiveMerchant #:nodoc:
145
145
  add_address(xml, options)
146
146
  add_account(xml, options)
147
147
  add_recurring(xml, options)
148
- xml.transType "04"
148
+ xml.transType '04'
149
149
  end
150
150
 
151
151
  commit(request)
@@ -158,7 +158,7 @@ module ActiveMerchant #:nodoc:
158
158
  add_address(xml, options)
159
159
  add_account(xml, options)
160
160
  add_recurring(xml, options)
161
- xml.transType "05"
161
+ xml.transType '05'
162
162
  end
163
163
 
164
164
  commit(request)
@@ -169,7 +169,7 @@ module ActiveMerchant #:nodoc:
169
169
  add_invoice(xml, money, options)
170
170
  add_account(xml, options)
171
171
  xml.transNum authorization
172
- xml.transType "06"
172
+ xml.transType '06'
173
173
  end
174
174
 
175
175
  commit(request)
@@ -180,7 +180,7 @@ module ActiveMerchant #:nodoc:
180
180
  add_invoice(xml, money, options)
181
181
  add_account(xml, options)
182
182
  xml.transNum authorization
183
- xml.transType "07"
183
+ xml.transType '07'
184
184
  end
185
185
 
186
186
  commit(request)
@@ -195,7 +195,7 @@ module ActiveMerchant #:nodoc:
195
195
  add_invoice(xml, money, options)
196
196
  add_payment(xml, payment, options)
197
197
  add_account(xml, options)
198
- xml.transType "35"
198
+ xml.transType '35'
199
199
  end
200
200
 
201
201
  commit(request)
@@ -255,7 +255,7 @@ module ActiveMerchant #:nodoc:
255
255
  def parse(body)
256
256
  results = {}
257
257
  xml = Nokogiri::XML(body)
258
- resp = xml.xpath("//XMLResponse/XMLTrans")
258
+ resp = xml.xpath('//XMLResponse/XMLTrans')
259
259
  resp.children.each do |element|
260
260
  results[element.name.underscore.downcase.to_sym] = element.text
261
261
  end
@@ -279,11 +279,11 @@ module ActiveMerchant #:nodoc:
279
279
  end
280
280
 
281
281
  def success_from(response)
282
- response[:status] == "00"
282
+ response[:status] == '00'
283
283
  end
284
284
 
285
285
  def message_from(response)
286
- return "Success" if success_from(response)
286
+ return 'Success' if success_from(response)
287
287
  message = STATUS_RESPONSE_CODES[response[:status]]
288
288
  message += " - #{TRANSACTION_RESPONSE_CODES[response[:response_code]]}" if response[:response_code]
289
289
 
@@ -304,7 +304,7 @@ module ActiveMerchant #:nodoc:
304
304
  builder = Nokogiri::XML::Builder.new do |xml|
305
305
  xml.XMLRequest do
306
306
  xml.certStr @options[:cert_str]
307
- xml.class_ "partner"
307
+ xml.class_ 'partner'
308
308
  xml.XMLTrans do
309
309
  yield(xml)
310
310
  end
@@ -319,7 +319,7 @@ module ActiveMerchant #:nodoc:
319
319
  camel_cased_word.to_s.gsub(/::/, '/').
320
320
  gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
321
321
  gsub(/([a-z\d])([A-Z])/,'\1_\2').
322
- tr("-", "_").
322
+ tr('-', '_').
323
323
  downcase
324
324
  end
325
325
  end