activemerchant 1.79.2 → 1.80.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -16,8 +16,8 @@ module ActiveMerchant #:nodoc:
16
16
  # The name of the gateway
17
17
  self.display_name = 'InstaPay'
18
18
 
19
- SUCCESS = "Accepted"
20
- SUCCESS_MESSAGE = "The transaction has been approved"
19
+ SUCCESS = 'Accepted'
20
+ SUCCESS_MESSAGE = 'The transaction has been approved'
21
21
 
22
22
  def initialize(options = {})
23
23
  requires!(options, :login)
@@ -66,7 +66,7 @@ module ActiveMerchant #:nodoc:
66
66
 
67
67
  def add_customer_data(post, options)
68
68
  post[:ci_email] = options[:email]
69
- post["ci_IP Address"] = options[:ip]
69
+ post['ci_IP Address'] = options[:ip]
70
70
  end
71
71
 
72
72
  def add_address(post, options)
@@ -154,7 +154,7 @@ module ActiveMerchant #:nodoc:
154
154
  post[:merchantpin] = @options[:password]
155
155
  end
156
156
  post[:action] = action
157
- request = post.merge(parameters).collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join("&")
157
+ request = post.merge(parameters).collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
158
158
  request
159
159
  end
160
160
  end
@@ -1,4 +1,4 @@
1
- require "nokogiri"
1
+ require 'nokogiri'
2
2
 
3
3
  module ActiveMerchant #:nodoc:
4
4
  module Billing #:nodoc:
@@ -15,10 +15,10 @@ module ActiveMerchant #:nodoc:
15
15
  self.money_format = :cents
16
16
 
17
17
  STANDARD_ERROR_CODE_MAPPING = {
18
- "05" => STANDARD_ERROR_CODE[:card_declined],
19
- "06" => STANDARD_ERROR_CODE[:processing_error],
20
- "14" => STANDARD_ERROR_CODE[:invalid_number],
21
- "54" => STANDARD_ERROR_CODE[:expired_card],
18
+ '05' => STANDARD_ERROR_CODE[:card_declined],
19
+ '06' => STANDARD_ERROR_CODE[:processing_error],
20
+ '14' => STANDARD_ERROR_CODE[:invalid_number],
21
+ '54' => STANDARD_ERROR_CODE[:expired_card],
22
22
  }
23
23
 
24
24
  def initialize(options={})
@@ -27,11 +27,11 @@ module ActiveMerchant #:nodoc:
27
27
  end
28
28
 
29
29
  def purchase(money, payment, options={})
30
- commit("SubmitSinglePayment") do |xml|
30
+ commit('SubmitSinglePayment') do |xml|
31
31
  xml.Transaction do
32
32
  xml.CustRef options[:order_id]
33
33
  add_amount(xml, money)
34
- xml.TrnType "1"
34
+ xml.TrnType '1'
35
35
  add_credit_card(xml, payment)
36
36
  add_credentials(xml)
37
37
  xml.TrnSource options[:ip]
@@ -40,11 +40,11 @@ module ActiveMerchant #:nodoc:
40
40
  end
41
41
 
42
42
  def authorize(money, payment, options={})
43
- commit("SubmitSinglePayment") do |xml|
43
+ commit('SubmitSinglePayment') do |xml|
44
44
  xml.Transaction do
45
45
  xml.CustRef options[:order_id]
46
46
  add_amount(xml, money)
47
- xml.TrnType "2"
47
+ xml.TrnType '2'
48
48
  add_credit_card(xml, payment)
49
49
  add_credentials(xml)
50
50
  xml.TrnSource options[:ip]
@@ -53,7 +53,7 @@ module ActiveMerchant #:nodoc:
53
53
  end
54
54
 
55
55
  def capture(money, authorization, options={})
56
- commit("SubmitSingleCapture") do |xml|
56
+ commit('SubmitSingleCapture') do |xml|
57
57
  xml.Capture do
58
58
  xml.Receipt authorization
