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
@@ -9,14 +9,14 @@ module ActiveMerchant #:nodoc:
9
9
  # largely depends on the transaction acquiring bank. Be sure to understand how
10
10
  # your account was configured prior to using this gateway.
11
11
  class CulqiGateway < Gateway
12
- self.display_name = "Culqi"
13
- self.homepage_url = "https://www.culqi.com"
12
+ self.display_name = 'Culqi'
13
+ self.homepage_url = 'https://www.culqi.com'
14
14
 
15
- self.test_url = "https://staging.paymentz.com/transaction/"
16
- self.live_url = "https://secure.culqi.com/transaction/"
15
+ self.test_url = 'https://staging.paymentz.com/transaction/'
16
+ self.live_url = 'https://secure.culqi.com/transaction/'
17
17
 
18
- self.supported_countries = ["PE"]
19
- self.default_currency = "PEN"
18
+ self.supported_countries = ['PE']
19
+ self.default_currency = 'PEN'
20
20
  self.money_format = :dollars
21
21
  self.supported_cardtypes = [:visa, :master, :diners_club, :american_express]
22
22
 
@@ -86,8 +86,8 @@ module ActiveMerchant #:nodoc:
86
86
  end
87
87
 
88
88
  def verify_credentials
89
- response = void("0", order_id: "0")
90
- response.message.include? "Transaction not found"
89
+ response = void('0', order_id: '0')
90
+ response.message.include? 'Transaction not found'
91
91
  end
92
92
 
93
93
  def store(credit_card, options={})
@@ -181,11 +181,11 @@ module ActiveMerchant #:nodoc:
181
181
 
182
182
  def add_checksum(action, post)
183
183
  checksum_elements = case action
184
- when :capture; [post[:toid], post[:trackingid], post[:captureamount], @options[:secret_key]]
185
- when :void; [post[:toid], post[:description], post[:trackingid], @options[:secret_key]]
186
- when :refund; [post[:toid], post[:trackingid], post[:refundamount], @options[:secret_key]]
187
- when :tokenize; [post[:partnerid], post[:cardnumber], post[:cvv], @options[:secret_key]]
188
- when :invalidate; [post[:partnerid], post[:token], @options[:secret_key]]
184
+ when :capture then [post[:toid], post[:trackingid], post[:captureamount], @options[:secret_key]]
185
+ when :void then [post[:toid], post[:description], post[:trackingid], @options[:secret_key]]
186
+ when :refund then [post[:toid], post[:trackingid], post[:refundamount], @options[:secret_key]]
187
+ when :tokenize then [post[:partnerid], post[:cardnumber], post[:cvv], @options[:secret_key]]
188
+ when :invalidate then [post[:partnerid], post[:token], @options[:secret_key]]
189
189
  else [post[:toid], post[:totype], post[:amount], post[:description], post[:redirecturl],
190
190
  post[:cardnumber] || post[:token], @options[:secret_key]]
191
191
  end
@@ -198,13 +198,13 @@ module ActiveMerchant #:nodoc:
198
198
  end
199
199
 
200
200
  ACTIONS = {
201
- authorize: "SingleCallGenericServlet",
202
- capture: "SingleCallGenericCaptureServlet",
203
- void: "SingleCallGenericVoid",
204
- refund: "SingleCallGenericReverse",
205
- tokenize: "SingleCallTokenServlet",
206
- invalidate: "SingleCallInvalidateToken",
207
- tokenpay: "SingleCallTokenTransaction",
201
+ authorize: 'SingleCallGenericServlet',
202
+ capture: 'SingleCallGenericCaptureServlet',
203
+ void: 'SingleCallGenericVoid',
204
+ refund: 'SingleCallGenericReverse',
205
+ tokenize: 'SingleCallTokenServlet',
206
+ invalidate: 'SingleCallInvalidateToken',
207
+ tokenpay: 'SingleCallTokenTransaction',
208
208
  }
209
209
 
