activemerchant 1.105.0 → 1.107.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +99 -1
  3. data/README.md +2 -2
  4. data/lib/active_merchant/billing/credit_card_methods.rb +12 -3
  5. data/lib/active_merchant/billing/gateway.rb +22 -22
  6. data/lib/active_merchant/billing/gateways/adyen.rb +18 -7
  7. data/lib/active_merchant/billing/gateways/allied_wallet.rb +2 -2
  8. data/lib/active_merchant/billing/gateways/authorize_net.rb +19 -19
  9. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +11 -11
  10. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +35 -35
  11. data/lib/active_merchant/billing/gateways/axcessms.rb +3 -3
  12. data/lib/active_merchant/billing/gateways/bambora_apac.rb +1 -1
  13. data/lib/active_merchant/billing/gateways/bank_frick.rb +1 -1
  14. data/lib/active_merchant/billing/gateways/banwire.rb +2 -2
  15. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +5 -5
  16. data/lib/active_merchant/billing/gateways/be2bill.rb +4 -4
  17. data/lib/active_merchant/billing/gateways/beanstream.rb +1 -1
  18. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +27 -27
  19. data/lib/active_merchant/billing/gateways/beanstream_interac.rb +1 -1
  20. data/lib/active_merchant/billing/gateways/blue_pay.rb +8 -8
  21. data/lib/active_merchant/billing/gateways/blue_snap.rb +5 -2
  22. data/lib/active_merchant/billing/gateways/bogus.rb +20 -20
  23. data/lib/active_merchant/billing/gateways/borgun.rb +17 -6
  24. data/lib/active_merchant/billing/gateways/bpoint.rb +1 -1
  25. data/lib/active_merchant/billing/gateways/braintree_blue.rb +81 -77
  26. data/lib/active_merchant/billing/gateways/bridge_pay.rb +3 -3
  27. data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
  28. data/lib/active_merchant/billing/gateways/card_stream.rb +19 -19
  29. data/lib/active_merchant/billing/gateways/cc5.rb +7 -7
  30. data/lib/active_merchant/billing/gateways/cecabank.rb +3 -3
  31. data/lib/active_merchant/billing/gateways/cenpos.rb +3 -3
  32. data/lib/active_merchant/billing/gateways/checkout_v2.rb +20 -9
  33. data/lib/active_merchant/billing/gateways/clearhaus.rb +1 -1
  34. data/lib/active_merchant/billing/gateways/commercegate.rb +2 -2
  35. data/lib/active_merchant/billing/gateways/conekta.rb +1 -1
  36. data/lib/active_merchant/billing/gateways/creditcall.rb +4 -4
  37. data/lib/active_merchant/billing/gateways/ct_payment.rb +1 -1
  38. data/lib/active_merchant/billing/gateways/culqi.rb +2 -2
  39. data/lib/active_merchant/billing/gateways/cyber_source.rb +154 -91
  40. data/lib/active_merchant/billing/gateways/d_local.rb +4 -2
  41. data/lib/active_merchant/billing/gateways/data_cash.rb +33 -33
  42. data/lib/active_merchant/billing/gateways/decidir.rb +7 -2
  43. data/lib/active_merchant/billing/gateways/ebanx.rb +14 -2
  44. data/lib/active_merchant/billing/gateways/efsnet.rb +23 -23
  45. data/lib/active_merchant/billing/gateways/elavon.rb +70 -18
  46. data/lib/active_merchant/billing/gateways/element.rb +12 -4
  47. data/lib/active_merchant/billing/gateways/epay.rb +40 -40
  48. data/lib/active_merchant/billing/gateways/evo_ca.rb +11 -11
  49. data/lib/active_merchant/billing/gateways/eway.rb +3 -3
  50. data/lib/active_merchant/billing/gateways/eway_managed.rb +40 -40
  51. data/lib/active_merchant/billing/gateways/eway_rapid.rb +7 -7
  52. data/lib/active_merchant/billing/gateways/exact.rb +11 -11
  53. data/lib/active_merchant/billing/gateways/fat_zebra.rb +3 -2
  54. data/lib/active_merchant/billing/gateways/federated_canada.rb +5 -5
  55. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +21 -21
  56. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +20 -20
  57. data/lib/active_merchant/billing/gateways/flo2cash.rb +4 -4
  58. data/lib/active_merchant/billing/gateways/forte.rb +8 -7
  59. data/lib/active_merchant/billing/gateways/garanti.rb +8 -8
  60. data/lib/active_merchant/billing/gateways/global_collect.rb +30 -24
  61. data/lib/active_merchant/billing/gateways/hdfc.rb +3 -3
  62. data/lib/active_merchant/billing/gateways/hps.rb +5 -3
  63. data/lib/active_merchant/billing/gateways/iats_payments.rb +32 -15
  64. data/lib/active_merchant/billing/gateways/inspire.rb +7 -7
  65. data/lib/active_merchant/billing/gateways/instapay.rb +3 -3
  66. data/lib/active_merchant/billing/gateways/ipp.rb +1 -1
  67. data/lib/active_merchant/billing/gateways/iridium.rb +12 -10
  68. data/lib/active_merchant/billing/gateways/itransact.rb +7 -7
  69. data/lib/active_merchant/billing/gateways/iveri.rb +6 -3
  70. data/lib/active_merchant/billing/gateways/ixopay.rb +22 -0
  71. data/lib/active_merchant/billing/gateways/jetpay.rb +4 -4
  72. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +5 -5
  73. data/lib/active_merchant/billing/gateways/kushki.rb +34 -5
  74. data/lib/active_merchant/billing/gateways/latitude19.rb +2 -2
  75. data/lib/active_merchant/billing/gateways/linkpoint.rb +62 -62
  76. data/lib/active_merchant/billing/gateways/litle.rb +8 -3
  77. data/lib/active_merchant/billing/gateways/mastercard.rb +2 -2
  78. data/lib/active_merchant/billing/gateways/mercado_pago.rb +1 -0
  79. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +5 -5
  80. data/lib/active_merchant/billing/gateways/merchant_one.rb +2 -2
  81. data/lib/active_merchant/billing/gateways/merchant_partners.rb +4 -4
  82. data/lib/active_merchant/billing/gateways/merchant_ware.rb +12 -12
  83. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +11 -11
  84. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +12 -2
  85. data/lib/active_merchant/billing/gateways/mercury.rb +9 -9
  86. data/lib/active_merchant/billing/gateways/metrics_global.rb +15 -15
  87. data/lib/active_merchant/billing/gateways/migs.rb +13 -13
  88. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +7 -7
  89. data/lib/active_merchant/billing/gateways/monei.rb +19 -19
  90. data/lib/active_merchant/billing/gateways/moneris.rb +10 -10
  91. data/lib/active_merchant/billing/gateways/money_movers.rb +5 -5
  92. data/lib/active_merchant/billing/gateways/mundipagg.rb +1 -1
  93. data/lib/active_merchant/billing/gateways/nab_transact.rb +15 -15
  94. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +1 -1
  95. data/lib/active_merchant/billing/gateways/net_registry.rb +6 -6
  96. data/lib/active_merchant/billing/gateways/netaxept.rb +4 -4
  97. data/lib/active_merchant/billing/gateways/netbanx.rb +14 -14
  98. data/lib/active_merchant/billing/gateways/netbilling.rb +12 -12
  99. data/lib/active_merchant/billing/gateways/netpay.rb +2 -2
  100. data/lib/active_merchant/billing/gateways/network_merchants.rb +5 -5
  101. data/lib/active_merchant/billing/gateways/ogone.rb +7 -7
  102. data/lib/active_merchant/billing/gateways/openpay.rb +2 -2
  103. data/lib/active_merchant/billing/gateways/opp.rb +13 -7
  104. data/lib/active_merchant/billing/gateways/optimal_payment.rb +13 -9
  105. data/lib/active_merchant/billing/gateways/orbital.rb +54 -12
  106. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +7 -7
  107. data/lib/active_merchant/billing/gateways/pay_conex.rb +2 -2
  108. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +16 -16
  109. data/lib/active_merchant/billing/gateways/pay_junction.rb +16 -16
  110. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +18 -2
  111. data/lib/active_merchant/billing/gateways/pay_secure.rb +6 -6
  112. data/lib/active_merchant/billing/gateways/paybox_direct.rb +36 -36
  113. data/lib/active_merchant/billing/gateways/payflow.rb +7 -7
  114. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +12 -12
  115. data/lib/active_merchant/billing/gateways/payflow_express.rb +4 -4
  116. data/lib/active_merchant/billing/gateways/payment_express.rb +9 -9
  117. data/lib/active_merchant/billing/gateways/paymill.rb +3 -3
  118. data/lib/active_merchant/billing/gateways/paypal.rb +1 -1
  119. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +5 -5
  120. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
  121. data/lib/active_merchant/billing/gateways/payscout.rb +5 -5
  122. data/lib/active_merchant/billing/gateways/paystation.rb +2 -2
  123. data/lib/active_merchant/billing/gateways/payu_latam.rb +3 -3
  124. data/lib/active_merchant/billing/gateways/payway.rb +12 -12
  125. data/lib/active_merchant/billing/gateways/pin.rb +16 -16
  126. data/lib/active_merchant/billing/gateways/plugnpay.rb +10 -10
  127. data/lib/active_merchant/billing/gateways/psigate.rb +26 -26
  128. data/lib/active_merchant/billing/gateways/psl_card.rb +4 -4
  129. data/lib/active_merchant/billing/gateways/qbms.rb +23 -23
  130. data/lib/active_merchant/billing/gateways/quantum.rb +4 -4
  131. data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +95 -95
  132. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +9 -9
  133. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +2 -2
  134. data/lib/active_merchant/billing/gateways/qvalent.rb +1 -1
  135. data/lib/active_merchant/billing/gateways/realex.rb +17 -10
  136. data/lib/active_merchant/billing/gateways/redsys.rb +24 -16
  137. data/lib/active_merchant/billing/gateways/safe_charge.rb +1 -1
  138. data/lib/active_merchant/billing/gateways/sage.rb +10 -10
  139. data/lib/active_merchant/billing/gateways/sage_pay.rb +35 -35
  140. data/lib/active_merchant/billing/gateways/sallie_mae.rb +2 -2
  141. data/lib/active_merchant/billing/gateways/secure_net.rb +9 -9
  142. data/lib/active_merchant/billing/gateways/secure_pay.rb +13 -13
  143. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +16 -16
  144. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +2 -2
  145. data/lib/active_merchant/billing/gateways/skip_jack.rb +8 -8
  146. data/lib/active_merchant/billing/gateways/smart_ps.rb +16 -16
  147. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +6 -6
  148. data/lib/active_merchant/billing/gateways/spreedly_core.rb +4 -4
  149. data/lib/active_merchant/billing/gateways/stripe.rb +15 -10
  150. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +50 -9
  151. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +2 -2
  152. data/lib/active_merchant/billing/gateways/trans_first.rb +4 -4
  153. data/lib/active_merchant/billing/gateways/trust_commerce.rb +19 -19
  154. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +110 -110
  155. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +29 -29
  156. data/lib/active_merchant/billing/gateways/verifi.rb +10 -10
  157. data/lib/active_merchant/billing/gateways/viaklix.rb +6 -6
  158. data/lib/active_merchant/billing/gateways/visanet_peru.rb +6 -6
  159. data/lib/active_merchant/billing/gateways/webpay.rb +2 -2
  160. data/lib/active_merchant/billing/gateways/wirecard.rb +6 -6
  161. data/lib/active_merchant/billing/gateways/worldpay.rb +22 -20
  162. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +32 -32
  163. data/lib/active_merchant/billing/gateways/worldpay_us.rb +2 -2
  164. data/lib/active_merchant/billing/network_tokenization_credit_card.rb +1 -1
  165. data/lib/active_merchant/connection.rb +1 -1
  166. data/lib/active_merchant/network_connection_retries.rb +3 -3
  167. data/lib/active_merchant/post_data.rb +1 -1
  168. data/lib/active_merchant/version.rb +1 -1
  169. data/lib/certs/cacert.pem +75 -0
  170. data/lib/support/ssl_verify.rb +2 -2
  171. data/lib/support/ssl_version.rb +2 -2
  172. metadata +4 -4
  173. data/lib/active_merchant/billing/gateways/moneris_us.rb +0 -352
