activemerchant 1.107.3 → 1.111.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (206) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +75 -0
  3. data/README.md +3 -3
  4. data/lib/active_merchant/billing/base.rb +0 -13
  5. data/lib/active_merchant/billing/check.rb +1 -1
  6. data/lib/active_merchant/billing/credit_card.rb +2 -0
  7. data/lib/active_merchant/billing/credit_card_methods.rb +9 -6
  8. data/lib/active_merchant/billing/gateways/adyen.rb +18 -12
  9. data/lib/active_merchant/billing/gateways/allied_wallet.rb +2 -2
  10. data/lib/active_merchant/billing/gateways/authorize_net.rb +8 -8
  11. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -3
  12. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +3 -3
  13. data/lib/active_merchant/billing/gateways/axcessms.rb +1 -1
  14. data/lib/active_merchant/billing/gateways/balanced.rb +1 -1
  15. data/lib/active_merchant/billing/gateways/bambora_apac.rb +2 -2
  16. data/lib/active_merchant/billing/gateways/bank_frick.rb +2 -2
  17. data/lib/active_merchant/billing/gateways/banwire.rb +2 -2
  18. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +2 -2
  19. data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +1 -1
  20. data/lib/active_merchant/billing/gateways/be2bill.rb +1 -1
  21. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +4 -4
  22. data/lib/active_merchant/billing/gateways/blue_pay.rb +4 -4
  23. data/lib/active_merchant/billing/gateways/blue_snap.rb +1 -1
  24. data/lib/active_merchant/billing/gateways/borgun.rb +3 -3
  25. data/lib/active_merchant/billing/gateways/bpoint.rb +1 -1
  26. data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +1 -1
  27. data/lib/active_merchant/billing/gateways/braintree_blue.rb +84 -35
  28. data/lib/active_merchant/billing/gateways/bridge_pay.rb +2 -2
  29. data/lib/active_merchant/billing/gateways/cams.rb +2 -2
  30. data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
  31. data/lib/active_merchant/billing/gateways/card_save.rb +1 -1
  32. data/lib/active_merchant/billing/gateways/card_stream.rb +4 -4
  33. data/lib/active_merchant/billing/gateways/cardknox.rb +4 -4
  34. data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
  35. data/lib/active_merchant/billing/gateways/cashnet.rb +1 -1
  36. data/lib/active_merchant/billing/gateways/cecabank.rb +1 -1
  37. data/lib/active_merchant/billing/gateways/cenpos.rb +12 -12
  38. data/lib/active_merchant/billing/gateways/checkout.rb +3 -3
  39. data/lib/active_merchant/billing/gateways/checkout_v2.rb +2 -2
  40. data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -1
  41. data/lib/active_merchant/billing/gateways/clearhaus.rb +4 -4
  42. data/lib/active_merchant/billing/gateways/commercegate.rb +1 -1
  43. data/lib/active_merchant/billing/gateways/conekta.rb +1 -1
  44. data/lib/active_merchant/billing/gateways/creditcall.rb +1 -1
  45. data/lib/active_merchant/billing/gateways/credorax.rb +7 -3
  46. data/lib/active_merchant/billing/gateways/ct_payment.rb +2 -2
  47. data/lib/active_merchant/billing/gateways/culqi.rb +1 -1
  48. data/lib/active_merchant/billing/gateways/cyber_source.rb +67 -22
  49. data/lib/active_merchant/billing/gateways/d_local.rb +24 -8
  50. data/lib/active_merchant/billing/gateways/data_cash.rb +1 -1
  51. data/lib/active_merchant/billing/gateways/decidir.rb +24 -0
  52. data/lib/active_merchant/billing/gateways/dibs.rb +2 -2
  53. data/lib/active_merchant/billing/gateways/digitzs.rb +2 -2
  54. data/lib/active_merchant/billing/gateways/ebanx.rb +6 -4
  55. data/lib/active_merchant/billing/gateways/efsnet.rb +2 -2
  56. data/lib/active_merchant/billing/gateways/elavon.rb +56 -9
  57. data/lib/active_merchant/billing/gateways/element.rb +16 -8
  58. data/lib/active_merchant/billing/gateways/epay.rb +3 -3
  59. data/lib/active_merchant/billing/gateways/evo_ca.rb +1 -1
  60. data/lib/active_merchant/billing/gateways/eway.rb +1 -1
  61. data/lib/active_merchant/billing/gateways/eway_managed.rb +1 -1
  62. data/lib/active_merchant/billing/gateways/eway_rapid.rb +2 -2
  63. data/lib/active_merchant/billing/gateways/exact.rb +3 -3
  64. data/lib/active_merchant/billing/gateways/ezic.rb +1 -1
  65. data/lib/active_merchant/billing/gateways/fat_zebra.rb +9 -7
  66. data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -1
  67. data/lib/active_merchant/billing/gateways/finansbank.rb +2 -2
  68. data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
  69. data/lib/active_merchant/billing/gateways/first_pay.rb +1 -1
  70. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +5 -5
  71. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +12 -4
  72. data/lib/active_merchant/billing/gateways/flo2cash.rb +10 -10
  73. data/lib/active_merchant/billing/gateways/forte.rb +9 -8
  74. data/lib/active_merchant/billing/gateways/garanti.rb +2 -2
  75. data/lib/active_merchant/billing/gateways/global_collect.rb +10 -5
  76. data/lib/active_merchant/billing/gateways/global_transport.rb +1 -1
  77. data/lib/active_merchant/billing/gateways/hdfc.rb +9 -9
  78. data/lib/active_merchant/billing/gateways/hps.rb +3 -3
  79. data/lib/active_merchant/billing/gateways/iats_payments.rb +2 -2
  80. data/lib/active_merchant/billing/gateways/inspire.rb +1 -1
  81. data/lib/active_merchant/billing/gateways/instapay.rb +1 -1
  82. data/lib/active_merchant/billing/gateways/ipp.rb +1 -1
  83. data/lib/active_merchant/billing/gateways/iridium.rb +3 -3
  84. data/lib/active_merchant/billing/gateways/itransact.rb +1 -1
  85. data/lib/active_merchant/billing/gateways/iveri.rb +2 -2
  86. data/lib/active_merchant/billing/gateways/ixopay.rb +1 -1
  87. data/lib/active_merchant/billing/gateways/jetpay.rb +2 -2
  88. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +2 -2
  89. data/lib/active_merchant/billing/gateways/komoju.rb +1 -1
  90. data/lib/active_merchant/billing/gateways/kushki.rb +4 -4
  91. data/lib/active_merchant/billing/gateways/latitude19.rb +2 -2
  92. data/lib/active_merchant/billing/gateways/linkpoint.rb +2 -2
  93. data/lib/active_merchant/billing/gateways/litle.rb +10 -5
  94. data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
  95. data/lib/active_merchant/billing/gateways/mercado_pago.rb +12 -6
  96. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +1 -1
  97. data/lib/active_merchant/billing/gateways/merchant_one.rb +2 -2
  98. data/lib/active_merchant/billing/gateways/merchant_partners.rb +1 -1
  99. data/lib/active_merchant/billing/gateways/merchant_ware.rb +1 -1
  100. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +1 -1
  101. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +2 -2
  102. data/lib/active_merchant/billing/gateways/mercury.rb +4 -4
  103. data/lib/active_merchant/billing/gateways/metrics_global.rb +1 -1
  104. data/lib/active_merchant/billing/gateways/micropayment.rb +2 -2
  105. data/lib/active_merchant/billing/gateways/migs.rb +1 -1
  106. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +1 -1
  107. data/lib/active_merchant/billing/gateways/monei.rb +2 -2
  108. data/lib/active_merchant/billing/gateways/moneris.rb +17 -17
  109. data/lib/active_merchant/billing/gateways/money_movers.rb +1 -1
  110. data/lib/active_merchant/billing/gateways/mundipagg.rb +1 -1
  111. data/lib/active_merchant/billing/gateways/nab_transact.rb +2 -2
  112. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +1 -1
  113. data/lib/active_merchant/billing/gateways/net_registry.rb +2 -2
  114. data/lib/active_merchant/billing/gateways/netaxept.rb +3 -3
  115. data/lib/active_merchant/billing/gateways/netbanx.rb +51 -23
  116. data/lib/active_merchant/billing/gateways/netbilling.rb +2 -2
  117. data/lib/active_merchant/billing/gateways/netpay.rb +2 -2
  118. data/lib/active_merchant/billing/gateways/network_merchants.rb +1 -1
  119. data/lib/active_merchant/billing/gateways/nmi.rb +4 -4
  120. data/lib/active_merchant/billing/gateways/ogone.rb +2 -2
  121. data/lib/active_merchant/billing/gateways/omise.rb +1 -1
  122. data/lib/active_merchant/billing/gateways/openpay.rb +1 -1
  123. data/lib/active_merchant/billing/gateways/opp.rb +2 -2
  124. data/lib/active_merchant/billing/gateways/optimal_payment.rb +4 -4
  125. data/lib/active_merchant/billing/gateways/orbital.rb +49 -7
  126. data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +1 -1
  127. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +1 -1
  128. data/lib/active_merchant/billing/gateways/pagarme.rb +2 -2
  129. data/lib/active_merchant/billing/gateways/pago_facil.rb +1 -1
  130. data/lib/active_merchant/billing/gateways/pay_conex.rb +1 -1
  131. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +2 -2
  132. data/lib/active_merchant/billing/gateways/pay_hub.rb +1 -1
  133. data/lib/active_merchant/billing/gateways/pay_junction.rb +3 -3
  134. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +2 -2
  135. data/lib/active_merchant/billing/gateways/pay_secure.rb +1 -1
  136. data/lib/active_merchant/billing/gateways/paybox_direct.rb +3 -3
  137. data/lib/active_merchant/billing/gateways/payeezy.rb +2 -2
  138. data/lib/active_merchant/billing/gateways/payex.rb +13 -13
  139. data/lib/active_merchant/billing/gateways/payflow.rb +5 -5
  140. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +2 -2
  141. data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -1
  142. data/lib/active_merchant/billing/gateways/payment_express.rb +1 -1
  143. data/lib/active_merchant/billing/gateways/paymentez.rb +1 -1
  144. data/lib/active_merchant/billing/gateways/paymill.rb +1 -1
  145. data/lib/active_merchant/billing/gateways/paypal.rb +2 -2
  146. data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
  147. data/lib/active_merchant/billing/gateways/payscout.rb +1 -1
  148. data/lib/active_merchant/billing/gateways/paystation.rb +1 -1
  149. data/lib/active_merchant/billing/gateways/payu_in.rb +1 -1
  150. data/lib/active_merchant/billing/gateways/payu_latam.rb +7 -8
  151. data/lib/active_merchant/billing/gateways/payway.rb +1 -1
  152. data/lib/active_merchant/billing/gateways/pin.rb +2 -2
  153. data/lib/active_merchant/billing/gateways/plugnpay.rb +5 -5
  154. data/lib/active_merchant/billing/gateways/pro_pay.rb +2 -2
  155. data/lib/active_merchant/billing/gateways/psigate.rb +1 -1
  156. data/lib/active_merchant/billing/gateways/psl_card.rb +2 -2
  157. data/lib/active_merchant/billing/gateways/qbms.rb +1 -1
  158. data/lib/active_merchant/billing/gateways/quantum.rb +4 -4
  159. data/lib/active_merchant/billing/gateways/quickbooks.rb +6 -6
  160. data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +3 -3
  161. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +4 -4
  162. data/lib/active_merchant/billing/gateways/qvalent.rb +1 -1
  163. data/lib/active_merchant/billing/gateways/realex.rb +5 -3
  164. data/lib/active_merchant/billing/gateways/redsys.rb +5 -5
  165. data/lib/active_merchant/billing/gateways/s5.rb +1 -1
  166. data/lib/active_merchant/billing/gateways/safe_charge.rb +2 -2
  167. data/lib/active_merchant/billing/gateways/sage.rb +3 -3
  168. data/lib/active_merchant/billing/gateways/sage_pay.rb +3 -3
  169. data/lib/active_merchant/billing/gateways/sallie_mae.rb +1 -1
  170. data/lib/active_merchant/billing/gateways/secure_net.rb +1 -1
  171. data/lib/active_merchant/billing/gateways/secure_pay.rb +1 -1
  172. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +2 -2
  173. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +2 -2
  174. data/lib/active_merchant/billing/gateways/securion_pay.rb +1 -1
  175. data/lib/active_merchant/billing/gateways/skip_jack.rb +5 -5
  176. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +7 -7
  177. data/lib/active_merchant/billing/gateways/spreedly_core.rb +1 -1
  178. data/lib/active_merchant/billing/gateways/stripe.rb +13 -8
  179. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +46 -3
  180. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +1 -1
  181. data/lib/active_merchant/billing/gateways/telr.rb +4 -4
  182. data/lib/active_merchant/billing/gateways/tns.rb +1 -1
  183. data/lib/active_merchant/billing/gateways/trans_first.rb +2 -2
  184. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +1 -1
  185. data/lib/active_merchant/billing/gateways/transact_pro.rb +3 -3
  186. data/lib/active_merchant/billing/gateways/transax.rb +1 -1
  187. data/lib/active_merchant/billing/gateways/trexle.rb +2 -2
  188. data/lib/active_merchant/billing/gateways/trust_commerce.rb +5 -5
  189. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +6 -6
  190. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +1 -1
  191. data/lib/active_merchant/billing/gateways/vanco.rb +1 -1
  192. data/lib/active_merchant/billing/gateways/verifi.rb +3 -3
  193. data/lib/active_merchant/billing/gateways/viaklix.rb +1 -1
  194. data/lib/active_merchant/billing/gateways/visanet_peru.rb +3 -3
  195. data/lib/active_merchant/billing/gateways/webpay.rb +1 -1
  196. data/lib/active_merchant/billing/gateways/wepay.rb +2 -2
  197. data/lib/active_merchant/billing/gateways/wirecard.rb +1 -1
  198. data/lib/active_merchant/billing/gateways/world_net.rb +35 -35
  199. data/lib/active_merchant/billing/gateways/worldpay.rb +8 -8
  200. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +1 -1
  201. data/lib/active_merchant/billing/gateways/worldpay_us.rb +1 -1
  202. data/lib/active_merchant/connection.rb +40 -42
  203. data/lib/active_merchant/network_connection_retries.rb +10 -12
  204. data/lib/active_merchant/version.rb +1 -1
  205. data/lib/support/gateway_support.rb +1 -1
  206. metadata +46 -32