210
210
  def commit(action, params)
@@ -229,8 +229,8 @@ module ActiveMerchant #:nodoc:
229
229
 
230
230
  def headers
231
231
  {
232
- "Accept" => "application/json",
233
- "Content-Type" => "application/x-www-form-urlencoded;charset=UTF-8"
232
+ 'Accept' => 'application/json',
233
+ 'Content-Type' => 'application/x-www-form-urlencoded;charset=UTF-8'
234
234
  }
235
235
  end
236
236
 
@@ -246,11 +246,11 @@ module ActiveMerchant #:nodoc:
246
246
  begin
247
247
  JSON.parse(body)
248
248
  rescue JSON::ParserError
249
- message = "Invalid JSON response received from CulqiGateway. Please contact CulqiGateway if you continue to receive this message."
249
+ message = 'Invalid JSON response received from CulqiGateway. Please contact CulqiGateway if you continue to receive this message.'
250
250
  message += "(The raw response returned by the API was #{body.inspect})"
251
251
  {
252
- "status" => "N",
253
- "statusdescription" => message
252
+ 'status' => 'N',
253
+ 'statusdescription' => message
254
254
  }
255
255
  end
256
256
  end
@@ -24,7 +24,7 @@ module ActiveMerchant #:nodoc:
24
24
  self.test_url = 'https://ics2wstesta.ic3.com/commerce/1.x/transactionProcessor'
25
25
  self.live_url = 'https://ics2wsa.ic3.com/commerce/1.x/transactionProcessor'
26
26
 
27
- XSD_VERSION = "1.121"
27
+ XSD_VERSION = '1.121'
28
28
 
29
29
  self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb, :switch, :dankort, :maestro]
30
30
  self.supported_countries = %w(US BR CA CN DK FI FR DE JP MX NO SE GB SG LB)
@@ -48,44 +48,44 @@ module ActiveMerchant #:nodoc:
48
48
  }
49
49
 
