activemerchant 1.79.2 → 1.129.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (279) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG +1391 -0
  3. data/README.md +29 -14
  4. data/lib/active_merchant/billing/avs_result.rb +25 -28
  5. data/lib/active_merchant/billing/base.rb +0 -13
  6. data/lib/active_merchant/billing/check.rb +55 -22
  7. data/lib/active_merchant/billing/compatibility.rb +10 -12
  8. data/lib/active_merchant/billing/credit_card.rb +82 -62
  9. data/lib/active_merchant/billing/credit_card_formatting.rb +4 -4
  10. data/lib/active_merchant/billing/credit_card_methods.rb +328 -58
  11. data/lib/active_merchant/billing/cvv_result.rb +0 -1
  12. data/lib/active_merchant/billing/gateway.rb +61 -56
  13. data/lib/active_merchant/billing/gateways/adyen.rb +562 -87
  14. data/lib/active_merchant/billing/gateways/airwallex.rb +370 -0
  15. data/lib/active_merchant/billing/gateways/alelo.rb +256 -0
  16. data/lib/active_merchant/billing/gateways/allied_wallet.rb +35 -36
  17. data/lib/active_merchant/billing/gateways/authorize_net.rb +297 -196
  18. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +31 -24
  19. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +94 -98
  20. data/lib/active_merchant/billing/gateways/axcessms.rb +64 -66
  21. data/lib/active_merchant/billing/gateways/balanced.rb +72 -65
  22. data/lib/active_merchant/billing/gateways/bambora_apac.rb +222 -0
  23. data/lib/active_merchant/billing/gateways/bank_frick.rb +16 -16
  24. data/lib/active_merchant/billing/gateways/banwire.rb +12 -12
  25. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +140 -69
  26. data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +7 -7
  27. data/lib/active_merchant/billing/gateways/be2bill.rb +7 -7
  28. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +115 -115
  29. data/lib/active_merchant/billing/gateways/beanstream.rb +39 -13
  30. data/lib/active_merchant/billing/gateways/beanstream_interac.rb +1 -2
  31. data/lib/active_merchant/billing/gateways/blue_pay.rb +87 -58
  32. data/lib/active_merchant/billing/gateways/blue_snap.rb +405 -104
  33. data/lib/active_merchant/billing/gateways/bogus.rb +34 -30
  34. data/lib/active_merchant/billing/gateways/borgun.rb +97 -47
  35. data/lib/active_merchant/billing/gateways/bpoint.rb +20 -20
  36. data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +9 -3
  37. data/lib/active_merchant/billing/gateways/braintree/token_nonce.rb +113 -0
  38. data/lib/active_merchant/billing/gateways/braintree.rb +1 -1
  39. data/lib/active_merchant/billing/gateways/braintree_blue.rb +561 -259
  40. data/lib/active_merchant/billing/gateways/braintree_orange.rb +1 -1
  41. data/lib/active_merchant/billing/gateways/bridge_pay.rb +53 -54
  42. data/lib/active_merchant/billing/gateways/cams.rb +31 -31
  43. data/lib/active_merchant/billing/gateways/card_connect.rb +85 -33
  44. data/lib/active_merchant/billing/gateways/card_save.rb +7 -9
  45. data/lib/active_merchant/billing/gateways/card_stream.rb +187 -169
  46. data/lib/active_merchant/billing/gateways/cardknox.rb +24 -25
  47. data/lib/active_merchant/billing/gateways/cardprocess.rb +9 -7
  48. data/lib/active_merchant/billing/gateways/cashnet.rb +43 -27
  49. data/lib/active_merchant/billing/gateways/cc5.rb +14 -17
  50. data/lib/active_merchant/billing/gateways/cecabank.rb +62 -52
  51. data/lib/active_merchant/billing/gateways/cenpos.rb +63 -62
  52. data/lib/active_merchant/billing/gateways/checkout.rb +21 -23
  53. data/lib/active_merchant/billing/gateways/checkout_v2.rb +391 -113
  54. data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -3
  55. data/lib/active_merchant/billing/gateways/clearhaus.rb +40 -41
  56. data/lib/active_merchant/billing/gateways/commerce_hub.rb +361 -0
  57. data/lib/active_merchant/billing/gateways/commercegate.rb +11 -12
  58. data/lib/active_merchant/billing/gateways/conekta.rb +35 -30
  59. data/lib/active_merchant/billing/gateways/creditcall.rb +59 -59
  60. data/lib/active_merchant/billing/gateways/credorax.rb +326 -145
  61. data/lib/active_merchant/billing/gateways/ct_payment.rb +269 -0
  62. data/lib/active_merchant/billing/gateways/culqi.rb +53 -53
  63. data/lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb +36 -0
  64. data/lib/active_merchant/billing/gateways/cyber_source.rb +566 -208
  65. data/lib/active_merchant/billing/gateways/cyber_source_rest.rb +456 -0
  66. data/lib/active_merchant/billing/gateways/d_local.rb +342 -0
  67. data/lib/active_merchant/billing/gateways/data_cash.rb +40 -56
  68. data/lib/active_merchant/billing/gateways/decidir.rb +358 -0
  69. data/lib/active_merchant/billing/gateways/decidir_plus.rb +344 -0
  70. data/lib/active_merchant/billing/gateways/dibs.rb +34 -40
  71. data/lib/active_merchant/billing/gateways/digitzs.rb +48 -45
  72. data/lib/active_merchant/billing/gateways/ebanx.rb +110 -60
  73. data/lib/active_merchant/billing/gateways/efsnet.rb +46 -50
  74. data/lib/active_merchant/billing/gateways/elavon.rb +351 -189
  75. data/lib/active_merchant/billing/gateways/element.rb +106 -56
  76. data/lib/active_merchant/billing/gateways/epay.rb +74 -64
  77. data/lib/active_merchant/billing/gateways/evo_ca.rb +13 -14
  78. data/lib/active_merchant/billing/gateways/eway.rb +74 -73
  79. data/lib/active_merchant/billing/gateways/eway_managed.rb +85 -87
  80. data/lib/active_merchant/billing/gateways/eway_rapid.rb +105 -60
  81. data/lib/active_merchant/billing/gateways/exact.rb +29 -37
  82. data/lib/active_merchant/billing/gateways/ezic.rb +21 -22
  83. data/lib/active_merchant/billing/gateways/fat_zebra.rb +70 -48
  84. data/lib/active_merchant/billing/gateways/federated_canada.rb +11 -13
  85. data/lib/active_merchant/billing/gateways/finansbank.rb +3 -4
  86. data/lib/active_merchant/billing/gateways/first_giving.rb +23 -23
  87. data/lib/active_merchant/billing/gateways/first_pay.rb +33 -13
  88. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +106 -105
  89. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +505 -0
  90. data/lib/active_merchant/billing/gateways/flo2cash.rb +36 -36
  91. data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +2 -2
  92. data/lib/active_merchant/billing/gateways/forte.rb +70 -40
  93. data/lib/active_merchant/billing/gateways/garanti.rb +24 -31
  94. data/lib/active_merchant/billing/gateways/global_collect.rb +378 -154
  95. data/lib/active_merchant/billing/gateways/global_transport.rb +12 -13
  96. data/lib/active_merchant/billing/gateways/hdfc.rb +55 -57
  97. data/lib/active_merchant/billing/gateways/hps.rb +236 -69
  98. data/lib/active_merchant/billing/gateways/iats_payments.rb +61 -39
  99. data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
  100. data/lib/active_merchant/billing/gateways/inspire.rb +41 -47
  101. data/lib/active_merchant/billing/gateways/instapay.rb +10 -14
  102. data/lib/active_merchant/billing/gateways/ipg.rb +420 -0
  103. data/lib/active_merchant/billing/gateways/ipp.rb +25 -24
  104. data/lib/active_merchant/billing/gateways/iridium.rb +243 -244
  105. data/lib/active_merchant/billing/gateways/itransact.rb +14 -14
  106. data/lib/active_merchant/billing/gateways/iveri.rb +73 -34
  107. data/lib/active_merchant/billing/gateways/ixopay.rb +320 -0
  108. data/lib/active_merchant/billing/gateways/jetpay.rb +145 -152
  109. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +154 -159
  110. data/lib/active_merchant/billing/gateways/komoju.rb +16 -16
  111. data/lib/active_merchant/billing/gateways/kushki.rb +127 -57
  112. data/lib/active_merchant/billing/gateways/latitude19.rb +111 -115
  113. data/lib/active_merchant/billing/gateways/linkpoint.rb +82 -85
  114. data/lib/active_merchant/billing/gateways/litle.rb +247 -53
  115. data/lib/active_merchant/billing/gateways/mastercard.rb +41 -23
  116. data/lib/active_merchant/billing/gateways/maxipago.rb +5 -5
  117. data/lib/active_merchant/billing/gateways/mercado_pago.rb +135 -49
  118. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +62 -29
  119. data/lib/active_merchant/billing/gateways/merchant_one.rb +16 -20
  120. data/lib/active_merchant/billing/gateways/merchant_partners.rb +40 -40
  121. data/lib/active_merchant/billing/gateways/merchant_ware.rb +54 -60
  122. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +42 -44
  123. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +52 -14
  124. data/lib/active_merchant/billing/gateways/mercury.rb +47 -51
  125. data/lib/active_merchant/billing/gateways/metrics_global.rb +32 -42
  126. data/lib/active_merchant/billing/gateways/micropayment.rb +42 -45
  127. data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +7 -7
  128. data/lib/active_merchant/billing/gateways/migs.rb +45 -40
  129. data/lib/active_merchant/billing/gateways/mit.rb +260 -0
  130. data/lib/active_merchant/billing/gateways/modern_payments.rb +2 -2
  131. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +29 -31
  132. data/lib/active_merchant/billing/gateways/moka.rb +290 -0
  133. data/lib/active_merchant/billing/gateways/monei.rb +255 -138
  134. data/lib/active_merchant/billing/gateways/moneris.rb +226 -88
  135. data/lib/active_merchant/billing/gateways/money_movers.rb +11 -13
  136. data/lib/active_merchant/billing/gateways/mundipagg.rb +117 -43
  137. data/lib/active_merchant/billing/gateways/nab_transact.rb +28 -31
  138. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +13 -15
  139. data/lib/active_merchant/billing/gateways/net_registry.rb +12 -12
  140. data/lib/active_merchant/billing/gateways/netaxept.rb +33 -34
  141. data/lib/active_merchant/billing/gateways/netbanx.rb +167 -80
  142. data/lib/active_merchant/billing/gateways/netbilling.rb +27 -30
  143. data/lib/active_merchant/billing/gateways/netpay.rb +10 -10
  144. data/lib/active_merchant/billing/gateways/network_merchants.rb +7 -11
  145. data/lib/active_merchant/billing/gateways/nmi.rb +134 -48
  146. data/lib/active_merchant/billing/gateways/ogone.rb +88 -58
  147. data/lib/active_merchant/billing/gateways/omise.rb +30 -31
  148. data/lib/active_merchant/billing/gateways/openpay.rb +45 -26
  149. data/lib/active_merchant/billing/gateways/opp.rb +166 -144
  150. data/lib/active_merchant/billing/gateways/optimal_payment.rb +67 -64
  151. data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +5 -7
  152. data/lib/active_merchant/billing/gateways/orbital.rb +726 -382
  153. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +26 -27
  154. data/lib/active_merchant/billing/gateways/pagarme.rb +47 -56
  155. data/lib/active_merchant/billing/gateways/pago_facil.rb +12 -14
  156. data/lib/active_merchant/billing/gateways/pay_arc.rb +392 -0
  157. data/lib/active_merchant/billing/gateways/pay_conex.rb +39 -40
  158. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +65 -65
  159. data/lib/active_merchant/billing/gateways/pay_hub.rb +39 -39
  160. data/lib/active_merchant/billing/gateways/pay_junction.rb +37 -37
  161. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +70 -54
  162. data/lib/active_merchant/billing/gateways/pay_secure.rb +15 -17
  163. data/lib/active_merchant/billing/gateways/pay_trace.rb +450 -0
  164. data/lib/active_merchant/billing/gateways/paybox_direct.rb +71 -47
  165. data/lib/active_merchant/billing/gateways/payeezy.rb +159 -32
  166. data/lib/active_merchant/billing/gateways/payex.rb +39 -42
  167. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +41 -36
  168. data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +11 -8
  169. data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +3 -3
  170. data/lib/active_merchant/billing/gateways/payflow.rb +178 -54
  171. data/lib/active_merchant/billing/gateways/payflow_express.rb +61 -65
  172. data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +0 -1
  173. data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -2
  174. data/lib/active_merchant/billing/gateways/payment_express.rb +66 -58
  175. data/lib/active_merchant/billing/gateways/paymentez.rb +114 -25
  176. data/lib/active_merchant/billing/gateways/paymill.rb +134 -133
  177. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +2 -1
  178. data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +4 -0
  179. data/lib/active_merchant/billing/gateways/paypal.rb +27 -14
  180. data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
  181. data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +2 -2
  182. data/lib/active_merchant/billing/gateways/paypal_express.rb +5 -2
  183. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
  184. data/lib/active_merchant/billing/gateways/paysafe.rb +420 -0
  185. data/lib/active_merchant/billing/gateways/payscout.rb +10 -13
  186. data/lib/active_merchant/billing/gateways/paystation.rb +79 -82
  187. data/lib/active_merchant/billing/gateways/payu_in.rb +59 -58
  188. data/lib/active_merchant/billing/gateways/payu_latam.rb +139 -97
  189. data/lib/active_merchant/billing/gateways/payway.rb +27 -27
  190. data/lib/active_merchant/billing/gateways/payway_dot_com.rb +253 -0
  191. data/lib/active_merchant/billing/gateways/pin.rb +87 -34
  192. data/lib/active_merchant/billing/gateways/plexo.rb +308 -0
  193. data/lib/active_merchant/billing/gateways/plugnpay.rb +82 -82
  194. data/lib/active_merchant/billing/gateways/priority.rb +392 -0
  195. data/lib/active_merchant/billing/gateways/pro_pay.rb +139 -140
  196. data/lib/active_merchant/billing/gateways/psigate.rb +44 -44
  197. data/lib/active_merchant/billing/gateways/psl_card.rb +29 -37
  198. data/lib/active_merchant/billing/gateways/qbms.rb +75 -76
  199. data/lib/active_merchant/billing/gateways/quantum.rb +21 -23
  200. data/lib/active_merchant/billing/gateways/quickbooks.rb +142 -55
  201. data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +103 -107
  202. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +156 -158
  203. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +7 -8
  204. data/lib/active_merchant/billing/gateways/quickpay.rb +1 -3
  205. data/lib/active_merchant/billing/gateways/qvalent.rb +137 -68
  206. data/lib/active_merchant/billing/gateways/rapyd.rb +319 -0
  207. data/lib/active_merchant/billing/gateways/reach.rb +277 -0
  208. data/lib/active_merchant/billing/gateways/realex.rb +132 -50
  209. data/lib/active_merchant/billing/gateways/redsys.rb +382 -186
  210. data/lib/active_merchant/billing/gateways/s5.rb +16 -16
  211. data/lib/active_merchant/billing/gateways/safe_charge.rb +83 -47
  212. data/lib/active_merchant/billing/gateways/sage.rb +49 -48
  213. data/lib/active_merchant/billing/gateways/sage_pay.rb +76 -83
  214. data/lib/active_merchant/billing/gateways/sallie_mae.rb +13 -15
  215. data/lib/active_merchant/billing/gateways/secure_net.rb +32 -40
  216. data/lib/active_merchant/billing/gateways/secure_pay.rb +30 -40
  217. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +23 -26
  218. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +14 -16
  219. data/lib/active_merchant/billing/gateways/securion_pay.rb +69 -31
  220. data/lib/active_merchant/billing/gateways/shift4.rb +342 -0
  221. data/lib/active_merchant/billing/gateways/simetrik.rb +368 -0
  222. data/lib/active_merchant/billing/gateways/skip_jack.rb +52 -53
  223. data/lib/active_merchant/billing/gateways/smart_ps.rb +51 -60
  224. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +29 -29
  225. data/lib/active_merchant/billing/gateways/spreedly_core.rb +66 -47
  226. data/lib/active_merchant/billing/gateways/stripe.rb +309 -148
  227. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +556 -0
  228. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +18 -23
  229. data/lib/active_merchant/billing/gateways/telr.rb +46 -48
  230. data/lib/active_merchant/billing/gateways/tns.rb +8 -7
  231. data/lib/active_merchant/billing/gateways/trans_first.rb +37 -37
  232. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +249 -245
  233. data/lib/active_merchant/billing/gateways/transact_pro.rb +25 -27
  234. data/lib/active_merchant/billing/gateways/transax.rb +6 -8
  235. data/lib/active_merchant/billing/gateways/transnational.rb +1 -2
  236. data/lib/active_merchant/billing/gateways/trexle.rb +22 -18
  237. data/lib/active_merchant/billing/gateways/trust_commerce.rb +161 -88
  238. data/lib/active_merchant/billing/gateways/usa_epay.rb +5 -6
  239. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +231 -238
  240. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +129 -55
  241. data/lib/active_merchant/billing/gateways/vanco.rb +42 -33
  242. data/lib/active_merchant/billing/gateways/verifi.rb +52 -53
  243. data/lib/active_merchant/billing/gateways/viaklix.rb +18 -22
  244. data/lib/active_merchant/billing/gateways/visanet_peru.rb +115 -74
  245. data/lib/active_merchant/billing/gateways/vpos.rb +223 -0
  246. data/lib/active_merchant/billing/gateways/webpay.rb +9 -9
  247. data/lib/active_merchant/billing/gateways/wepay.rb +38 -41
  248. data/lib/active_merchant/billing/gateways/wirecard.rb +36 -37
  249. data/lib/active_merchant/billing/gateways/wompi.rb +197 -0
  250. data/lib/active_merchant/billing/gateways/world_net.rb +39 -38
  251. data/lib/active_merchant/billing/gateways/worldpay.rb +756 -142
  252. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +73 -83
  253. data/lib/active_merchant/billing/gateways/worldpay_us.rb +31 -31
  254. data/lib/active_merchant/billing/model.rb +2 -2
  255. data/lib/active_merchant/billing/network_tokenization_credit_card.rb +3 -3
  256. data/lib/active_merchant/billing/rails.rb +1 -1
  257. data/lib/active_merchant/billing/response.rb +32 -13
  258. data/lib/active_merchant/billing/three_d_secure_eci_mapper.rb +27 -0
  259. data/lib/active_merchant/billing.rb +1 -0
  260. data/lib/active_merchant/connection.rb +24 -38
  261. data/lib/active_merchant/country.rb +9 -5
  262. data/lib/active_merchant/errors.rb +4 -1
  263. data/lib/active_merchant/net_http_ssl_connection.rb +2 -0
  264. data/lib/active_merchant/network_connection_retries.rb +28 -31
  265. data/lib/active_merchant/post_data.rb +5 -3
  266. data/lib/active_merchant/posts_data.rb +5 -7
  267. data/lib/active_merchant/version.rb +1 -1
  268. data/lib/active_merchant.rb +3 -3
  269. data/lib/activemerchant.rb +1 -1
  270. data/lib/certs/cacert.pem +1592 -2329
  271. data/lib/support/gateway_support.rb +8 -10
  272. data/lib/support/ssl_verify.rb +9 -14
  273. data/lib/support/ssl_version.rb +9 -10
  274. metadata +98 -37
  275. data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +0 -246
  276. data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +0 -13
  277. data/lib/active_merchant/billing/gateways/ideal/ideal_response.rb +0 -29
  278. data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +0 -66
  279. data/lib/active_merchant/billing/gateways/moneris_us.rb +0 -309