@@ -9,7 +9,7 @@ module ActiveMerchant #:nodoc:
9
9
  self.supported_countries = %w(AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW)
10
10
  self.default_currency = 'EUR'
11
11
  self.currencies_with_three_decimal_places = %w(BHD IQD JOD KWD LWD OMR TND)
12
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb, :maestro]
12
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb maestro]
13
13
 
14
14
  self.homepage_url = 'https://www.ixopay.com'
15
15
  self.display_name = 'Ixopay'
@@ -8,10 +8,10 @@ module ActiveMerchant #:nodoc:
8
8
  self.live_ca_url = 'https://gateway17.jetpay.com/canada-bb'
9
9
 
10
10
  # The countries the gateway supports merchants from as 2 digit ISO country codes
11
- self.supported_countries = ['US', 'CA']
11
+ self.supported_countries = %w[US CA]
12
12
 
13
13
  # The card types supported by the payment gateway
14
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
14
+ self.supported_cardtypes = %i[visa master american_express discover]
15
15
 
16
16
  # The homepage URL of the gateway
17
17
  self.homepage_url = 'http://www.jetpay.com/'
@@ -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'
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
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
16
  'bad_verification_value' => 'incorrect_cvc',
@@ -7,10 +7,10 @@ module ActiveMerchant #:nodoc:
7
7
  self.test_url = 'https://api-uat.kushkipagos.com/'