@@ -111,10 +111,18 @@ module ActiveMerchant #:nodoc:
111
111
  end
112
112
 
113
113
  def verify(credit_card, options={})
114
- MultiResponse.run(:use_first_response) do |r|
115
- r.process { authorize(100, credit_card, options) }
116
- r.process(:ignore_result) { void(r.authorization, options) }
114
+ request = build_soap_request do |xml|
115
+ xml.CreditCardAVSOnly(xmlns: 'https://transaction.elementexpress.com') do
116
+ add_credentials(xml)
117
+ add_payment_method(xml, credit_card)
118
+ add_transaction(xml, 0, options)
119
+ add_terminal(xml, options)
120
+ add_address(xml, options)
121
+ end
117
122
  end
123
+
124
+ # send request with the transaction amount set to 0
125
+ commit('CreditCardAVSOnly', request, 0)
118
126
  end
119
127
 
120
128
  def supports_scrubbing?
@@ -186,7 +194,7 @@ module ActiveMerchant #:nodoc:
186
194
  def add_terminal(xml, options)
187
195
  xml.terminal do
188
196
  xml.TerminalID '01'
189
- xml.CardPresentCode 'UseDefault'
197
+ xml.CardPresentCode options[:card_present_code] || 'UseDefault'
190
198
  xml.CardholderPresentCode 'UseDefault'