@@ -6,8 +6,8 @@ module ActiveMerchant #:nodoc:
6
6
 
7
7
  self.money_format = :cents
8
8
  self.default_currency = 'USD'
9
- self.supported_countries = ['US', 'CA']
10
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
9
+ self.supported_countries = %w[US CA]
10
+ self.supported_cardtypes = %i[visa master american_express discover]
11
11
 
12
12
  self.homepage_url = 'http://www.jetpay.com'
13
13
  self.display_name = 'JetPay'
@@ -15,137 +15,137 @@ module ActiveMerchant #:nodoc:
15
15
  API_VERSION = '2.2'
16
16
 
17
17
  ACTION_CODE_MESSAGES = {
18
- "000" => "Approved.",
19
- "001" => "Refer to card issuer.",
20
- "002" => "Refer to card issuer, special condition.",
21
- "003" => "Invalid merchant or service provider.",
22
- "004" => "Pick up card.",
23
- "005" => "Do not honor.",
24
- "006" => "Error.",
25
- "007" => "Pick up card, special condition.",
26
- "008" => "Honor with ID (Show ID).",
27
- "010" => "Partial approval.",
28
- "011" => "VIP approval.",
29
- "012" => "Invalid transaction.",
30
- "013" => "Invalid amount or exceeds maximum for card program.",
31
- "014" => "Invalid account number (no such number).",
32
- "015" => "No such issuer.",
33
- "019" => "Re-enter Transaction.",
34
- "021" => "No action taken (unable to back out prior transaction).",
35
- "025" => "Transaction Not Found.",
36
- "027" => "File update field edit error.",
37
- "028" => "File is temporarily unavailable.",
38
- "030" => "Format error.",
39
- "039" => "No credit account.",
40
- "041" => "Pick up card (lost card).",
41
- "043" => "Pick up card (stolen card).",
42
- "051" => "Insufficient funds.",
43
- "052" => "No checking account.",
44
- "053" => "Mp savomgs accpimt.",
45
- "054" => "Expired Card.",
46
- "055" => "Incorrect PIN.",
47
- "057" => "Transaction not permitted to cardholder.",
48
- "058" => "Transaction not allowed at terminal.",
49
- "061" => "Exceeds withdrawal limit.",
50
- "062" => "Restricted card (eg, Country Exclusion).",
51
- "063" => "Security violation.",
52
- "065" => "Activity count limit exceeded.",
53
- "068" => "Response late.",
54
- "070" => "Contact card issuer.",
55
- "071" => "PIN not changed.",
56
- "075" => "Allowable number of PIN-entry tries exceeded.",
57
- "076" => "Unable to locate previous message (no matching retrieval reference number).",
58
- "077" => "Repeat or reversal data are inconsistent with original message.",
59
- "078" => "Blocked (first use), or non-existent account.",
60
- "079" => "Key exchange validation failed.",
61
- "080" => "Credit issuer unavailable or invalid date.",
62
- "081" => "PIN cryptographic error found.",
63
- "082" => "Negative online CVV results.",
64
- "084" => "Invalid auth life cycle.",
65
- "085" => "No reason to decline - CVV or AVS approved.",
66
- "086" => "Cannot verify PIN.",
67
- "087" => "Cashback not allowed.",
68
- "089" => "Issuer Down.",
69
- "091" => "Issuer Down.",
70
- "092" => "Unable to route transaction.",
71
- "093" => "Transaction cannot be completed - violation of law.",
72
- "094" => "Duplicate transmission.",
73
- "096" => "System error.",
74
- "100" => "Deny.",
75
- "101" => "Expired Card.",
76
- "103" => "Deny - Invalid manual Entry 4DBC.",
77
- "104" => "Deny - New card issued.",
78
- "105" => "Deny - Account Cancelled.",
79
- "106" => "Exceeded PIN Attempts.",
80
- "107" => "Please Call Issuer.",
81
- "109" => "Invalid merchant.",
82
- "110" => "Invalid amount.",
83
- "111" => "Invalid account.",
84
- "115" => "Service not permitted.",
85
- "117" => "Invalid PIN.",
86
- "119" => "Card member not enrolled.",
87
- "122" => "Invalid card (CID) security code.",
88
- "125" => "Invalid effective date.",
89
- "181" => "Format error.",
90
- "182" => "Please wait.",
91
- "183" => "Invalid currency code.",
92
- "187" => "Deny - new card issued.",
93
- "188" => "Deny - Expiration date required.",
94
- "189" => "Deny - Cancelled or Closed Merchant/SE.",
95
- "200" => "Deny - Pick up card.",
96
- "400" => "Reversal accepted.",
97
- "601" => "Reject - EMV Chip Declined Transaction.",
98
- "602" => "Reject - Suspected Fraud.",
99
- "603" => "Reject - Communications Error.",
100
- "604" => "Reject - Insufficient Approval.",
101
- "750" => "Velocity Check Fail.",
102
- "899" => "Misc Decline.",
103
- "900" => "Invalid Message Type.",
104
- "901" => "Invalid Merchant ID.",
105
- "903" => "Debit not supported.",
106
- "904" => "Private label not supported.",
107
- "905" => "Invalid card type.",
108
- "906" => "Unit not active.",
109
- "908" => "Manual card entry invalid.",
110
- "909" => "Invalid track information.",
111
- "911" => "Master merchant not found.",
112
- "912" => "Invalid card format.",
113
- "913" => "Invalid card type.",
114
- "914" => "Invalid card length.",
115
- "917" => "Expired card.",
116
- "919" => "Invalid entry type.",
117
- "920" => "Invalid amount.",
118
- "921" => "Invalid messge format.",
119
- "923" => "Invalid ABA.",
120
- "924" => "Invalid DDA.",
121
- "925" => "Invalid TID.",
122
- "926" => "Invalid Password.",
123
- "930" => "Invalid zipcode.",
124
- "931" => "Invalid Address.",
125
- "932" => "Invalid ZIP and Address.",
126
- "933" => "Invalid CVV2.",
127
- "934" => "Program Not Allowed.",
128
- "935" => "Invalid Device/App.",
129
- "940" => "Record Not Found.",
130
- "941" => "Merchant ID error.",
131
- "942" => "Refund Not Allowed.",
132
- "943" => "Refund denied.",
133
- "955" => "Invalid PIN block.",
134
- "956" => "Invalid KSN.",
135
- "958" => "Bad Status.",
136
- "959" => "Seek Record limit exceeded.",
137
- "960" => "Internal Key Database Error.",
138
- "961" => "TRANS not Supported. Cash Disbursement required a specific MCC.",
139
- "962" => "Invalid PIN key (Unknown KSN).",
140
- "981" => "Invalid AVS.",
141
- "987" => "Issuer Unavailable.",
142
- "988" => "System error SD.",
143
- "989" => "Database Error.",
144
- "992" => "Transaction Timeout.",
145
- "996" => "Bad Terminal ID.",
146
- "997" => "Message rejected by association.",
147
- "999" => "Communication failure",
148
- nil => "No response returned (missing credentials?)."
18
+ '000' => 'Approved.',
19
+ '001' => 'Refer to card issuer.',
20
+ '002' => 'Refer to card issuer, special condition.',
21
+ '003' => 'Invalid merchant or service provider.',
22
+ '004' => 'Pick up card.',
23
+ '005' => 'Do not honor.',
24
+ '006' => 'Error.',
25
+ '007' => 'Pick up card, special condition.',
26
+ '008' => 'Honor with ID (Show ID).',
27
+ '010' => 'Partial approval.',
28
+ '011' => 'VIP approval.',
29
+ '012' => 'Invalid transaction.',
30
+ '013' => 'Invalid amount or exceeds maximum for card program.',
31
+ '014' => 'Invalid account number (no such number).',
32
+ '015' => 'No such issuer.',
33
+ '019' => 'Re-enter Transaction.',
34
+ '021' => 'No action taken (unable to back out prior transaction).',
35
+ '025' => 'Transaction Not Found.',
36
+ '027' => 'File update field edit error.',
37
+ '028' => 'File is temporarily unavailable.',
38
+ '030' => 'Format error.',
39
+ '039' => 'No credit account.',
40
+ '041' => 'Pick up card (lost card).',
41
+ '043' => 'Pick up card (stolen card).',
42
+ '051' => 'Insufficient funds.',
43
+ '052' => 'No checking account.',
44
+ '053' => 'No savings account.',
45
+ '054' => 'Expired Card.',
46
+ '055' => 'Incorrect PIN.',
47
+ '057' => 'Transaction not permitted to cardholder.',
48
+ '058' => 'Transaction not allowed at terminal.',
49
+ '061' => 'Exceeds withdrawal limit.',
50
+ '062' => 'Restricted card (eg, Country Exclusion).',
51
+ '063' => 'Security violation.',
52
+ '065' => 'Activity count limit exceeded.',
53
+ '068' => 'Response late.',
54
+ '070' => 'Contact card issuer.',
55
+ '071' => 'PIN not changed.',
56
+ '075' => 'Allowable number of PIN-entry tries exceeded.',
57
+ '076' => 'Unable to locate previous message (no matching retrieval reference number).',
58
+ '077' => 'Repeat or reversal data are inconsistent with original message.',
59
+ '078' => 'Blocked (first use), or non-existent account.',
60
+ '079' => 'Key exchange validation failed.',
61
+ '080' => 'Credit issuer unavailable or invalid date.',
62
+ '081' => 'PIN cryptographic error found.',
63
+ '082' => 'Negative online CVV results.',
64
+ '084' => 'Invalid auth life cycle.',
65
+ '085' => 'No reason to decline - CVV or AVS approved.',
66
+ '086' => 'Cannot verify PIN.',
67
+ '087' => 'Cashback not allowed.',
68
+ '089' => 'Issuer Down.',
69
+ '091' => 'Issuer Down.',
70
+ '092' => 'Unable to route transaction.',
71
+ '093' => 'Transaction cannot be completed - violation of law.',
72
+ '094' => 'Duplicate transmission.',
73
+ '096' => 'System error.',
74
+ '100' => 'Deny.',
75
+ '101' => 'Expired Card.',
76
+ '103' => 'Deny - Invalid manual Entry 4DBC.',
77
+ '104' => 'Deny - New card issued.',
78
+ '105' => 'Deny - Account Cancelled.',
79
+ '106' => 'Exceeded PIN Attempts.',
80
+ '107' => 'Please Call Issuer.',
81
+ '109' => 'Invalid merchant.',
82
+ '110' => 'Invalid amount.',
83
+ '111' => 'Invalid account.',
84
+ '115' => 'Service not permitted.',
85
+ '117' => 'Invalid PIN.',
86
+ '119' => 'Card member not enrolled.',
87
+ '122' => 'Invalid card (CID) security code.',
88
+ '125' => 'Invalid effective date.',
89
+ '181' => 'Format error.',
90
+ '182' => 'Please wait.',
91
+ '183' => 'Invalid currency code.',
92
+ '187' => 'Deny - new card issued.',
93
+ '188' => 'Deny - Expiration date required.',
94
+ '189' => 'Deny - Cancelled or Closed Merchant/SE.',
95
+ '200' => 'Deny - Pick up card.',
96
+ '400' => 'Reversal accepted.',
97
+ '601' => 'Reject - EMV Chip Declined Transaction.',
98
+ '602' => 'Reject - Suspected Fraud.',
99
+ '603' => 'Reject - Communications Error.',
100
+ '604' => 'Reject - Insufficient Approval.',
101
+ '750' => 'Velocity Check Fail.',
102
+ '899' => 'Misc Decline.',
103
+ '900' => 'Invalid Message Type.',
104
+ '901' => 'Invalid Merchant ID.',
105
+ '903' => 'Debit not supported.',
106
+ '904' => 'Private label not supported.',
107
+ '905' => 'Invalid card type.',
108
+ '906' => 'Unit not active.',
109
+ '908' => 'Manual card entry invalid.',
110
+ '909' => 'Invalid track information.',
111
+ '911' => 'Master merchant not found.',
112
+ '912' => 'Invalid card format.',
113
+ '913' => 'Invalid card type.',
114
+ '914' => 'Invalid card length.',
115
+ '917' => 'Expired card.',
116
+ '919' => 'Invalid entry type.',
117
+ '920' => 'Invalid amount.',
118
+ '921' => 'Invalid messge format.',
119
+ '923' => 'Invalid ABA.',
120
+ '924' => 'Invalid DDA.',
121
+ '925' => 'Invalid TID.',
122
+ '926' => 'Invalid Password.',
123
+ '930' => 'Invalid zipcode.',
124
+ '931' => 'Invalid Address.',
125
+ '932' => 'Invalid ZIP and Address.',
126
+ '933' => 'Invalid CVV2.',
127
+ '934' => 'Program Not Allowed.',
128
+ '935' => 'Invalid Device/App.',
129
+ '940' => 'Record Not Found.',
130
+ '941' => 'Merchant ID error.',
131
+ '942' => 'Refund Not Allowed.',
132
+ '943' => 'Refund denied.',
133
+ '955' => 'Invalid PIN block.',
134
+ '956' => 'Invalid KSN.',
135
+ '958' => 'Bad Status.',
136
+ '959' => 'Seek Record limit exceeded.',
137
+ '960' => 'Internal Key Database Error.',
138
+ '961' => 'TRANS not Supported. Cash Disbursement required a specific MCC.',
139
+ '962' => 'Invalid PIN key (Unknown KSN).',
140
+ '981' => 'Invalid AVS.',
141
+ '987' => 'Issuer Unavailable.',
142
+ '988' => 'System error SD.',
143
+ '989' => 'Database Error.',
144
+ '992' => 'Transaction Timeout.',
145
+ '996' => 'Bad Terminal ID.',
146
+ '997' => 'Message rejected by association.',
147
+ '999' => 'Communication failure',
148
+ nil => 'No response returned (missing credentials?).'
149
149
  }