59
59
  add_amount(xml, money)
@@ -63,7 +63,7 @@ module ActiveMerchant #:nodoc:
63
63
  end
64
64
 
65
65
  def refund(money, authorization, options={})
66
- commit("SubmitSingleRefund") do |xml|
66
+ commit('SubmitSingleRefund') do |xml|
67
67
  xml.Refund do
68
68
  xml.Receipt authorization
69
69
  add_amount(xml, money)
@@ -97,7 +97,7 @@ module ActiveMerchant #:nodoc:
97
97
  end
98
98
 
99
99
  def add_credit_card(xml, payment)
100
- xml.CreditCard :Registered => "False" do
100
+ xml.CreditCard :Registered => 'False' do
101
101
  xml.CardNumber payment.number
102
102
  xml.ExpM format(payment.month, :two_digits)
103
103
  xml.ExpY format(payment.year, :four_digits)
@@ -119,8 +119,8 @@ module ActiveMerchant #:nodoc:
119
119
 
120
120
  def commit(action, &block)
121
121
  headers = {
122
- "Content-Type" => "text/xml; charset=utf-8",
123
- "SOAPAction" => "http://www.ippayments.com.au/interface/api/dts/#{action}",
122
+ 'Content-Type' => 'text/xml; charset=utf-8',
123
+ 'SOAPAction' => "http://www.ippayments.com.au/interface/api/dts/#{action}",
124
124
  }
125
125
  response = parse(ssl_post(commit_url, new_submit_xml(action, &block), headers))
126
126
 
@@ -137,9 +137,9 @@ module ActiveMerchant #:nodoc:
137
137
  def new_submit_xml(action)
138
138
  xml = Builder::XmlMarkup.new(indent: 2)
139
139
  xml.instruct!
140
- xml.soap :Envelope, "xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance", "xmlns:xsd" => "http://www.w3.org/2001/XMLSchema", "xmlns:soap" => "http://schemas.xmlsoap.org/soap/envelope/" do
140
+ xml.soap :Envelope, 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema', 'xmlns:soap' => 'http://schemas.xmlsoap.org/soap/envelope/' do
141
141
  xml.soap :Body do
142
- xml.__send__(action, "xmlns" => "http://www.ippayments.com.au/interface/api/dts") do
142
+ xml.__send__(action, 'xmlns' => 'http://www.ippayments.com.au/interface/api/dts') do
143
143
  xml.trnXML do
144
144
  inner_xml = Builder::XmlMarkup.new(indent: 2)
145
145
  yield(inner_xml)
@@ -156,7 +156,7 @@ module ActiveMerchant #:nodoc:
156
156
  end
157
157
 
158
158
  def success_from(response)
159
- (response[:response_code] == "0")
159
+ (response[:response_code] == '0')
160
160
  end
161
161
 
162
162
  def error_code_from(response)
@@ -24,202 +24,202 @@ module ActiveMerchant #:nodoc:
24
24
  self.display_name = 'Iridium'
25
25
 