191
199
  xml.CardInputCode 'UseDefault'
192
200
  xml.CVVPresenceCode 'UseDefault'
@@ -12,41 +12,41 @@ module ActiveMerchant #:nodoc:
12
12
  self.display_name = 'ePay'
13
13
 
14
14
  CURRENCY_CODES = {
15
- :ADP => '020', :AED => '784', :AFA => '004', :ALL => '008', :AMD => '051',
16
- :ANG => '532', :AOA => '973', :ARS => '032', :AUD => '036', :AWG => '533',
17
- :AZM => '031', :BAM => '977', :BBD => '052', :BDT => '050', :BGL => '100',
18
- :BGN => '975', :BHD => '048', :BIF => '108', :BMD => '060', :BND => '096',
19
- :BOB => '068', :BOV => '984', :BRL => '986', :BSD => '044', :BTN => '064',
20
- :BWP => '072', :BYR => '974', :BZD => '084', :CAD => '124', :CDF => '976',
21
- :CHF => '756', :CLF => '990', :CLP => '152', :CNY => '156', :COP => '170',
22
- :CRC => '188', :CUP => '192', :CVE => '132', :CYP => '196', :CZK => '203',
23
- :DJF => '262', :DKK => '208', :DOP => '214', :DZD => '012', :ECS => '218',
24
- :ECV => '983', :EEK => '233', :EGP => '818', :ERN => '232', :ETB => '230',
25
- :EUR => '978', :FJD => '242', :FKP => '238', :GBP => '826', :GEL => '981',
26
- :GHC => '288', :GIP => '292', :GMD => '270', :GNF => '324', :GTQ => '320',
27
- :GWP => '624', :GYD => '328', :HKD => '344', :HNL => '340', :HRK => '191',
28
- :HTG => '332', :HUF => '348', :IDR => '360', :ILS => '376', :INR => '356',
29
- :IQD => '368', :IRR => '364', :ISK => '352', :JMD => '388', :JOD => '400',
30
- :JPY => '392', :KES => '404', :KGS => '417', :KHR => '116', :KMF => '174',
31
- :KPW => '408', :KRW => '410', :KWD => '414', :KYD => '136', :KZT => '398',
32
- :LAK => '418', :LBP => '422', :LKR => '144', :LRD => '430', :LSL => '426',
33
- :LTL => '440', :LVL => '428', :LYD => '434', :MAD => '504', :MDL => '498',
34
- :MGF => '450', :MKD => '807', :MMK => '104', :MNT => '496', :MOP => '446',
35
- :MRO => '478', :MTL => '470', :MUR => '480', :MVR => '462', :MWK => '454',
36
- :MXN => '484', :MXV => '979', :MYR => '458', :MZM => '508', :NAD => '516',
37
- :NGN => '566', :NIO => '558', :NOK => '578', :NPR => '524', :NZD => '554',
38
- :OMR => '512', :PAB => '590', :PEN => '604', :PGK => '598', :PHP => '608',
39
- :PKR => '586', :PLN => '985', :PYG => '600', :QAR => '634', :ROL => '642',
40
- :RUB => '643', :RUR => '810', :RWF => '646', :SAR => '682', :SBD => '090',
41
- :SCR => '690', :SDD => '736', :SEK => '752', :SGD => '702', :SHP => '654',
42
- :SIT => '705', :SKK => '703', :SLL => '694', :SOS => '706', :SRG => '740',
43
- :STD => '678', :SVC => '222', :SYP => '760', :SZL => '748', :THB => '764',
44
- :TJS => '972', :TMM => '795', :TND => '788', :TOP => '776', :TPE => '626',
45
- :TRL => '792', :TRY => '949', :TTD => '780', :TWD => '901', :TZS => '834',
46
- :UAH => '980', :UGX => '800', :USD => '840', :UYU => '858', :UZS => '860',
47
- :VEB => '862', :VND => '704', :VUV => '548', :XAF => '950', :XCD => '951',
48
- :XOF => '952', :XPF => '953', :YER => '886', :YUM => '891', :ZAR => '710',
49
- :ZMK => '894', :ZWD => '716'
15
+ ADP: '020', AED: '784', AFA: '004', ALL: '008', AMD: '051',
16
+ ANG: '532', AOA: '973', ARS: '032', AUD: '036', AWG: '533',
17
+ AZM: '031', BAM: '977', BBD: '052', BDT: '050', BGL: '100',
18
+ BGN: '975', BHD: '048', BIF: '108', BMD: '060', BND: '096',
19
+ BOB: '068', BOV: '984', BRL: '986', BSD: '044', BTN: '064',
20
+ BWP: '072', BYR: '974', BZD: '084', CAD: '124', CDF: '976',
21
+ CHF: '756', CLF: '990', CLP: '152', CNY: '156', COP: '170',
22
+ CRC: '188', CUP: '192', CVE: '132', CYP: '196', CZK: '203',
23
+ DJF: '262', DKK: '208', DOP: '214', DZD: '012', ECS: '218',
24
+ ECV: '983', EEK: '233', EGP: '818', ERN: '232', ETB: '230',
25
+ EUR: '978', FJD: '242', FKP: '238', GBP: '826', GEL: '981',
26
+ GHC: '288', GIP: '292', GMD: '270', GNF: '324', GTQ: '320',
27
+ GWP: '624', GYD: '328', HKD: '344', HNL: '340', HRK: '191',
28
+ HTG: '332', HUF: '348', IDR: '360', ILS: '376', INR: '356',
29
+ IQD: '368', IRR: '364', ISK: '352', JMD: '388', JOD: '400',
30
+ JPY: '392', KES: '404', KGS: '417', KHR: '116', KMF: '174',
31
+ KPW: '408', KRW: '410', KWD: '414', KYD: '136', KZT: '398',
32
+ LAK: '418', LBP: '422', LKR: '144', LRD: '430', LSL: '426',
33
+ LTL: '440', LVL: '428', LYD: '434', MAD: '504', MDL: '498',
34
+ MGF: '450', MKD: '807', MMK: '104', MNT: '496', MOP: '446',
35
+ MRO: '478', MTL: '470', MUR: '480', MVR: '462', MWK: '454',
36
+ MXN: '484', MXV: '979', MYR: '458', MZM: '508', NAD: '516',
37
+ NGN: '566', NIO: '558', NOK: '578', NPR: '524', NZD: '554',
38
+ OMR: '512', PAB: '590', PEN: '604', PGK: '598', PHP: '608',
39
+ PKR: '586', PLN: '985', PYG: '600', QAR: '634', ROL: '642',
40
+ RUB: '643', RUR: '810', RWF: '646', SAR: '682', SBD: '090',
41
+ SCR: '690', SDD: '736', SEK: '752', SGD: '702', SHP: '654',
42
+ SIT: '705', SKK: '703', SLL: '694', SOS: '706', SRG: '740',
43
+ STD: '678', SVC: '222', SYP: '760', SZL: '748', THB: '764',
44
+ TJS: '972', TMM: '795', TND: '788', TOP: '776', TPE: '626',
45
+ TRL: '792', TRY: '949', TTD: '780', TWD: '901', TZS: '834',
46
+ UAH: '980', UGX: '800', USD: '840', UYU: '858', UZS: '860',
47
+ VEB: '862', VND: '704', VUV: '548', XAF: '950', XCD: '951',
48
+ XOF: '952', XPF: '953', YER: '886', YUM: '891', ZAR: '710',
49
+ ZMK: '894', ZWD: '716'
50
50
  }