150
150
 
151
151
  def initialize(options = {})
@@ -162,12 +162,12 @@ module ActiveMerchant #:nodoc:
162
162
  end
163
163
 
164
164
  def capture(money, reference, options = {})
165
- transaction_id, _, _, token = reference.split(";")
165
+ transaction_id, _, _, token = reference.split(';')
166
166
  commit(money, build_capture_request(money, transaction_id, options), token)
167
167
  end
168
168
 
169
169
  def void(reference, options = {})
170
- transaction_id, _, amount, token = reference.split(";")
170
+ transaction_id, _, amount, token = reference.split(';')
171
171
  commit(amount.to_i, build_void_request(amount.to_i, transaction_id, options), token)
172
172
  end
173
173
 
@@ -176,7 +176,7 @@ module ActiveMerchant #:nodoc:
176
176
  end
177
177
 
178
178
  def refund(money, reference, options = {})
179
- transaction_id, _, _, token = reference.split(";")
179
+ transaction_id, _, _, token = reference.split(';')
180
180
  commit(money, build_credit_request(money, transaction_id, token, options), token)
181
181
  end
182
182
 
@@ -210,8 +210,8 @@ module ActiveMerchant #:nodoc:
210
210
  xml.tag! 'TransactionID', transaction_id.nil? ? generate_unique_id.slice(0, 18) : transaction_id