26
26
  CURRENCY_CODES = {
27
- "AED" => '784',
28
- "AFN" => '971',
29
- "ALL" => '008',
30
- "AMD" => '051',
31
- "ANG" => '532',
32
- "AOA" => '973',
33
- "ARS" => '032',
34
- "AUD" => '036',
35
- "AWG" => '533',
36
- "AZN" => '944',
37
- "BAM" => '977',
38
- "BBD" => '052',
39
- "BDT" => '050',
40
- "BGN" => '975',
41
- "BHD" => '048',
42
- "BIF" => '108',
43
- "BMD" => '060',
44
- "BND" => '096',
45
- "BOB" => '068',
46
- "BOV" => '984',
47
- "BRL" => '986',
48
- "BSD" => '044',
49
- "BTN" => '064',
50
- "BWP" => '072',
51
- "BYR" => '974',
52
- "BZD" => '084',
53
- "CAD" => '124',
54
- "CDF" => '976',
55
- "CHE" => '947',
56
- "CHF" => '756',
57
- "CHW" => '948',
58
- "CLF" => '990',
59
- "CLP" => '152',
60
- "CNY" => '156',
61
- "COP" => '170',
62
- "COU" => '970',
63
- "CRC" => '188',
64
- "CUP" => '192',
65
- "CVE" => '132',
66
- "CYP" => '196',
67
- "CZK" => '203',
68
- "DJF" => '262',
69
- "DKK" => '208',
70
- "DOP" => '214',
71
- "DZD" => '012',
72
- "EEK" => '233',
73
- "EGP" => '818',
74
- "ERN" => '232',
75
- "ETB" => '230',
76
- "EUR" => '978',
77
- "FJD" => '242',
78
- "FKP" => '238',
79
- "GBP" => '826',
80
- "GEL" => '981',
81
- "GHS" => '288',
82
- "GIP" => '292',
83
- "GMD" => '270',
84
- "GNF" => '324',
85
- "GTQ" => '320',
86
- "GYD" => '328',
87
- "HKD" => '344',
88
- "HNL" => '340',
89
- "HRK" => '191',
90
- "HTG" => '332',
91
- "HUF" => '348',
92
- "IDR" => '360',
93
- "ILS" => '376',
94
- "INR" => '356',
95
- "IQD" => '368',
96
- "IRR" => '364',
97
- "ISK" => '352',
98
- "JMD" => '388',
99
- "JOD" => '400',
100
- "JPY" => '392',
101
- "KES" => '404',
102
- "KGS" => '417',
103
- "KHR" => '116',
104
- "KMF" => '174',
105
- "KPW" => '408',
106
- "KRW" => '410',
107
- "KWD" => '414',
108
- "KYD" => '136',
109
- "KZT" => '398',
110
- "LAK" => '418',
111
- "LBP" => '422',
112
- "LKR" => '144',
113
- "LRD" => '430',
114
- "LSL" => '426',
115
- "LTL" => '440',
116
- "LVL" => '428',
117
- "LYD" => '434',
118
- "MAD" => '504',
119
- "MDL" => '498',
120
- "MGA" => '969',
121
- "MKD" => '807',
122
- "MMK" => '104',
123
- "MNT" => '496',
124
- "MOP" => '446',
125
- "MRO" => '478',
126
- "MTL" => '470',
127
- "MUR" => '480',
128
- "MVR" => '462',
129
- "MWK" => '454',
130
- "MXN" => '484',
131
- "MXV" => '979',
132
- "MYR" => '458',
133
- "MZN" => '943',
134
- "NAD" => '516',
135
- "NGN" => '566',
136
- "NIO" => '558',
137
- "NOK" => '578',
138
- "NPR" => '524',
139
- "NZD" => '554',
140
- "OMR" => '512',
141
- "PAB" => '590',
142
- "PEN" => '604',
143
- "PGK" => '598',
144
- "PHP" => '608',
145
- "PKR" => '586',
146
- "PLN" => '985',
147
- "PYG" => '600',
148
- "QAR" => '634',
149
- "ROL" => '642',
150
- "RON" => '946',
151
- "RSD" => '941',
152
- "RUB" => '643',
153
- "RWF" => '646',
154
- "SAR" => '682',
155
- "SBD" => '090',
156
- "SCR" => '690',
157
- "SDG" => '938',
158
- "SEK" => '752',
159
- "SGD" => '702',
160
- "SHP" => '654',
161
- "SKK" => '703',
162
- "SLL" => '694',
163
- "SOS" => '706',
164
- "SRD" => '968',
165
- "STD" => '678',
166
- "SYP" => '760',
167
- "SZL" => '748',
168
- "THB" => '764',
169
- "TJS" => '972',
170
- "TMM" => '795',
171
- "TND" => '788',
172
- "TOP" => '776',
173
- "TRY" => '949',
174
- "TTD" => '780',
175
- "TWD" => '901',
176
- "TZS" => '834',
177
- "UAH" => '980',
178
- "UGX" => '800',
179
- "USD" => '840',
180
- "USN" => '997',
181
- "USS" => '998',
182
- "UYU" => '858',
183
- "UZS" => '860',
184
- "VEB" => '862',
185
- "VND" => '704',
186
- "VUV" => '548',
187
- "WST" => '882',
188
- "XAF" => '950',
189
- "XAG" => '961',
190
- "XAU" => '959',
191
- "XBA" => '955',
192
- "XBB" => '956',
193
- "XBC" => '957',
194
- "XBD" => '958',
195
- "XCD" => '951',
196
- "XDR" => '960',
197
- "XOF" => '952',
198
- "XPD" => '964',
199
- "XPF" => '953',
200
- "XPT" => '962',
201
- "XTS" => '963',
202
- "XXX" => '999',
203
- "YER" => '886',
204
- "ZAR" => '710',
205
- "ZMK" => '894',
206
- "ZWD" => '716',
27
+ 'AED' => '784',
28
+ 'AFN' => '971',
29
+ 'ALL' => '008',
30
+ 'AMD' => '051',
31
+ 'ANG' => '532',
32
+ 'AOA' => '973',
33
+ 'ARS' => '032',
34
+ 'AUD' => '036',
35
+ 'AWG' => '533',
36
+ 'AZN' => '944',
37
+ 'BAM' => '977',
38
+ 'BBD' => '052',
39
+ 'BDT' => '050',
40
+ 'BGN' => '975',
41
+ 'BHD' => '048',
42
+ 'BIF' => '108',
43
+ 'BMD' => '060',
44
+ 'BND' => '096',
45
+ 'BOB' => '068',
46
+ 'BOV' => '984',
47
+ 'BRL' => '986',
48
+ 'BSD' => '044',
49
+ 'BTN' => '064',
50
+ 'BWP' => '072',
51
+ 'BYR' => '974',
52
+ 'BZD' => '084',
53
+ 'CAD' => '124',
54
+ 'CDF' => '976',
55
+ 'CHE' => '947',
56
+ 'CHF' => '756',
57
+ 'CHW' => '948',
58
+ 'CLF' => '990',
59
+ 'CLP' => '152',
60
+ 'CNY' => '156',
61
+ 'COP' => '170',
62
+ 'COU' => '970',
63
+ 'CRC' => '188',
64
+ 'CUP' => '192',
65
+ 'CVE' => '132',
66
+ 'CYP' => '196',
67
+ 'CZK' => '203',
68
+ 'DJF' => '262',
69
+ 'DKK' => '208',
70
+ 'DOP' => '214',
71
+ 'DZD' => '012',
72
+ 'EEK' => '233',
73
+ 'EGP' => '818',
74
+ 'ERN' => '232',
75
+ 'ETB' => '230',
76
+ 'EUR' => '978',
77
+ 'FJD' => '242',
78
+ 'FKP' => '238',
79
+ 'GBP' => '826',
80
+ 'GEL' => '981',
81
+ 'GHS' => '288',
82
+ 'GIP' => '292',
83
+ 'GMD' => '270',
84
+ 'GNF' => '324',
85
+ 'GTQ' => '320',
86
+ 'GYD' => '328',
87
+ 'HKD' => '344',
88
+ 'HNL' => '340',
89
+ 'HRK' => '191',
90
+ 'HTG' => '332',
91
+ 'HUF' => '348',
92
+ 'IDR' => '360',
93
+ 'ILS' => '376',
94
+ 'INR' => '356',
95
+ 'IQD' => '368',
96
+ 'IRR' => '364',
97
+ 'ISK' => '352',
98
+ 'JMD' => '388',
99
+ 'JOD' => '400',
100
+ 'JPY' => '392',
101
+ 'KES' => '404',
102
+ 'KGS' => '417',
103
+ 'KHR' => '116',
104
+ 'KMF' => '174',
105
+ 'KPW' => '408',
106
+ 'KRW' => '410',
107
+ 'KWD' => '414',
108
+ 'KYD' => '136',
109
+ 'KZT' => '398',
110
+ 'LAK' => '418',
111
+ 'LBP' => '422',
112
+ 'LKR' => '144',
113
+ 'LRD' => '430',
114
+ 'LSL' => '426',
115
+ 'LTL' => '440',
116
+ 'LVL' => '428',
117
+ 'LYD' => '434',
118
+ 'MAD' => '504',
119
+ 'MDL' => '498',
120
+ 'MGA' => '969',
121
+ 'MKD' => '807',
122
+ 'MMK' => '104',
123
+ 'MNT' => '496',
124
+ 'MOP' => '446',
125
+ 'MRO' => '478',
126
+ 'MTL' => '470',
127
+ 'MUR' => '480',
128
+ 'MVR' => '462',
129
+ 'MWK' => '454',
130
+ 'MXN' => '484',
131
+ 'MXV' => '979',
132
+ 'MYR' => '458',
133
+ 'MZN' => '943',
134
+ 'NAD' => '516',
135
+ 'NGN' => '566',
136
+ 'NIO' => '558',
137
+ 'NOK' => '578',
138
+ 'NPR' => '524',
139
+ 'NZD' => '554',
140
+ 'OMR' => '512',
141
+ 'PAB' => '590',
142
+ 'PEN' => '604',
143
+ 'PGK' => '598',
144
+ 'PHP' => '608',
145
+ 'PKR' => '586',
146
+ 'PLN' => '985',
147
+ 'PYG' => '600',
148
+ 'QAR' => '634',
149
+ 'ROL' => '642',
150
+ 'RON' => '946',
151
+ 'RSD' => '941',
152
+ 'RUB' => '643',
153
+ 'RWF' => '646',
154
+ 'SAR' => '682',
155
+ 'SBD' => '090',
156
+ 'SCR' => '690',
157
+ 'SDG' => '938',
158
+ 'SEK' => '752',
159
+ 'SGD' => '702',
160
+ 'SHP' => '654',
161
+ 'SKK' => '703',
162
+ 'SLL' => '694',
163
+ 'SOS' => '706',
164
+ 'SRD' => '968',
165
+ 'STD' => '678',
166
+ 'SYP' => '760',
167
+ 'SZL' => '748',
168
+ 'THB' => '764',
169
+ 'TJS' => '972',
170
+ 'TMM' => '795',
171
+ 'TND' => '788',
172
+ 'TOP' => '776',
173
+ 'TRY' => '949',
174
+ 'TTD' => '780',
175
+ 'TWD' => '901',
176
+ 'TZS' => '834',
177
+ 'UAH' => '980',
178
+ 'UGX' => '800',
179
+ 'USD' => '840',
180
+ 'USN' => '997',
181
+ 'USS' => '998',
182
+ 'UYU' => '858',
183
+ 'UZS' => '860',
184
+ 'VEB' => '862',
185
+ 'VND' => '704',
186
+ 'VUV' => '548',
187
+ 'WST' => '882',
188
+ 'XAF' => '950',
189
+ 'XAG' => '961',
190
+ 'XAU' => '959',
191
+ 'XBA' => '955',
192
+ 'XBB' => '956',
193
+ 'XBC' => '957',
194
+ 'XBD' => '958',
195
+ 'XCD' => '951',
196
+ 'XDR' => '960',
197
+ 'XOF' => '952',
198
+ 'XPD' => '964',
199
+ 'XPF' => '953',
200
+ 'XPT' => '962',
201
+ 'XTS' => '963',
202
+ 'XXX' => '999',
203
+ 'YER' => '886',
204
+ 'ZAR' => '710',
205
+ 'ZMK' => '894',
206
+ 'ZWD' => '716',
207
207
  }