51
51
 
52
52
  # login: merchant number
@@ -177,14 +177,14 @@ module ActiveMerchant #:nodoc:
177
177
  Response.new response['accept'].to_i == 1,
178
178
  response['errortext'],
179
179
  response,
180
- :test => test?,
181
- :authorization => response['tid']
180
+ test: test?,
181
+ authorization: response['tid']
182
182
  else
183
183
  Response.new response['result'] == 'true',
184
184
  messages(response['epay'], response['pbs']),
185
185
  response,
186
- :test => test?,
187
- :authorization => params[:transaction]
186
+ test: test?,
187
+ authorization: params[:transaction]
188
188
  end
189
189
  end
190
190
 
@@ -261,7 +261,7 @@ module ActiveMerchant #:nodoc:
261
261
  end
262
262
 
263
263
  def xml_builder(params, soap_call)
264
- xml = Builder::XmlMarkup.new(:indent => 2)
264
+ xml = Builder::XmlMarkup.new(indent: 2)
265
265
  xml.instruct!
266
266
  xml.tag! 'soap:Envelope', { 'xmlns:xsi' => 'http://schemas.xmlsoap.org/soap/envelope/',
267
267
  'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
@@ -139,8 +139,8 @@ module ActiveMerchant #:nodoc:
139
139
  # <tt>options</tt>.
140
140
  def capture(money, authorization, options = {})
141
141
  post = {
142
- :amount => amount(money),
143
- :transactionid => authorization
142
+ amount: amount(money),
143
+ transactionid: authorization
144
144
  }
145
145
  add_order(post, options)
146
146
  commit('capture', money, post)
@@ -153,7 +153,7 @@ module ActiveMerchant #:nodoc:
153
153
  # The <tt>identification</tt> parameter is the transaction ID, retrieved
154
154
  # from {Response#authorization}.
155
155
  def refund(money, identification)
156
- post = {:transactionid => identification}
156
+ post = {transactionid: identification}
157
157
  commit('refund', money, post)
158
158
  end
159
159
 
@@ -181,7 +181,7 @@ module ActiveMerchant #:nodoc:
181
181
  # The <tt>identification</tt> parameter is the transaction ID, retrieved
182
182
  # from {Response#authorization}.
183
183
  def void(identification)
184
- post = {:transactionid => identification}
184
+ post = {transactionid: identification}
185
185
  commit('void', nil, post)
186
186
  end
187
187
 
@@ -192,7 +192,7 @@ module ActiveMerchant #:nodoc:
192
192
  # The <tt>identification</tt> parameter is the transaction ID, retrieved
193
193
  # from {Response#authorization}.
194
194
  def update(identification, options)
195
- post = {:transactionid => identification}
195
+ post = {transactionid: identification}
196
196
  add_order(post, options)
197
197
  commit('update', nil, post)
198
198
  end
@@ -245,7 +245,7 @@ module ActiveMerchant #:nodoc:
245
245
  end
246
246
 
247
247
  def add_paymentmethod(post, payment)
248
- if card_brand(payment)=='check'
248
+ if card_brand(payment) == 'check'
249
249
  post[:payment] = 'check'
250
250
  post[:checkname] = payment.name
251
251
  post[:checkaba] = payment.routing_number
@@ -280,10 +280,10 @@ module ActiveMerchant #:nodoc:
280
280
  message = message_from(response)
281
281
 
282
282
  Response.new(success?(response), message, response,
283
- :test => test?,
284
- :authorization => response['transactionid'],
285
- :avs_result => { :code => response['avsresponse'] },
286
- :cvv_result => response['cvvresponse']
283
+ test: test?,
284
+ authorization: response['transactionid'],
285
+ avs_result: { code: response['avsresponse'] },
286
+ cvv_result: response['cvvresponse']
287
287
  )
288
288
  end
289
289
 
@@ -292,7 +292,7 @@ module ActiveMerchant #:nodoc:
292
292
  end
293
293
 
294
294
  def post_data(action, parameters = {})
295
- post = {:type => action}
295
+ post = {type: action}
296
296
 
297
297
  if test?
298
298
  post[:username] = 'demo'
@@ -71,7 +71,7 @@ module ActiveMerchant #:nodoc:
71
71
 
72
72
  def add_creditcard(post, creditcard)
73
73
  post[:CardNumber] = creditcard.number
74
- post[:CardExpiryMonth] = sprintf('%.2i', creditcard.month)
74
+ post[:CardExpiryMonth] = sprintf('%.2i', creditcard.month)
75
75
  post[:CardExpiryYear] = sprintf('%.4i', creditcard.year)[-2..-1]
76
76
  post[:CustomerFirstName] = creditcard.first_name
77
77
  post[:CustomerLastName] = creditcard.last_name
@@ -114,8 +114,8 @@ module ActiveMerchant #:nodoc:
114
114
  Response.new(success?(response),
115
115
  message_from(response[:ewaytrxnerror]),
116
116
  response,
117
- :authorization => response[:ewaytrxnnumber],
118
- :test => test?
117
+ authorization: response[:ewaytrxnnumber],
118
+ test: test?
119
119
  )
120
120
  end
121
121
 
@@ -59,7 +59,7 @@ module ActiveMerchant #:nodoc:
59
59
  billing_address = options[:billing_address]
60
60
  eway_requires!(billing_address)
61
61
 
62
- post[:managedCustomerID]=billing_id
62
+ post[:managedCustomerID] = billing_id
63
63
  add_creditcard(post, creditcard)
64
64
  add_address(post, billing_address)
65
65
  add_misc_fields(post, options)
@@ -83,7 +83,7 @@ module ActiveMerchant #:nodoc:
83
83
  def purchase(money, billing_id, options={})
84
84
  post = {}
85
85
  post[:managedCustomerID] = billing_id.to_s
86
- post[:amount]=money
86
+ post[:amount] = money
87
87
  add_invoice(post, options)
88
88
 
89
89
  commit('ProcessPayment', post)
@@ -122,13 +122,13 @@ module ActiveMerchant #:nodoc:
122
122
  end
123
123
 
124
124
  def add_misc_fields(post, options)
125
- post[:CustomerRef]=options[:billing_address][:customer_ref] || options[:customer]
126
- post[:Title]=options[:billing_address][:title]
127
- post[:Company]=options[:billing_address][:company]
128
- post[:JobDesc]=options[:billing_address][:job_desc]
129
- post[:Email]=options[:billing_address][:email] || options[:email]
130
- post[:URL]=options[:billing_address][:url]
131
- post[:Comments]=options[:description]
125
+ post[:CustomerRef] = options[:billing_address][:customer_ref] || options[:customer]
126
+ post[:Title] = options[:billing_address][:title]
127
+ post[:Company] = options[:billing_address][:company]
128
+ post[:JobDesc] = options[:billing_address][:job_desc]
129
+ post[:Email] = options[:billing_address][:email] || options[:email]
130
+ post[:URL] = options[:billing_address][:url]
131
+ post[:Comments] = options[:description]
132
132
  end
133
133
 
134
134
  def add_invoice(post, options)
@@ -139,7 +139,7 @@ module ActiveMerchant #:nodoc:
139
139
  # add credit card details to be stored by eway. NOTE eway requires "title" field
140
140
  def add_creditcard(post, creditcard)
141
141
  post[:CCNumber] = creditcard.number
142
- post[:CCExpiryMonth] = sprintf('%.2i', creditcard.month)
142
+ post[:CCExpiryMonth] = sprintf('%.2i', creditcard.month)
143
143
  post[:CCExpiryYear] = sprintf('%.4i', creditcard.year)[-2..-1]
144
144
  post[:CCNameOnCard] = creditcard.name
145
145
  post[:FirstName] = creditcard.first_name
@@ -150,24 +150,24 @@ module ActiveMerchant #:nodoc:
150
150
  reply = {}
151
151
  xml = REXML::Document.new(body)
152
152
  if root = REXML::XPath.first(xml, '//soap:Fault') then
153
- reply=parse_fault(root)
153
+ reply = parse_fault(root)
154
154
  else
155
155
  if root = REXML::XPath.first(xml, '//ProcessPaymentResponse/ewayResponse') then
156
156
  # Successful payment
157
- reply=parse_purchase(root)
157
+ reply = parse_purchase(root)
158
158
  else
159
159
  if root = REXML::XPath.first(xml, '//QueryCustomerResult') then
160
- reply=parse_query_customer(root)
160
+ reply = parse_query_customer(root)
161
161
  else
162
162
  if root = REXML::XPath.first(xml, '//CreateCustomerResult') then
163
- reply[:message]='OK'
164
- reply[:CreateCustomerResult]=root.text
165
- reply[:success]=true
163
+ reply[:message] = 'OK'
164
+ reply[:CreateCustomerResult] = root.text
165
+ reply[:success] = true
166
166
  else
167
167
  if root = REXML::XPath.first(xml, '//UpdateCustomerResult') then
168
168
  if root.text.casecmp('true').zero? then
169
- reply[:message]='OK'
170
- reply[:success]=true
169
+ reply[:message] = 'OK'
170
+ reply[:success] = true
171
171
  else
172
172
  # ERROR: This state should never occur. If there is a problem,
173
173
  # a soap:Fault will be returned. The presence of this
@@ -187,29 +187,29 @@ module ActiveMerchant #:nodoc:
187
187
  end
188
188
 
189
189
  def parse_fault(node)
190
- reply={}
191
- reply[:message]=REXML::XPath.first(node, '//soap:Reason/soap:Text').text
192
- reply[:success]=false
190
+ reply = {}
191
+ reply[:message] = REXML::XPath.first(node, '//soap:Reason/soap:Text').text
192
+ reply[:success] = false
193
193
  reply
194
194
  end
195
195
 
196
196
  def parse_purchase(node)
197
- reply={}
198
- reply[:message]=REXML::XPath.first(node, '//ewayTrxnError').text
199
- reply[:success]=(REXML::XPath.first(node, '//ewayTrxnStatus').text == 'True')
200
- reply[:auth_code]=REXML::XPath.first(node, '//ewayAuthCode').text
201
- reply[:transaction_number]=REXML::XPath.first(node, '//ewayTrxnNumber').text
197
+ reply = {}
198
+ reply[:message] = REXML::XPath.first(node, '//ewayTrxnError').text
199
+ reply[:success] = (REXML::XPath.first(node, '//ewayTrxnStatus').text == 'True')
200
+ reply[:auth_code] = REXML::XPath.first(node, '//ewayAuthCode').text
201
+ reply[:transaction_number] = REXML::XPath.first(node, '//ewayTrxnNumber').text
202
202
  reply
203
203
  end
204
204
 
205
205
  def parse_query_customer(node)
206
- reply={}
207
- reply[:message]='OK'
208
- reply[:success]=true
209
- reply[:CCNumber]=REXML::XPath.first(node, '//CCNumber').text
210
- reply[:CCName]=REXML::XPath.first(node, '//CCName').text
211
- reply[:CCExpiryMonth]=REXML::XPath.first(node, '//CCExpiryMonth').text
212
- reply[:CCExpiryYear]=REXML::XPath.first(node, '//CCExpiryYear').text
206
+ reply = {}
207
+ reply[:message] = 'OK'
208
+ reply[:success] = true
209
+ reply[:CCNumber] = REXML::XPath.first(node, '//CCNumber').text
210
+ reply[:CCName] = REXML::XPath.first(node, '//CCName').text
211
+ reply[:CCExpiryMonth] = REXML::XPath.first(node, '//CCExpiryMonth').text
212
+ reply[:CCExpiryYear] = REXML::XPath.first(node, '//CCExpiryYear').text
213
213
  reply
214
214
  end
215
215
 
@@ -223,8 +223,8 @@ module ActiveMerchant #:nodoc:
223
223
  response = parse(raw)
224
224
 
225
225
  EwayResponse.new(response[:success], response[:message], response,
226
- :test => test?,
227
- :authorization => response[:auth_code]
226
+ test: test?,
227
+ authorization: response[:auth_code]
228
228
  )
229
229
  end
230
230
 
@@ -242,7 +242,7 @@ module ActiveMerchant #:nodoc:
242
242
  default_customer_fields.merge(arguments)
243
243
  end
244
244
 
245
- xml = Builder::XmlMarkup.new :indent => 2
245
+ xml = Builder::XmlMarkup.new indent: 2
246
246
  xml.instruct!
247
247
  xml.tag! 'soap12:Envelope', {'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema', 'xmlns:soap12' => 'http://www.w3.org/2003/05/soap-envelope'} do
248
248
  xml.tag! 'soap12:Header' do
@@ -264,17 +264,17 @@ module ActiveMerchant #:nodoc:
264
264
  end
265
265
 
266
266
  def default_customer_fields
267
- hash={}
267
+ hash = {}
268
268
  %w(CustomerRef Title FirstName LastName Company JobDesc Email Address Suburb State PostCode Country Phone Mobile Fax URL Comments CCNumber CCNameOnCard CCExpiryMonth CCExpiryYear).each do |field|
269
- hash[field.to_sym]=''
269
+ hash[field.to_sym] = ''
270
270
  end
271
271
  return hash
272
272
  end
273
273
 
274
274
  def default_payment_fields
275
- hash={}
275
+ hash = {}
276
276
  %w(managedCustomerID amount invoiceReference invoiceDescription).each do |field|
277
- hash[field.to_sym]=''
277
+ hash[field.to_sym] = ''
278
278
  end
279
279
  return hash
280
280
  end
@@ -232,7 +232,7 @@ module ActiveMerchant #:nodoc:
232
232
  params[key] = {}
233
233
 
234
234
  add_name_and_email(params[key], options[:shipping_address], options[:email])
235
- add_address(params[key], options[:shipping_address], {:skip_company => true})
235
+ add_address(params[key], options[:shipping_address], {skip_company: true})
236
236
  end
237
237
 
238
238
  def add_name_and_email(params, address, email, payment_method = nil)
@@ -304,13 +304,13 @@ module ActiveMerchant #:nodoc:
304
304
  succeeded,
305
305
  message_from(succeeded, raw),
306
306
  raw,
307
- :authorization => authorization_from(raw),
308
- :test => test?,
309
- :avs_result => avs_result_from(raw),
310
- :cvv_result => cvv_result_from(raw)
307
+ authorization: authorization_from(raw),
308
+ test: test?,
309
+ avs_result: avs_result_from(raw),
310
+ cvv_result: cvv_result_from(raw)
311
311
  )