8
8
  self.live_url = 'https://api.kushkipagos.com/'
9
9
 
10
- self.supported_countries = ['CL', 'CO', 'EC', 'MX', 'PE']
10
+ self.supported_countries = %w[CL CO EC MX PE]
11
11
  self.default_currency = 'USD'
12
12
  self.money_format = :dollars
13
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club]
13
+ self.supported_cardtypes = %i[visa master american_express discover diners_club alia]
14
14
 
15
15
  def initialize(options={})
16
16
  requires!(options, :public_merchant_id, :private_merchant_id)
@@ -184,7 +184,7 @@ module ActiveMerchant #:nodoc:
184
184
  end
185
185
 
186
186
  def ssl_invoke(action, params)
187
- if ['void', 'refund'].include?(action)
187
+ if %w[void refund].include?(action)
188
188
  ssl_request(:delete, url(action, params), nil, headers(action))
189
189
  else
190
190
  ssl_post(url(action, params), post_data(params), headers(action))
@@ -206,7 +206,7 @@ module ActiveMerchant #:nodoc:
206
206
  def url(action, params)
207
207
  base_url = test? ? test_url : live_url
208
208
 
209
- if ['void', 'refund'].include?(action)
209
+ if %w[void refund].include?(action)
210
210
  base_url + 'v1/' + ENDPOINT[action] + '/' + params[:ticketNumber].to_s