208
208
 
209
209
  AVS_CODE = {
210
- "PASSED" => "Y",
211
- "FAILED" => "N",
212
- "PARTIAL" => "X",
213
- "NOT_CHECKED" => "X",
214
- "UNKNOWN" => "X"
210
+ 'PASSED' => 'Y',
211
+ 'FAILED' => 'N',
212
+ 'PARTIAL' => 'X',
213
+ 'NOT_CHECKED' => 'X',
214
+ 'UNKNOWN' => 'X'
215
215
  }
216
216
 
217
217
  CVV_CODE = {
218
- "PASSED" => "M",
219
- "FAILED" => "N",
220
- "PARTIAL" => "I",
221
- "NOT_CHECKED" => "P",
222
- "UNKNOWN" => "U"
218
+ 'PASSED' => 'M',
219
+ 'FAILED' => 'N',
220
+ 'PARTIAL' => 'I',
221
+ 'NOT_CHECKED' => 'P',
222
+ 'UNKNOWN' => 'U'
223
223
  }
224
224
 
225
225
  def initialize(options = {})
@@ -288,7 +288,7 @@ module ActiveMerchant #:nodoc:
288
288
 
289
289
  def build_reference_request(type, money, authorization, options)
290
290
  options.merge!(:action => 'CrossReferenceTransaction')