211
211
  xml.tag! 'Origin', options[:origin] || 'INTERNET'
212
212
  xml.tag! 'IndustryInfo', 'Type' => options[:industry_info] || 'ECOMMERCE'
213
- xml.tag! 'Application', (options[:application] || 'n/a'), {'Version' => options[:application_version] || '1.0'}
214
- xml.tag! 'Device', (options[:device] || 'n/a'), {'Version' => options[:device_version] || '1.0'}
213
+ xml.tag! 'Application', (options[:application] || 'n/a'), { 'Version' => options[:application_version] || '1.0' }
214
+ xml.tag! 'Device', (options[:device] || 'n/a'), { 'Version' => options[:device_version] || '1.0' }
215
215
  xml.tag! 'Library', 'VirtPOS SDK', 'Version' => '1.5'
216
216
  xml.tag! 'Gateway', 'JetPay'
217
217
  xml.tag! 'DeveloperID', options[:developer_id] || 'n/a'
@@ -298,12 +298,11 @@ module ActiveMerchant #:nodoc:
298
298
  Response.new(success,
299
299
  success ? 'APPROVED' : message_from(response),
300
300
  response,
301
- :test => test?,
302
- :authorization => authorization_from(response, money, token),
303
- :avs_result => AVSResult.new(:code => response[:avs]),
304
- :cvv_result => CVVResult.new(response[:cvv2]),
305
- :error_code => success ? nil : error_code_from(response)
306
- )
301
+ test: test?,
302
+ authorization: authorization_from(response, money, token),
303
+ avs_result: AVSResult.new(code: response[:avs]),
304
+ cvv_result: CVVResult.new(response[:cvv2]),
305
+ error_code: success ? nil : error_code_from(response))
307
306
  end