50
50
  @@response_codes = {
51
- :r100 => "Successful transaction",
52
- :r101 => "Request is missing one or more required fields" ,
53
- :r102 => "One or more fields contains invalid data",
54
- :r150 => "General failure",
55
- :r151 => "The request was received but a server time-out occurred",
56
- :r152 => "The request was received, but a service timed out",
57
- :r200 => "The authorization request was approved by the issuing bank but declined by CyberSource because it did not pass the AVS check",
58
- :r201 => "The issuing bank has questions about the request",
59
- :r202 => "Expired card",
60
- :r203 => "General decline of the card",
61
- :r204 => "Insufficient funds in the account",
62
- :r205 => "Stolen or lost card",
63
- :r207 => "Issuing bank unavailable",
64
- :r208 => "Inactive card or card not authorized for card-not-present transactions",
65
- :r209 => "American Express Card Identifiction Digits (CID) did not match",
66
- :r210 => "The card has reached the credit limit",
67
- :r211 => "Invalid card verification number",
51
+ :r100 => 'Successful transaction',
52
+ :r101 => 'Request is missing one or more required fields' ,
53
+ :r102 => 'One or more fields contains invalid data',
54
+ :r150 => 'General failure',
55
+ :r151 => 'The request was received but a server time-out occurred',
56
+ :r152 => 'The request was received, but a service timed out',
57
+ :r200 => 'The authorization request was approved by the issuing bank but declined by CyberSource because it did not pass the AVS check',
58
+ :r201 => 'The issuing bank has questions about the request',
59
+ :r202 => 'Expired card',
60
+ :r203 => 'General decline of the card',
61
+ :r204 => 'Insufficient funds in the account',
62
+ :r205 => 'Stolen or lost card',
63
+ :r207 => 'Issuing bank unavailable',
64
+ :r208 => 'Inactive card or card not authorized for card-not-present transactions',
65
+ :r209 => 'American Express Card Identifiction Digits (CID) did not match',
66
+ :r210 => 'The card has reached the credit limit',
67
+ :r211 => 'Invalid card verification number',
68
68
  :r221 => "The customer matched an entry on the processor's negative file",
69
- :r230 => "The authorization request was approved by the issuing bank but declined by CyberSource because it did not pass the card verification check",
70
- :r231 => "Invalid account number",
71
- :r232 => "The card type is not accepted by the payment processor",
72
- :r233 => "General decline by the processor",
73
- :r234 => "A problem exists with your CyberSource merchant configuration",
74
- :r235 => "The requested amount exceeds the originally authorized amount",
75
- :r236 => "Processor failure",
76
- :r237 => "The authorization has already been reversed",
77
- :r238 => "The authorization has already been captured",
78
- :r239 => "The requested transaction amount must match the previous transaction amount",
79
- :r240 => "The card type sent is invalid or does not correlate with the credit card number",
80
- :r241 => "The request ID is invalid",
81
- :r242 => "You requested a capture, but there is no corresponding, unused authorization record.",
82
- :r243 => "The transaction has already been settled or reversed",
83
- :r244 => "The bank account number failed the validation check",
84
- :r246 => "The capture or credit is not voidable because the capture or credit information has already been submitted to your processor",
85
- :r247 => "You requested a credit for a capture that was previously voided",
86
- :r250 => "The request was received, but a time-out occurred with the payment processor",
87
- :r254 => "Your CyberSource account is prohibited from processing stand-alone refunds",
88
- :r255 => "Your CyberSource account is not configured to process the service in the country you specified"
69
+ :r230 => 'The authorization request was approved by the issuing bank but declined by CyberSource because it did not pass the card verification check',
70
+ :r231 => 'Invalid account number',
71
+ :r232 => 'The card type is not accepted by the payment processor',
72
+ :r233 => 'General decline by the processor',
73
+ :r234 => 'A problem exists with your CyberSource merchant configuration',
74
+ :r235 => 'The requested amount exceeds the originally authorized amount',
75
+ :r236 => 'Processor failure',
76
+ :r237 => 'The authorization has already been reversed',
77
+ :r238 => 'The authorization has already been captured',
78
+ :r239 => 'The requested transaction amount must match the previous transaction amount',
79
+ :r240 => 'The card type sent is invalid or does not correlate with the credit card number',
80
+ :r241 => 'The request ID is invalid',
81
+ :r242 => 'You requested a capture, but there is no corresponding, unused authorization record.',
82
+ :r243 => 'The transaction has already been settled or reversed',
83
+ :r244 => 'The bank account number failed the validation check',
84
+ :r246 => 'The capture or credit is not voidable because the capture or credit information has already been submitted to your processor',
85
+ :r247 => 'You requested a credit for a capture that was previously voided',
86
+ :r250 => 'The request was received, but a time-out occurred with the payment processor',
87
+ :r254 => 'Your CyberSource account is prohibited from processing stand-alone refunds',
88
+ :r255 => 'Your CyberSource account is not configured to process the service in the country you specified'
89
89
  }
90
90
 
91
91
  # These are the options that can be used when creating a new CyberSource
@@ -232,8 +232,8 @@ module ActiveMerchant #:nodoc:
232
232
  end
233
233
 
234
234
  def verify_credentials
235
- response = void("0")
236
- response.params["reasonCode"] == "102"
235
+ response = void('0')
236
+ response.params['reasonCode'] == '102'
237
237
  end
238
238
 
239
239
  private
@@ -276,7 +276,7 @@ module ActiveMerchant #:nodoc:
276
276
  end
277
277
 
278
278
  def build_capture_request(money, authorization, options)
279
- order_id, request_id, request_token = authorization.split(";")
279
+ order_id, request_id, request_token = authorization.split(';')
280
280
  options[:order_id] = order_id
281
281
 
282
282
  xml = Builder::XmlMarkup.new :indent => 2
@@ -303,11 +303,11 @@ module ActiveMerchant #:nodoc:
303
303
  end