211
211
  else
212
212
  base_url + 'card/v1/' + ENDPOINT[action]
@@ -7,10 +7,10 @@ module ActiveMerchant #:nodoc:
7
7
  self.live_url = 'https://gateway.l19tech.com/payments/'
8
8
  self.test_url = 'https://gateway-sb.l19tech.com/payments/'
9
9
 
10
- self.supported_countries = ['US', 'CA']
10
+ self.supported_countries = %w[US CA]
11
11
  self.default_currency = 'USD'
12
12
  self.money_format = :dollars
13
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
13
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
14
14
 
15
15
  RESPONSE_CODE_MAPPING = {
16
16
  '100' => 'Approved',
@@ -130,7 +130,7 @@ module ActiveMerchant #:nodoc:
130
130
  self.live_url = 'https://secure.linkpt.net:1129/'
131
131
 
132
132
  self.supported_countries = ['US']
133
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners_club]
133
+ self.supported_cardtypes = %i[visa master american_express discover jcb diners_club]
134
134
  self.homepage_url = 'http://www.linkpoint.com/'
135
135
  self.display_name = 'LinkPoint'
136
136
 
@@ -169,7 +169,7 @@ module ActiveMerchant #:nodoc:
169
169
  def recurring(money, creditcard, options={})
170
170
  ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
171
171
 
172
- requires!(options, [:periodicity, :bimonthly, :monthly, :biweekly, :weekly, :yearly, :daily], :installments, :order_id)
172
+ requires!(options, %i[periodicity bimonthly monthly biweekly weekly yearly daily], :installments, :order_id)
173
173
 