308
307
 
309
308
  def url
@@ -324,7 +323,7 @@ module ActiveMerchant #:nodoc:
324
323
 
325
324
  def parse_element(response, node)
326
325
  if node.has_elements?
327
- node.elements.each{|element| parse_element(response, element) }
326
+ node.elements.each { |element| parse_element(response, element) }
328
327
  else
329
328
  response[node.name.underscore.to_sym] = node.text
330
329
  end
@@ -335,7 +334,7 @@ module ActiveMerchant #:nodoc:
335
334
  end
336
335
 
337
336
  def success?(response)
338
- response[:action_code] == "000"
337
+ response[:action_code] == '000'
339
338
  end
340
339
 
341
340
  def message_from(response)
@@ -344,7 +343,7 @@ module ActiveMerchant #:nodoc:
344
343
 
345
344
  def authorization_from(response, money, previous_token)
346
345
  original_amount = amount(money) if money
347
- [ response[:transaction_id], response[:approval], original_amount, (response[:token] || previous_token)].join(";")
346
+ [response[:transaction_id], response[:approval], original_amount, (response[:token] || previous_token)].join(';')
348
347
  end
349
348
 
350
349
  def error_code_from(response)
@@ -356,7 +355,7 @@ module ActiveMerchant #:nodoc:
356
355
 