304
304
 
305
305
  def build_void_request(identification, options)
306
- order_id, request_id, request_token, action, money, currency = identification.split(";")
306
+ order_id, request_id, request_token, action, money, currency = identification.split(';')
307
307
  options[:order_id] = order_id
308
308
 
309
309
  xml = Builder::XmlMarkup.new :indent => 2
310
- if action == "capture"
310
+ if action == 'capture'
311
311
  add_void_service(xml, request_id, request_token)
312
312
  else
313
313
  add_purchase_data(xml, money, true, options.merge(:currency => currency || default_currency))
@@ -317,7 +317,7 @@ module ActiveMerchant #:nodoc:
317
317
  end
318
318
 
319
319
  def build_refund_request(money, identification, options)
320
- order_id, request_id, request_token = identification.split(";")
320
+ order_id, request_id, request_token = identification.split(';')
321
321
  options[:order_id] = order_id
322
322
 
323
323
  xml = Builder::XmlMarkup.new :indent => 2
@@ -338,7 +338,7 @@ module ActiveMerchant #:nodoc:
338
338
  end
339
339
 
340
340
  def build_create_subscription_request(payment_method, options)
341
- default_subscription_params = {:frequency => "on-demand", :amount => 0, :automatic_renew => false}
341
+ default_subscription_params = {:frequency => 'on-demand', :amount => 0, :automatic_renew => false}
342
342
  options[:subscription] = default_subscription_params.update(
343
343
  options[:subscription] || {}
344
344
  )
@@ -485,7 +485,7 @@ module ActiveMerchant #:nodoc:
485
485
  end
486
486
 
487
487
  def add_mdd_fields(xml, options)
488
- return unless options.keys.any? { |key| key.to_s.start_with?("mdd_field") }
488
+ return unless options.keys.any? { |key| key.to_s.start_with?('mdd_field') }
489
489
 
490
490
  xml.tag! 'merchantDefinedData' do
491
491
  (1..100).each do |each|
@@ -528,24 +528,24 @@ module ActiveMerchant #:nodoc:
528
528
  case card_brand(payment_method).to_sym
529
529
  when :visa
530
530
  xml.tag! 'ccAuthService', {'run' => 'true'} do
531
- xml.tag!("cavv", payment_method.payment_cryptogram)
532
- xml.tag!("commerceIndicator", "vbv")
533
- xml.tag!("xid", payment_method.payment_cryptogram)
531
+ xml.tag!('cavv', payment_method.payment_cryptogram)
532
+ xml.tag!('commerceIndicator', 'vbv')
533
+ xml.tag!('xid', payment_method.payment_cryptogram)
534
534
  end
535
535
  when :mastercard
536
536
  xml.tag! 'ucaf' do
537
- xml.tag!("authenticationData", payment_method.payment_cryptogram)
538
- xml.tag!("collectionIndicator", "2")
537
+ xml.tag!('authenticationData', payment_method.payment_cryptogram)
538
+ xml.tag!('collectionIndicator', '2')
539
539
  end
540
540
  xml.tag! 'ccAuthService', {'run' => 'true'} do
541
- xml.tag!("commerceIndicator", "spa")
541
+ xml.tag!('commerceIndicator', 'spa')
542
542
  end
543
543
  when :american_express
544
544
  cryptogram = Base64.decode64(payment_method.payment_cryptogram)
545
545
  xml.tag! 'ccAuthService', {'run' => 'true'} do
546
- xml.tag!("cavv", Base64.encode64(cryptogram[0...20]))
547
- xml.tag!("commerceIndicator", "aesk")
548
- xml.tag!("xid", Base64.encode64(cryptogram[20...40]))
546
+ xml.tag!('cavv', Base64.encode64(cryptogram[0...20]))
547
+ xml.tag!('commerceIndicator', 'aesk')
548
+ xml.tag!('xid', Base64.encode64(cryptogram[20...40]))
549
549
  end
550
550
  end