174
174
  options.update(
175
175
  ordertype: 'SALE',
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
10
10
 
11
11
  self.supported_countries = ['US']
12
12
  self.default_currency = 'USD'
13
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
13
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
14
14
 
15
15
  self.homepage_url = 'http://www.vantiv.com/'
16
16
  self.display_name = 'Vantiv eCommerce'
@@ -53,7 +53,7 @@ module ActiveMerchant #:nodoc:
53
53
  end
54
54
 
55
55
  def capture(money, authorization, options={})
56
- transaction_id, _, _ = split_authorization(authorization)
56
+ transaction_id, = split_authorization(authorization)
57
57
 
58
58
  request = build_xml_request do |doc|
59
59
  add_authentication(doc)
@@ -78,7 +78,7 @@ module ActiveMerchant #:nodoc:
78
78
  add_descriptor(doc, options)
79
79
  doc.send(refund_type(payment), transaction_attributes(options)) do
80
80
  if payment.is_a?(String)
81
- transaction_id, _, _ = split_authorization(payment)
81
+ transaction_id, = split_authorization(payment)
82
82
  doc.litleTxnId(transaction_id)
83
83
  doc.amount(money) if money
84
84
  elsif check?(payment)
@@ -192,7 +192,7 @@ module ActiveMerchant #:nodoc:
192
192
  end
193
193
 
194
194
  def refund_type(payment)
195
- _, kind, _ = split_authorization(payment)
195
+ _, kind, = split_authorization(payment)
196
196
  if check?(payment) || kind == 'echeckSales'
197
197
  :echeckCredit
198
198
  else
@@ -263,6 +263,7 @@ module ActiveMerchant #:nodoc:
263
263
  if payment_method.is_a?(String)
264
264
  doc.token do
265
265
  doc.litleToken(payment_method)
266
+ doc.expDate(format_exp_date(options[:basis_expiration_month], options[:basis_expiration_year])) if options[:basis_expiration_month] && options[:basis_expiration_year]
266
267
  end
267
268
  elsif payment_method.respond_to?(:track_data) && payment_method.track_data.present?
268
269
  doc.card do
@@ -416,7 +417,11 @@ module ActiveMerchant #:nodoc:
416
417
  end
417
418
 
418
419
  def exp_date(payment_method)
419
- "#{format(payment_method.month, :two_digits)}#{format(payment_method.year, :two_digits)}"
420
+ format_exp_date(payment_method.month, payment_method.year)
421
+ end
422
+
423
+ def format_exp_date(month, year)
424
+ "#{format(month, :two_digits)}#{format(year, :two_digits)}"
420
425
  end
421
426
 
422
427
  def parse(kind, xml)
@@ -11,7 +11,7 @@ module ActiveMerchant #:nodoc:
11
11
  self.supported_countries = ['BR']
12
12
  self.default_currency = 'BRL'
13
13
  self.money_format = :dollars
14
- self.supported_cardtypes = [:visa, :master, :discover, :american_express, :diners_club]
14
+ self.supported_cardtypes = %i[visa master discover american_express diners_club]
15
15
  self.homepage_url = 'http://www.maxipago.com/'
16
16
  self.display_name = 'maxiPago!'
17
17
 
@@ -212,7 +212,7 @@ module ActiveMerchant #:nodoc:
212
212
  end
213
213
 
214
214
  def add_order_id(xml, authorization)
215
- order_id, _ = split_authorization(authorization)
215
+ order_id, = split_authorization(authorization)
216
216
  xml.orderID order_id
217
217
  end
218
218
  end
@@ -3,8 +3,8 @@ module ActiveMerchant #:nodoc:
3
3
  class MercadoPagoGateway < Gateway
4
4
  self.live_url = self.test_url = 'https://api.mercadopago.com/v1'
5
5
 
6
- self.supported_countries = ['AR', 'BR', 'CL', 'CO', 'MX', 'PE', 'UY']
7
- self.supported_cardtypes = [:visa, :master, :american_express, :elo, :cabal, :naranja]
6
+ self.supported_countries = %w[AR BR CL CO MX PE UY]
7
+ self.supported_cardtypes = %i[visa master american_express elo cabal naranja]
8
8
 
9
9
  self.homepage_url = 'https://www.mercadopago.com/'
10
10
  self.display_name = 'Mercado Pago'
@@ -33,7 +33,7 @@ module ActiveMerchant #:nodoc:
33
33
 
34
34
  def capture(money, authorization, options={})
35
35
  post = {}
36
- authorization, _ = authorization.split('|')
36
+ authorization, = authorization.split('|')
37
37
  post[:capture] = true
38
38
  post[:transaction_amount] = amount(money).to_f
39
39
  commit('capture', "payments/#{authorization}", post)
@@ -47,7 +47,7 @@ module ActiveMerchant #:nodoc:
47
47
  end
48
48
 
49
49
  def void(authorization, options={})
50
- authorization, _ = authorization.split('|')
50
+ authorization, = authorization.split('|')
51
51
  post = { status: 'cancelled' }
52
52
  commit('void', "payments/#{authorization}", post)
53
53
  end
@@ -98,6 +98,7 @@ module ActiveMerchant #:nodoc:
98
98
  add_processing_mode(post, options)
99
99
  add_net_amount(post, options)
100
100
  add_taxes(post, options)
101
+ add_notification_url(post, options)
101
102
  post[:binary_mode] = (options[:binary_mode].nil? ? true : options[:binary_mode])
102
103
  post
103
104
  end
@@ -113,6 +114,7 @@ module ActiveMerchant #:nodoc:
113
114
 
114
115
  post[:processing_mode] = options[:processing_mode]
115
116
  post[:merchant_account_id] = options[:merchant_account_id] if options[:merchant_account_id]
117
+ post[:payment_method_option_id] = options[:payment_method_option_id] if options[:payment_method_option_id]
116
118
  add_merchant_services(post, options)
117
119
  end
118
120
 
@@ -202,6 +204,10 @@ module ActiveMerchant #:nodoc:
202
204
  post[:net_amount] = Float(options[:net_amount]) if options[:net_amount]
203
205
  end
204
206
 
207
+ def add_notification_url(post, options)
208
+ post[:notification_url] = options[:notification_url] if options[:notification_url]
209
+ end
210
+
205
211
  def add_taxes(post, options)
206
212
  return unless (tax_object = options[:taxes])
207
213
 
@@ -250,7 +256,7 @@ module ActiveMerchant #:nodoc:
250
256
  end
251
257
 
252
258
  def commit(action, path, parameters)
253
- if ['capture', 'void'].include?(action)
259
+ if %w[capture void].include?(action)
254
260
  response = parse(ssl_request(:put, url(path), post_data(parameters), headers))
255
261
  else
256
262
  response = parse(ssl_post(url(path), post_data(parameters), headers(parameters)))
@@ -270,7 +276,7 @@ module ActiveMerchant #:nodoc:
270
276
  if action == 'refund'
271
277
  response['status'] != 404 && response['error'].nil?
272
278
  else
273
- ['active', 'approved', 'authorized', 'cancelled', 'in_process'].include?(response['status'])
279
+ %w[active approved authorized cancelled in_process].include?(response['status'])
274
280
  end
275
281
  end
276
282
 
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
10
10
  self.supported_countries = ['US']
11
11
 
12
12
  # The card types supported by the payment gateway
13
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb]
13
+ self.supported_cardtypes = %i[visa master american_express discover jcb]
14
14
 