291
- order_id, cross_reference, _ = authorization.split(";")
291
+ order_id, cross_reference, _ = authorization.split(';')
292
292
  build_request(options) do |xml|
293
293
  if money
294
294
  details = {'CurrencyCode' => currency_code(options[:currency] || default_currency), 'Amount' => amount(money)}
@@ -310,7 +310,7 @@ module ActiveMerchant #:nodoc:
310
310
  'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
311
311
  'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema'} do
312
312
  xml.tag! 'soap:Body' do
313
- xml.tag! options[:action], {'xmlns' => "https://www.thepaymentgateway.net/"} do
313
+ xml.tag! options[:action], {'xmlns' => 'https://www.thepaymentgateway.net/'} do
314
314
  xml.tag! 'PaymentMessage' do
315
315
  add_merchant_data(xml, options)
316
316
  yield(xml)
@@ -357,7 +357,7 @@ module ActiveMerchant #:nodoc:
357
357
  end
358
358
 
359
359
  xml.tag! 'EmailAddress', options[:email]
360
- xml.tag! 'CustomerIPAddress', options[:ip] || "127.0.0.1"
360
+ xml.tag! 'CustomerIPAddress', options[:ip] || '127.0.0.1'
361
361
  end
362
362
  end
363
363
 
@@ -366,23 +366,23 @@ module ActiveMerchant #:nodoc:
366
366
  xml.tag! 'CardName', creditcard.name