551
551
  end
@@ -618,7 +618,7 @@ module ActiveMerchant #:nodoc:
618
618
 
619
619
  xml.tag! 'recurringSubscriptionInfo' do
620
620
  if reference
621
- subscription_id = reference.split(";")[6]
621
+ subscription_id = reference.split(';')[6]
622
622
  xml.tag! 'subscriptionID', subscription_id
623
623
  end
624
624
 
@@ -627,8 +627,8 @@ module ActiveMerchant #:nodoc:
627
627
  xml.tag! 'numberOfPayments', options[:subscription][:occurrences] if options[:subscription][:occurrences]
628
628
  xml.tag! 'automaticRenew', options[:subscription][:automatic_renew] if options[:subscription][:automatic_renew]
629
629
  xml.tag! 'frequency', options[:subscription][:frequency] if options[:subscription][:frequency]
630
- xml.tag! 'startDate', options[:subscription][:start_date].strftime("%Y%m%d") if options[:subscription][:start_date]
631
- xml.tag! 'endDate', options[:subscription][:end_date].strftime("%Y%m%d") if options[:subscription][:end_date]
630
+ xml.tag! 'startDate', options[:subscription][:start_date].strftime('%Y%m%d') if options[:subscription][:start_date]
631
+ xml.tag! 'endDate', options[:subscription][:end_date].strftime('%Y%m%d') if options[:subscription][:end_date]
632
632
  xml.tag! 'approvalRequired', options[:subscription][:approval_required] || false
633
633
  xml.tag! 'event', options[:subscription][:event] if options[:subscription][:event]
634
634
  xml.tag! 'billPayment', options[:subscription][:bill_payment] if options[:subscription][:bill_payment]
@@ -637,13 +637,13 @@ module ActiveMerchant #:nodoc:
637
637
 
638
638
  def add_creditcard_payment_method(xml)
639
639
  xml.tag! 'subscription' do
640
- xml.tag! 'paymentMethod', "credit card"
640
+ xml.tag! 'paymentMethod', 'credit card'
641
641
  end
642
642
  end
643
643
 
644
644
  def add_check_payment_method(xml)
645
645
  xml.tag! 'subscription' do
646
- xml.tag! 'paymentMethod', "check"
646
+ xml.tag! 'paymentMethod', 'check'
647
647
  end
648
648
  end
649
649
 
@@ -715,7 +715,7 @@ module ActiveMerchant #:nodoc:
715
715
  response = { message: e.to_s }
716
716
  end
717
717
 
718
- success = response[:decision] == "ACCEPT"
718
+ success = response[:decision] == 'ACCEPT'
719
719
  message = response[:message]
720
720
 
721
721
  authorization = success ? authorization_from(response, action, amount, options) : nil
@@ -733,7 +733,7 @@ module ActiveMerchant #:nodoc:
733
733
  def parse(xml)
734
734
  reply = {}
735
735
  xml = REXML::Document.new(xml)
736
- if root = REXML::XPath.first(xml, "//c:replyMessage")
736
+ if root = REXML::XPath.first(xml, '//c:replyMessage')
737
737
  root.elements.to_a.each do |node|
738
738
  case node.expanded_name
739
739
  when 'c:reasonCode'
@@ -743,7 +743,7 @@ module ActiveMerchant #:nodoc:
743
743
  parse_element(reply, node)
744
744
  end
745
745
  end
746
- elsif root = REXML::XPath.first(xml, "//soap:Fault")
746
+ elsif root = REXML::XPath.first(xml, '//soap:Fault')
747
747
  parse_element(reply, root)
748
748
  reply[:message] = "#{reply[:faultcode]}: #{reply[:faultstring]}"
749
749
  end
@@ -756,7 +756,7 @@ module ActiveMerchant #:nodoc:
756
756
  else
757
757
  if node.parent.name =~ /item/
758
758
  parent = node.parent.name