15
15
  # The homepage URL of the gateway
16
16
  self.homepage_url = 'http://www.merchante-solutions.com/'
@@ -13,7 +13,7 @@ module ActiveMerchant #:nodoc:
13
13
  BASE_URL = 'https://secure.merchantonegateway.com/api/transact.php'
14
14
 
15
15
  self.supported_countries = ['US']
16
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
16
+ self.supported_cardtypes = %i[visa master american_express discover]
17
17
  self.homepage_url = 'http://merchantone.com/'
18
18
  self.display_name = 'Merchant One Gateway'
19
19
  self.money_format = :dollars
@@ -76,7 +76,7 @@ module ActiveMerchant #:nodoc:
76
76
  def add_creditcard(post, creditcard)
77
77
  post['cvv'] = creditcard.verification_value
78
78
  post['ccnumber'] = creditcard.number
79
- post['ccexp'] = "#{sprintf("%02d", creditcard.month)}#{creditcard.year.to_s[-2, 2]}"
79
+ post['ccexp'] = "#{sprintf('%02d', creditcard.month)}#{creditcard.year.to_s[-2, 2]}"
80
80
  end
81
81
 
82
82
  def commit(action, money, parameters={})
@@ -11,7 +11,7 @@ module ActiveMerchant #:nodoc:
11
11
  self.supported_countries = ['US']
12
12
  self.default_currency = 'USD'
13
13
  self.money_format = :dollars
14
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
14
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
15
15
 
16
16
  def initialize(options={})
17
17
  requires!(options, :account_id, :merchant_pin)
@@ -7,7 +7,7 @@ module ActiveMerchant #:nodoc:
7
7
  self.v4_live_url = 'https://ps1.merchantware.net/Merchantware/ws/RetailTransaction/v4/Credit.asmx'
8
8
 
9
9
  self.supported_countries = ['US']
10
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
10
+ self.supported_cardtypes = %i[visa master american_express discover]
11
11
  self.homepage_url = 'http://merchantwarehouse.com/merchantware'
12
12
  self.display_name = 'MerchantWARE'
13
13
 
@@ -5,7 +5,7 @@ module ActiveMerchant #:nodoc:
5
5
  self.test_url = 'https://ps1.merchantware.net/Merchantware/ws/RetailTransaction/v4/Credit.asmx'
6
6
 
7
7
  self.supported_countries = ['US']
8
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
8
+ self.supported_cardtypes = %i[visa master american_express discover]
9
9
  self.homepage_url = 'http://merchantwarehouse.com/merchantware'
10
10
  self.display_name = 'MerchantWARE'
11
11
 