357
356
  if payment.is_a? String
358
357
  token = payment
359
- _, _, _, token = payment.split(";") if payment.include? ";"
358
+ _, _, _, token = payment.split(';') if payment.include? ';'
360
359
  xml.tag! 'Token', token if token
361
360
  else
362
361
  add_credit_card(xml, payment)
@@ -364,23 +363,19 @@ module ActiveMerchant #:nodoc:
364
363
  end
365
364
 
366
365
  def add_credit_card(xml, credit_card)
367
- xml.tag! 'CardNum', credit_card.number, "CardPresent" => false, "Tokenize" => true
366
+ xml.tag! 'CardNum', credit_card.number, 'CardPresent' => false, 'Tokenize' => true
368
367
  xml.tag! 'CardExpMonth', format_exp(credit_card.month)
369
368
  xml.tag! 'CardExpYear', format_exp(credit_card.year)
370
369
 
371
- if credit_card.first_name || credit_card.last_name
372
- xml.tag! 'CardName', [credit_card.first_name,credit_card.last_name].compact.join(' ')
373
- end
370
+ xml.tag! 'CardName', [credit_card.first_name, credit_card.last_name].compact.join(' ') if credit_card.first_name || credit_card.last_name
374
371
 
375
- unless credit_card.verification_value.nil? || (credit_card.verification_value.length == 0)
376
- xml.tag! 'CVV2', credit_card.verification_value
377
- end
372
+ xml.tag! 'CVV2', credit_card.verification_value unless credit_card.verification_value.nil? || (credit_card.verification_value.length == 0)
378
373
  end