759
- parent += '_' + node.parent.attributes["id"] if node.parent.attributes["id"]
759
+ parent += '_' + node.parent.attributes['id'] if node.parent.attributes['id']
760
760
  parent += '_'
761
761
  end
762
762
  reply["#{parent}#{node.name}".to_sym] ||= node.text
@@ -771,7 +771,7 @@ module ActiveMerchant #:nodoc:
771
771
 
772
772
  def authorization_from(response, action, amount, options)
773
773
  [options[:order_id], response[:requestID], response[:requestToken], action, amount,
774
- options[:currency], response[:subscriptionID]].join(";")
774
+ options[:currency], response[:subscriptionID]].join(';')
775
775
  end
776
776
  end
777
777
  end
@@ -1,4 +1,4 @@
1
- require "active_support/core_ext/string/access"
1
+ require 'active_support/core_ext/string/access'
2
2
 
3
3
  module ActiveMerchant
4
4
  module Billing
@@ -142,7 +142,7 @@ module ActiveMerchant
142
142
 
143
143
  def build_purchase_or_authorization_request_with_continuous_authority_reference_request(type, money, authorization, options)
144
144
  parsed_authorization = parse_authorization_string(authorization)
145
- raise ArgumentError, "The continuous authority reference is required for continuous authority transactions" if parsed_authorization[:ca_reference].blank?
145
+ raise ArgumentError, 'The continuous authority reference is required for continuous authority transactions' if parsed_authorization[:ca_reference].blank?
146
146
 
147
147
  xml = Builder::XmlMarkup.new :indent => 2
148
148
  xml.instruct!
@@ -288,7 +288,7 @@ module ActiveMerchant
288
288
 
289
289
  response = {}
290
290
  xml = REXML::Document.new(body)
291
- root = REXML::XPath.first(xml, "//Response")
291
+ root = REXML::XPath.first(xml, '//Response')
292
292
 
293
293
  root.elements.to_a.each do |node|
294
294
  parse_element(response, node)
@@ -306,7 +306,7 @@ module ActiveMerchant
306
306
  end
307
307
 
308
308
  def format_reference_number(number)
309
- number.to_s.gsub(/[^A-Za-z0-9]/, '').rjust(6, "0").first(30)
309
+ number.to_s.gsub(/[^A-Za-z0-9]/, '').rjust(6, '0').first(30)
310
310
  end
311
311
 
312
312
  def parse_authorization_string(authorization)
@@ -1,13 +1,13 @@
1
1
  module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  class DibsGateway < Gateway
4
- self.display_name = "DIBS"
5
- self.homepage_url = "http://www.dibspayment.com/"
4
+ self.display_name = 'DIBS'
5
+ self.homepage_url = 'http://www.dibspayment.com/'
6
6
 
7
- self.live_url = "https://api.dibspayment.com/merchant/v1/JSON/Transaction/"
7
+ self.live_url = 'https://api.dibspayment.com/merchant/v1/JSON/Transaction/'
8
8
 
9
- self.supported_countries = ["US", "FI", "NO", "SE", "GB"]
10
- self.default_currency = "USD"
9
+ self.supported_countries = ['US', 'FI', 'NO', 'SE', 'GB']
10
+ self.default_currency = 'USD'
11
11
  self.money_format = :cents
12
12
  self.supported_cardtypes = [:visa, :master, :american_express, :discover]
13
13
 
@@ -89,12 +89,12 @@ module ActiveMerchant #:nodoc:
89
89
  private
90
90
 
91
91
  CURRENCY_CODES = Hash.new{|h,k| raise ArgumentError.new("Unsupported currency: #{k}")}