367
367
  xml.tag! 'CV2', creditcard.verification_value if creditcard.verification_value
368
368
  xml.tag! 'CardNumber', creditcard.number
369
- xml.tag! 'ExpiryDate', { 'Month' => creditcard.month.to_s.rjust(2, "0"), 'Year' => creditcard.year.to_s[/\d\d$/] }
369
+ xml.tag! 'ExpiryDate', { 'Month' => creditcard.month.to_s.rjust(2, '0'), 'Year' => creditcard.year.to_s[/\d\d$/] }
370
370
  end
371
371
  end
372
372
 
373
373
  def add_merchant_data(xml, options)
374
- xml.tag! 'MerchantAuthentication', {"MerchantID" => @options[:login], "Password" => @options[:password]}
374
+ xml.tag! 'MerchantAuthentication', {'MerchantID' => @options[:login], 'Password' => @options[:password]}
375
375
  end
376
376
 
377
377
  def commit(request, options)
378
378
  requires!(options, :action)
379
379
  response = parse(ssl_post(test? ? self.test_url : self.live_url, request,
380
- {"SOAPAction" => "https://www.thepaymentgateway.net/" + options[:action],
381
- "Content-Type" => "text/xml; charset=utf-8" }))
380
+ {'SOAPAction' => 'https://www.thepaymentgateway.net/' + options[:action],
381
+ 'Content-Type' => 'text/xml; charset=utf-8' }))
382
382
 