379
374
 
380
375
  def add_addresses(xml, options)
381
376
  if billing_address = options[:billing_address] || options[:address]
382
377
  xml.tag! 'Billing' do
383
- xml.tag! 'Address', [billing_address[:address1], billing_address[:address2]].compact.join(" ")
378
+ xml.tag! 'Address', [billing_address[:address1], billing_address[:address2]].compact.join(' ')
384
379
  xml.tag! 'City', billing_address[:city]
385
380
  xml.tag! 'StateProv', billing_address[:state]
386
381
  xml.tag! 'PostalCode', billing_address[:zip]
@@ -393,7 +388,7 @@ module ActiveMerchant #:nodoc:
393
388
  if shipping_address = options[:shipping_address]
394
389
  xml.tag! 'Shipping' do
395
390
  xml.tag! 'Name', shipping_address[:name]
396
- xml.tag! 'Address', [shipping_address[:address1], shipping_address[:address2]].compact.join(" ")
391
+ xml.tag! 'Address', [shipping_address[:address1], shipping_address[:address2]].compact.join(' ')
397
392
  xml.tag! 'City', shipping_address[:city]
398
393
  xml.tag! 'StateProv', shipping_address[:state]
399
394
  xml.tag! 'PostalCode', shipping_address[:zip]
@@ -410,7 +405,7 @@ module ActiveMerchant #:nodoc:
410
405
  def add_invoice_data(xml, options)