92
- CURRENCY_CODES["USD"] = "840"
93
- CURRENCY_CODES["DKK"] = "208"
94
- CURRENCY_CODES["NOK"] = "578"
95
- CURRENCY_CODES["SEK"] = "752"
96
- CURRENCY_CODES["GBP"] = "826"
97
- CURRENCY_CODES["EUR"] = "978"
92
+ CURRENCY_CODES['USD'] = '840'
93
+ CURRENCY_CODES['DKK'] = '208'
94
+ CURRENCY_CODES['NOK'] = '578'
95
+ CURRENCY_CODES['SEK'] = '752'
96
+ CURRENCY_CODES['GBP'] = '826'
97
+ CURRENCY_CODES['EUR'] = '978'
98
98
 
99
99
  def add_invoice(post, money, options)
100
100
  post[:orderId] = options[:order_id] || generate_unique_id
@@ -114,7 +114,7 @@ module ActiveMerchant #:nodoc:
114
114
  post[:startMonth] = payment_method.start_month if payment_method.start_month
115
115
  post[:startYear] = payment_method.start_year if payment_method.start_year
116
116
  post[:issueNumber] = payment_method.issue_number if payment_method.issue_number
117
- post[:clientIp] = options[:ip] || "127.0.0.1"
117
+ post[:clientIp] = options[:ip] || '127.0.0.1'
118
118
  post[:test] = true if test?
119
119
  end
120
120
 
@@ -128,12 +128,12 @@ module ActiveMerchant #:nodoc:
128
128
  end
129
129
 
130
130
  ACTIONS = {
131
- authorize: "AuthorizeCard",
132
- authorize_ticket: "AuthorizeTicket",
133
- capture: "CaptureTransaction",
134
- void: "CancelTransaction",
135
- refund: "RefundTransaction",
136
- store: "CreateTicket"
131
+ authorize: 'AuthorizeCard',
132
+ authorize_ticket: 'AuthorizeTicket',
133
+ capture: 'CaptureTransaction',
134
+ void: 'CancelTransaction',
135
+ refund: 'RefundTransaction',
136
+ store: 'CreateTicket'
137
137
  }
138
138
 
139
139
  def commit(action, post)
@@ -155,7 +155,7 @@ module ActiveMerchant #:nodoc:
155
155
 
156
156
  def headers
157
157
  {
158
- "Content-Type" => "application/x-www-form-urlencoded"
158
+ 'Content-Type' => 'application/x-www-form-urlencoded'
159
159
  }
160
160
  end
161
161
 
@@ -165,7 +165,7 @@ module ActiveMerchant #:nodoc:
165
165
  end
166
166
 
167
167
  def add_hmac(post)
168
- data = post.sort.collect { |key, value| "#{key}=#{value.to_s}" }.join("&")
168
+ data = post.sort.collect { |key, value| "#{key}=#{value.to_s}" }.join('&')
169
169
  digest = OpenSSL::Digest.new('sha256')
170
170
  key = [@options[:secret_key]].pack('H*')
171
171
  post[:MAC] = OpenSSL::HMAC.hexdigest(digest, key, data)
@@ -180,14 +180,14 @@ module ActiveMerchant #:nodoc:
180
180
  end
181
181
 
182
182
  def success_from(raw_response)
183
- raw_response["status"] == "ACCEPT"
183
+ raw_response['status'] == 'ACCEPT'
184
184
  end
185
185
 
186
186
  def message_from(succeeded, response)
187
187
  if succeeded
188
- "Succeeded"
188
+ 'Succeeded'
189
189
  else
190
- response["status"] + ": " + response["declineReason"] || "Unable to read error message"
190
+ response['status'] + ': ' + response['declineReason'] || 'Unable to read error message'
191
191
  end
192
192
  end
193
193
 
@@ -196,7 +196,7 @@ module ActiveMerchant #:nodoc:
196
196
  end
197
197
 
198
198
  def unparsable_response(raw_response)
199
- message = "Invalid JSON response received from Dibs. Please contact Dibs if you continue to receive this message."
199
+ message = 'Invalid JSON response received from Dibs. Please contact Dibs if you continue to receive this message.'
200
200
  message += " (The raw response returned by the API was #{raw_response.inspect})"
201
201
  return Response.new(false, message)
202
202
  end