312
312
  rescue ActiveMerchant::ResponseError => e
313
- return ActiveMerchant::Billing::Response.new(false, e.response.message, {:status_code => e.response.code}, :test => test?)
313
+ return ActiveMerchant::Billing::Response.new(false, e.response.message, {status_code: e.response.code}, test: test?)
314
314
  end
315
315
 
316
316
  def parse(data)
@@ -365,7 +365,7 @@ module ActiveMerchant #:nodoc:
365
365
  else
366
366
  'I'
367
367
  end
368
- {:code => code}
368
+ {code: code}
369
369
  end
370
370
 
371
371
  def cvv_result_from(response)
@@ -5,13 +5,13 @@ module ActiveMerchant #:nodoc:
5
5
 
6
6
  API_VERSION = '8.5'
7
7
 
8
- TEST_LOGINS = [{:login => 'A00049-01', :password => 'test1'},
9
- {:login => 'A00427-01', :password => 'testus'}]
8
+ TEST_LOGINS = [{login: 'A00049-01', password: 'test1'},
9
+ {login: 'A00427-01', password: 'testus'}]
10
10
 
11
- TRANSACTIONS = { :sale => '00',
12
- :authorization => '01',
13
- :capture => '32',
14
- :credit => '34' }
11
+ TRANSACTIONS = { sale: '00',
12
+ authorization: '01',
13
+ capture: '32',
14
+ credit: '34' }
15
15
 
16
16
  ENVELOPE_NAMESPACES = { 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
17
17
  'xmlns:env' => 'http://schemas.xmlsoap.org/soap/envelope/',
@@ -159,15 +159,15 @@ module ActiveMerchant #:nodoc:
159
159
  response = parse(ssl_post(self.live_url, build_request(action, request), POST_HEADERS))
160
160
 
161
161
  Response.new(successful?(response), message_from(response), response,
162
- :test => test?,
163
- :authorization => authorization_from(response),
164
- :avs_result => { :code => response[:avs] },
165
- :cvv_result => response[:cvv2]
162
+ test: test?,
163
+ authorization: authorization_from(response),
164
+ avs_result: { code: response[:avs] },
165
+ cvv_result: response[:cvv2]
166
166
  )
167
167
  rescue ResponseError => e
168
168
  case e.response.code
169
169
  when '401'
170
- return Response.new(false, "Invalid Login: #{e.response.body}", {}, :test => test?)
170
+ return Response.new(false, "Invalid Login: #{e.response.body}", {}, test: test?)
171
171
  else
172
172
  raise
173
173
  end