411
406
  xml.tag! 'OrderNumber', options[:order_id] if options[:order_id]
412
407
  if tax_amount = options[:tax_amount]
413
- xml.tag! 'TaxAmount', tax_amount, {'ExemptInd' => options[:tax_exempt] || "false"}
408
+ xml.tag! 'TaxAmount', tax_amount, { 'ExemptInd' => options[:tax_exempt] || 'false' }
414
409
  end
415
410
  end
416
411
 
@@ -430,7 +425,7 @@ module ActiveMerchant #:nodoc:
430
425
 
431
426
  def lookup_country_code(code)
432
427
  country = Country.find(code) rescue nil
433
- country && country.code(:alpha3)
428
+ country&.code(:alpha3)
434
429
  end
435
430
  end
436
431
  end
@@ -3,20 +3,20 @@ require 'json'
3
3
  module ActiveMerchant #:nodoc:
4
4
  module Billing #:nodoc:
5
5
  class KomojuGateway < Gateway
6
- self.test_url = "https://sandbox.komoju.com/api/v1"
7
- self.live_url = "https://komoju.com/api/v1"
6
+ self.test_url = 'https://komoju.com/api/v1'
7
+ self.live_url = 'https://komoju.com/api/v1'
8
8
  self.supported_countries = ['JP']
9
9
  self.default_currency = 'JPY'
10
10
  self.money_format = :cents
11
11
  self.homepage_url = 'https://www.komoju.com/'
12
12
  self.display_name = 'Komoju'
13
- self.supported_cardtypes = [:visa, :master, :american_express, :jcb]
13
+ self.supported_cardtypes = %i[visa master american_express jcb]
14
14
 
15
15
  STANDARD_ERROR_CODE_MAPPING = {
16
- "bad_verification_value" => "incorrect_cvc",
17
- "card_expired" => "expired_card",
18
- "card_declined" => "card_declined",
19
- "invalid_number" => "invalid_number"
16
+ 'bad_verification_value' => 'incorrect_cvc',
17
+ 'card_expired' => 'expired_card',
18
+ 'card_declined' => 'card_declined',
19
+ 'invalid_number' => 'invalid_number'
20
20
  }
21
21
 
22
22
  def initialize(options = {})
@@ -34,7 +34,7 @@ module ActiveMerchant #:nodoc:
34
34
  post[:tax] = options[:tax] if options[:tax]
35
35
  add_fraud_details(post, options)
36
36
 
37
- commit("/payments", post)
37
+ commit('/payments', post)
38
38
  end
39
39
 
40
40
  def refund(money, identification, options = {})
@@ -82,15 +82,15 @@ module ActiveMerchant #:nodoc:
82
82
 
83
83
  def commit(path, params)
84
84
  response = api_request(path, params.to_json)
85
- success = !response.key?("error")
86
- message = (success ? "Transaction succeeded" : response["error"]["message"])
85
+ success = !response.key?('error')
86
+ message = (success ? 'Transaction succeeded' : response['error']['message'])
87
87
  Response.new(
88
88
  success,
89
89
  message,
90
90
  response,
91
91
  test: test?,
92
- error_code: (success ? nil : error_code(response["error"]["code"])),
93
- authorization: (success ? response["id"] : nil)
92
+ error_code: (success ? nil : error_code(response['error']['code'])),
93
+ authorization: (success ? response['id'] : nil)
94
94
  )
95
95
  end
96
96
 
@@ -104,10 +104,10 @@ module ActiveMerchant #:nodoc:
104
104
 
105
105
  def headers
106
106
  {
107
- "Authorization" => "Basic " + Base64.encode64(@options[:login].to_s + ":").strip,
108
- "Accept" => "application/json",
109
- "Content-Type" => "application/json",
110
- "User-Agent" => "Komoju/v1 ActiveMerchantBindings/#{ActiveMerchant::VERSION}"
107
+ 'Authorization' => 'Basic ' + Base64.encode64(@options[:login].to_s + ':').strip,
108
+ 'Accept' => 'application/json',
109
+ 'Content-Type' => 'application/json',
110
+ 'User-Agent' => "Komoju/v1 ActiveMerchantBindings/#{ActiveMerchant::VERSION}"
111
111
  }
112
112
  end
113
113
  end