@@ -11,8 +11,8 @@ module ActiveMerchant #:nodoc:
11
11
  POST_LIVE_URL = 'https://api.merchantwarrior.com/post/'
12
12
 
13
13
  self.supported_countries = ['AU']
14
- self.supported_cardtypes = [:visa, :master, :american_express,
15
- :diners_club, :discover, :jcb]
14
+ self.supported_cardtypes = %i[visa master american_express
15
+ diners_club discover jcb]
16
16
  self.homepage_url = 'https://www.merchantwarrior.com/'
17
17
  self.display_name = 'Merchant Warrior'
18
18
 
@@ -18,8 +18,8 @@ module ActiveMerchant #:nodoc:
18
18
 
19
19
  self.homepage_url = 'http://www.mercurypay.com'
20
20
  self.display_name = 'Mercury'
21
- self.supported_countries = ['US', 'CA']
22
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
21
+ self.supported_countries = %w[US CA]
22
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
23
23
  self.default_currency = 'USD'
24
24
 
25
25
  STANDARD_ERROR_CODE_MAPPING = {
@@ -103,7 +103,7 @@ module ActiveMerchant #:nodoc:
103
103
  xml.tag! 'Transaction' do
104
104
  xml.tag! 'TranType', 'Credit'
105
105
  xml.tag! 'TranCode', action
106
- xml.tag! 'PartialAuth', 'Allow' if options[:allow_partial_auth] && ['PreAuth', 'Sale'].include?(action)
106
+ xml.tag! 'PartialAuth', 'Allow' if options[:allow_partial_auth] && %w[PreAuth Sale].include?(action)
107
107
  add_invoice(xml, options[:order_id], nil, options)
108
108
  add_reference(xml, 'RecordNumberRequested')
109
109
  add_customer_data(xml, options)
@@ -294,7 +294,7 @@ module ActiveMerchant #:nodoc:
294
294
  }
295
295
  end
296
296
 
297
- SUCCESS_CODES = ['Approved', 'Success']
297
+ SUCCESS_CODES = %w[Approved Success]
298
298
 
299
299
  def commit(action, request)
300
300
  response = parse(action, ssl_post(endpoint_url, build_soap_request(request), build_header))
@@ -31,7 +31,7 @@ module ActiveMerchant #:nodoc:
31
31
  AVS_RESULT_CODE, TRANSACTION_ID, CARD_CODE_RESPONSE_CODE = 5, 6, 38
32
32
 
33
33
  self.supported_countries = ['US']
34
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
34
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
35
35
  self.homepage_url = 'http://www.metricsglobal.com'
36
36
  self.display_name = 'Metrics Global'
37
37
 
@@ -9,7 +9,7 @@ module ActiveMerchant #:nodoc:
9
9
  self.supported_countries = %w(DE)
10
10
  self.default_currency = 'EUR'
11
11
  self.money_format = :cents
12
- self.supported_cardtypes = [:visa, :master, :american_express]
12
+ self.supported_cardtypes = %i[visa master american_express]
13
13
 
14
14
  def initialize(options={})
15
15
  requires!(options, :access_key)
@@ -175,7 +175,7 @@ module ActiveMerchant #:nodoc:
175
175
 
176
176
  def authorization_from(response, request_params)
177
177
  session_id = response['sessionId'] || request_params[:sessionId]
178
- "#{session_id}|#{response["transactionId"]}"
178
+ "#{session_id}|#{response['transactionId']}"
179
179
  end
180
180
  end
181
181
  end
@@ -20,7 +20,7 @@ module ActiveMerchant #:nodoc:
20
20
  self.supported_countries = %w(AU AE BD BN EG HK ID JO KW LB LK MU MV MY NZ OM PH QA SA SG TT VN)
21
21
 
22
22
  # The card types supported by the payment gateway
23
- self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :jcb]
23
+ self.supported_cardtypes = %i[visa master american_express diners_club jcb]
24
24
 
25
25
  self.money_format = :cents
26
26
  self.currencies_without_fractions = %w(IDR)
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
8
8
  TEST_XMLNS = 'https://secure.modpay.com/netservices/test/'
9
9
 
10
10
  self.supported_countries = ['US']
11
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
11
+ self.supported_cardtypes = %i[visa master american_express discover]
12
12
  self.homepage_url = 'http://www.modpay.com'
13
13
  self.display_name = 'Modern Payments'
14
14
 
@@ -14,9 +14,9 @@ module ActiveMerchant #:nodoc:
14
14
  self.test_url = 'https://test.monei-api.net/payment/ctpe'
15
15
  self.live_url = 'https://monei-api.net/payment/ctpe'
16
16
 