383
- success = response[:transaction_result][:status_code] == "0"
383
+ success = response[:transaction_result][:status_code] == '0'
384
384
  message = response[:transaction_result][:message]
385
- authorization = success ? [ options[:order_id], response[:transaction_output_data][:cross_reference], response[:transaction_output_data][:auth_code] ].compact.join(";") : nil
385
+ authorization = success ? [ options[:order_id], response[:transaction_output_data][:cross_reference], response[:transaction_output_data][:auth_code] ].compact.join(';') : nil
386
386
 
387
387
  Response.new(success, message, response,
388
388
  :test => test?,
@@ -398,8 +398,8 @@ module ActiveMerchant #:nodoc:
398
398
  def parse(xml)
399
399
  reply = {}
400
400
  xml = REXML::Document.new(xml)
401
- if (root = REXML::XPath.first(xml, "//CardDetailsTransactionResponse")) or
402
- (root = REXML::XPath.first(xml, "//CrossReferenceTransactionResponse"))
401
+ if (root = REXML::XPath.first(xml, '//CardDetailsTransactionResponse')) or
402
+ (root = REXML::XPath.first(xml, '//CrossReferenceTransactionResponse'))
403
403
  root.elements.to_a.each do |node|
404
404
  case node.name
405
405
  when 'Message'
@@ -408,7 +408,7 @@ module ActiveMerchant #:nodoc:
408
408
  parse_element(reply, node)
409
409
  end
410
410
  end
411
- elsif root = REXML::XPath.first(xml, "//soap:Fault")
411
+ elsif root = REXML::XPath.first(xml, '//soap:Fault')
412
412
  parse_element(reply, root)
413
413
  reply[:message] = "#{reply[:faultcode]}: #{reply[:faultstring]}"
414
414
  end
@@ -417,29 +417,29 @@ module ActiveMerchant #:nodoc:
417
417
 
418
418
  def parse_element(reply, node)
419
419
  case node.name
420
- when "CrossReferenceTransactionResult"
420
+ when 'CrossReferenceTransactionResult'
421
421
  reply[:transaction_result] = {}
422
422
  node.attributes.each do |a,b|
423
423
  reply[:transaction_result][a.underscore.to_sym] = b
424
424
  end
425
425
  node.elements.each{|e| parse_element(reply[:transaction_result], e) } if node.has_elements?
426
426
 
427
- when "CardDetailsTransactionResult"
427
+ when 'CardDetailsTransactionResult'
428
428
  reply[:transaction_result] = {}
429
429
  node.attributes.each do |a,b|
430
430
  reply[:transaction_result][a.underscore.to_sym] = b
431
431
  end
432
432
  node.elements.each{|e| parse_element(reply[:transaction_result], e) } if node.has_elements?
433
433
 
434
- when "TransactionOutputData"
434
+ when 'TransactionOutputData'
435
435
  reply[:transaction_output_data] = {}
436
436
  node.attributes.each{|a,b| reply[:transaction_output_data][a.underscore.to_sym] = b }
437
437
  node.elements.each{|e| parse_element(reply[:transaction_output_data], e) } if node.has_elements?
438
- when "CustomVariables"
438
+ when 'CustomVariables'
439
439
  reply[:custom_variables] = {}
440
440
  node.attributes.each{|a,b| reply[:custom_variables][a.underscore.to_sym] = b }
441
441
  node.elements.each{|e| parse_element(reply[:custom_variables], e) } if node.has_elements?
442
- when "GatewayEntryPoints"
442
+ when 'GatewayEntryPoints'
443
443
  reply[:gateway_entry_points] = {}
444
444
  node.attributes.each{|a,b| reply[:gateway_entry_points][a.underscore.to_sym] = b }
445
445
  node.elements.each{|e| parse_element(reply[:gateway_entry_points], e) } if node.has_elements?