17
- self.supported_countries = ['AD', 'AT', 'BE', 'BG', 'CA', 'CH', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FO', 'FR', 'GB', 'GI', 'GR', 'HU', 'IE', 'IL', 'IS', 'IT', 'LI', 'LT', 'LU', 'LV', 'MT', 'NL', 'NO', 'PL', 'PT', 'RO', 'SE', 'SI', 'SK', 'TR', 'US', 'VA']
17
+ self.supported_countries = %w[AD AT BE BG CA CH CY CZ DE DK EE ES FI FO FR GB GI GR HU IE IL IS IT LI LT LU LV MT NL NO PL PT RO SE SI SK TR US VA]
18
18
  self.default_currency = 'EUR'
19
- self.supported_cardtypes = [:visa, :master, :maestro, :jcb, :american_express]
19
+ self.supported_cardtypes = %i[visa master maestro jcb american_express]
20
20
 
21
21
  self.homepage_url = 'http://www.monei.net/'
22
22
  self.display_name = 'Monei'
@@ -13,7 +13,7 @@ module ActiveMerchant #:nodoc:
13
13
  self.live_url = 'https://www3.moneris.com/gateway2/servlet/MpgRequest'
14
14
 
15
15
  self.supported_countries = ['CA']
16
- self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :discover]
16
+ self.supported_cardtypes = %i[visa master american_express diners_club discover]
17
17
  self.homepage_url = 'http://www.moneris.com/'
18
18
  self.display_name = 'Moneris'
19
19
 
@@ -417,27 +417,27 @@ module ActiveMerchant #:nodoc:
417
417
 
418
418
  def actions
419
419
  {
420
- 'purchase' => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type, :avs_info, :cvd_info, :track2, :pos_code, :cof_info],
421
- 'preauth' => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type, :avs_info, :cvd_info, :track2, :pos_code, :cof_info],
420
+ 'purchase' => %i[order_id cust_id amount pan expdate crypt_type avs_info cvd_info track2 pos_code cof_info],
421
+ 'preauth' => %i[order_id cust_id amount pan expdate crypt_type avs_info cvd_info track2 pos_code cof_info],
422
422
  'command' => [:order_id],
423
- 'refund' => [:order_id, :amount, :txn_number, :crypt_type],
424
- 'indrefund' => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
425
- 'completion' => [:order_id, :comp_amount, :txn_number, :crypt_type],
426
- 'purchasecorrection' => [:order_id, :txn_number, :crypt_type],
427
- 'cavv_preauth' => [:order_id, :cust_id, :amount, :pan, :expdate, :cavv, :crypt_type, :wallet_indicator],
428
- 'cavv_purchase' => [:order_id, :cust_id, :amount, :pan, :expdate, :cavv, :crypt_type, :wallet_indicator],
429
- 'card_verification' => [:order_id, :cust_id, :pan, :expdate, :crypt_type, :avs_info, :cvd_info, :cof_info],
430
- 'transact' => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
423
+ 'refund' => %i[order_id amount txn_number crypt_type],
424
+ 'indrefund' => %i[order_id cust_id amount pan expdate crypt_type],
425
+ 'completion' => %i[order_id comp_amount txn_number crypt_type],
426
+ 'purchasecorrection' => %i[order_id txn_number crypt_type],
427
+ 'cavv_preauth' => %i[order_id cust_id amount pan expdate cavv crypt_type wallet_indicator],
428
+ 'cavv_purchase' => %i[order_id cust_id amount pan expdate cavv crypt_type wallet_indicator],
429
+ 'card_verification' => %i[order_id cust_id pan expdate crypt_type avs_info cvd_info cof_info],
430
+ 'transact' => %i[order_id cust_id amount pan expdate crypt_type],
431
431
  'Batchcloseall' => [],
432
432
  'opentotals' => [:ecr_number],
433
433
  'batchclose' => [:ecr_number],
434
- 'res_add_cc' => [:pan, :expdate, :crypt_type, :avs_info, :cof_info],
435
- 'res_temp_add' => [:pan, :expdate, :crypt_type, :duration],
434
+ 'res_add_cc' => %i[pan expdate crypt_type avs_info cof_info],
435
+ 'res_temp_add' => %i[pan expdate crypt_type duration],
436
436
  'res_delete' => [:data_key],
437
- 'res_update_cc' => [:data_key, :pan, :expdate, :crypt_type, :avs_info, :cof_info],
438
- 'res_purchase_cc' => [:data_key, :order_id, :cust_id, :amount, :crypt_type, :cof_info],
439
- 'res_preauth_cc' => [:data_key, :order_id, :cust_id, :amount, :crypt_type, :cof_info],
440
- 'res_card_verification_cc' => [:order_id, :data_key, :expdate, :crypt_type, :cof_info]
437
+ 'res_update_cc' => %i[data_key pan expdate crypt_type avs_info cof_info],
438
+ 'res_purchase_cc' => %i[data_key order_id cust_id amount crypt_type cof_info],
439
+ 'res_preauth_cc' => %i[data_key order_id cust_id amount crypt_type cof_info],
440
+ 'res_card_verification_cc' => %i[order_id data_key expdate crypt_type cof_info]
441
441
  }
442
442
  end
443
443
  end