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
@@ -12,8 +12,8 @@ module ActiveMerchant #:nodoc:
12
12
  # and +refund+ will become mandatory.
13
13
  class MercuryGateway < Gateway
14
14
  URLS = {
15
- :test => 'https://w1.mercurycert.net/ws/ws.asmx',
16
- :live => 'https://w1.mercurypay.com/ws/ws.asmx'
15
+ test: 'https://w1.mercurycert.net/ws/ws.asmx',
16
+ live: 'https://w1.mercurypay.com/ws/ws.asmx'
17
17
  }
18
18
 
19
19
  self.homepage_url = 'http://www.mercurypay.com'
@@ -51,14 +51,14 @@ module ActiveMerchant #:nodoc:
51
51
  def authorize(money, credit_card, options = {})
52
52
  requires!(options, :order_id)
53
53
 
54
- request = build_non_authorized_request('PreAuth', money, credit_card, options.merge(:authorized => money))
54
+ request = build_non_authorized_request('PreAuth', money, credit_card, options.merge(authorized: money))
55
55
  commit('PreAuth', request)
56
56
  end
57
57
 
58
58
  def capture(money, authorization, options = {})
59
59
  requires!(options, :credit_card) unless @use_tokenization
60
60
 
61
- request = build_authorized_request('PreAuthCapture', money, authorization, options[:credit_card], options.merge(:authorized => money))
61
+ request = build_authorized_request('PreAuthCapture', money, authorization, options[:credit_card], options.merge(authorized: money))
62
62
  commit('PreAuthCapture', request)
63
63
  end
64
64
 
@@ -303,11 +303,11 @@ module ActiveMerchant #:nodoc:
303
303
  message = success ? 'Success' : message_from(response)
304
304
 
305
305
  Response.new(success, message, response,
306
- :test => test?,
307
- :authorization => authorization_from(response),
308
- :avs_result => { :code => response[:avs_result] },
309
- :cvv_result => response[:cvv_result],
310
- :error_code => success ? nil : STANDARD_ERROR_CODE_MAPPING[response[:dsix_return_code]])
306
+ test: test?,
307
+ authorization: authorization_from(response),
308
+ avs_result: { code: response[:avs_result] },
309
+ cvv_result: response[:cvv_result],
310
+ error_code: success ? nil : STANDARD_ERROR_CODE_MAPPING[response[:dsix_return_code]])
311
311
  end
312
312
 
313
313
  def message_from(response)
@@ -99,7 +99,7 @@ module ActiveMerchant #:nodoc:
99
99
  # * <tt>money</tt> -- The amount to be captured as an Integer value in cents.
100
100
  # * <tt>authorization</tt> -- The authorization returned from the previous authorize request.
101
101
  def capture(money, authorization, options = {})
102
- post = {:trans_id => authorization}
102
+ post = {trans_id: authorization}
103
103
  add_customer_data(post, options)
104
104
  commit('PRIOR_AUTH_CAPTURE', money, post)
105
105
  end
@@ -110,7 +110,7 @@ module ActiveMerchant #:nodoc:
110
110
  #
111
111
  # * <tt>authorization</tt> - The authorization returned from the previous authorize request.
112
112
  def void(authorization, options = {})
113
- post = {:trans_id => authorization}
113
+ post = {trans_id: authorization}
114
114
  add_duplicate_window(post)
115
115
  commit('VOID', nil, post)
116
116
  end
@@ -135,8 +135,8 @@ module ActiveMerchant #:nodoc:
135
135
  def refund(money, identification, options = {})
136
136
  requires!(options, :card_number)
137
137
 
138
- post = { :trans_id => identification,
139
- :card_num => options[:card_number]}
138
+ post = { trans_id: identification,
139
+ card_num: options[:card_number]}
140
140
 
141
141
  post[:first_name] = options[:first_name] if options[:first_name]
142
142
  post[:last_name] = options[:last_name] if options[:last_name]
@@ -176,11 +176,11 @@ module ActiveMerchant #:nodoc:
176
176
  test_mode = test? || message =~ /TESTMODE/
177
177
 
178
178
  Response.new(success?(response), message, response,
179
- :test => test_mode,
180
- :authorization => response[:transaction_id],
181
- :fraud_review => fraud_review?(response),
182
- :avs_result => { :code => response[:avs_result_code] },
183
- :cvv_result => response[:card_code]
179
+ test: test_mode,
180
+ authorization: response[:transaction_id],
181
+ fraud_review: fraud_review?(response),
182
+ avs_result: { code: response[:avs_result_code] },
183
+ cvv_result: response[:card_code]
184
184
  )
185
185
  end
186
186
 
@@ -196,12 +196,12 @@ module ActiveMerchant #:nodoc:
196
196
  fields = split(body)
197
197
 
198
198
  results = {
199
- :response_code => fields[RESPONSE_CODE].to_i,
200
- :response_reason_code => fields[RESPONSE_REASON_CODE],
201
- :response_reason_text => fields[RESPONSE_REASON_TEXT],
202
- :avs_result_code => fields[AVS_RESULT_CODE],
203
- :transaction_id => fields[TRANSACTION_ID],
204
- :card_code => fields[CARD_CODE_RESPONSE_CODE]
199
+ response_code: fields[RESPONSE_CODE].to_i,
200
+ response_reason_code: fields[RESPONSE_REASON_CODE],
201
+ response_reason_text: fields[RESPONSE_REASON_TEXT],
202
+ avs_result_code: fields[AVS_RESULT_CODE],
203
+ transaction_id: fields[TRANSACTION_ID],
204
+ card_code: fields[CARD_CODE_RESPONSE_CODE]
205
205
  }
206
206
  results
207
207
  end
@@ -79,7 +79,7 @@ module ActiveMerchant #:nodoc:
79
79
  def capture(money, authorization, options = {})
80
80
  requires!(@options, :advanced_login, :advanced_password)
81
81
 
82
- post = options.merge(:TransNo => authorization)
82
+ post = options.merge(TransNo: authorization)
83
83
 
84
84
  add_amount(post, money, options)
85
85
  add_advanced_user(post)
@@ -96,7 +96,7 @@ module ActiveMerchant #:nodoc:
96
96
  def refund(money, authorization, options = {})
97
97
  requires!(@options, :advanced_login, :advanced_password)
98
98
 
99
- post = options.merge(:TransNo => authorization)
99
+ post = options.merge(TransNo: authorization)
100
100
 
101
101
  add_amount(post, money, options)
102
102
  add_advanced_user(post)
@@ -109,7 +109,7 @@ module ActiveMerchant #:nodoc:
109
109
  def void(authorization, options = {})
110
110
  requires!(@options, :advanced_login, :advanced_password)
111
111
 
112
- post = options.merge(:TransNo => authorization)
112
+ post = options.merge(TransNo: authorization)
113
113
 
114
114
  add_advanced_user(post)
115
115
  add_standard_parameters('voidAuthorisation', post, options[:unique_id])
@@ -282,11 +282,11 @@ module ActiveMerchant #:nodoc:
282
282
  cvv_result_code = 'P' if cvv_result_code == 'Unsupported'
283
283
 
284
284
  Response.new(success?(response), response[:Message], response,
285
- :test => test?,
286
- :authorization => response[:TransactionNo],
287
- :fraud_review => fraud_review?(response),
288
- :avs_result => { :code => avs_response_code },
289
- :cvv_result => cvv_result_code
285
+ test: test?,
286
+ authorization: response[:TransactionNo],
287
+ fraud_review: fraud_review?(response),
288
+ avs_result: { code: avs_response_code },
289
+ cvv_result: cvv_result_code
290
290
  )
291
291
  end
292
292
 
@@ -300,11 +300,11 @@ module ActiveMerchant #:nodoc:
300
300
 
301
301
  def add_standard_parameters(action, post, unique_id = nil)
302
302
  post.merge!(
303
- :Version => API_VERSION,
304
- :Merchant => @options[:login],
305
- :AccessCode => @options[:password],
306
- :Command => action,
307
- :MerchTxnRef => unique_id || generate_unique_id.slice(0, 40)
303
+ Version: API_VERSION,
304
+ Merchant: @options[:login],
305
+ AccessCode: @options[:password],
306
+ Command: action,
307
+ MerchTxnRef: unique_id || generate_unique_id.slice(0, 40)
308
308
  )
309
309
  end
310
310
 
@@ -17,8 +17,8 @@ module ActiveMerchant #:nodoc:
17
17
  ERROR_MESSAGE = 'Transaction error'
18
18
 
19
19
  PAYMENT_METHOD = {
20
- :check => 1,
21
- :credit_card => 2
20
+ check: 1,
21
+ credit_card: 2
22
22
  }
23
23
 
24
24
  def initialize(options = {})
@@ -111,7 +111,7 @@ module ActiveMerchant #:nodoc:
111
111
  end
112
112
 
113
113
  def build_request(action, params)
114
- xml = Builder::XmlMarkup.new :indent => 2
114
+ xml = Builder::XmlMarkup.new indent: 2
115
115
  xml.instruct!
116
116
  xml.tag! 'env:Envelope',
117
117
  { 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
@@ -147,15 +147,15 @@ module ActiveMerchant #:nodoc:
147
147
 
148
148
  def commit(action, params)
149
149
  data = ssl_post(url(action), build_request(action, params),
150
- { 'Content-Type' =>'text/xml; charset=utf-8',
150
+ { 'Content-Type' => 'text/xml; charset=utf-8',
151
151
  'SOAPAction' => "#{xmlns(action)}#{action}" }
152
152
  )
153
153
 
154
154
  response = parse(action, data)
155
155
  Response.new(successful?(action, response), message_from(action, response), response,
156
- :test => test?,
157
- :authorization => authorization_from(action, response),
158
- :avs_result => { :code => response[:avs_code] }
156
+ test: test?,
157
+ authorization: authorization_from(action, response),
158
+ avs_result: { code: response[:avs_code] }
159
159
  )
160
160
  end
161
161
 
@@ -151,11 +151,11 @@ module ActiveMerchant #:nodoc:
151
151
 
152
152
  # Private: Build XML wrapping code yielding to code to fill the transaction information
153
153
  def build_request
154
- builder = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|
155
- xml.Request(:version => '1.0') do
156
- xml.Header { xml.Security(:sender => @options[:sender_id]) }
157
- xml.Transaction(:mode => test? ? 'CONNECTOR_TEST' : 'LIVE', :response => 'SYNC', :channel => @options[:channel_id]) do
158
- xml.User(:login => @options[:login], :pwd => @options[:pwd])
154
+ builder = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
155
+ xml.Request(version: '1.0') do
156
+ xml.Header { xml.Security(sender: @options[:sender_id]) }
157
+ xml.Transaction(mode: test? ? 'CONNECTOR_TEST' : 'LIVE', response: 'SYNC', channel: @options[:channel_id]) do
158
+ xml.User(login: @options[:login], pwd: @options[:pwd])
159
159
  yield xml
160
160
  end
161
161
  end
@@ -183,7 +183,7 @@ module ActiveMerchant #:nodoc:
183
183
  def add_payment(xml, action, money, options)
184
184
  code = tanslate_payment_code(action)
185
185
 
186
- xml.Payment(:code => code) do
186
+ xml.Payment(code: code) do
187
187
  xml.Presentation do
188
188
  xml.Amount amount(money)
189
189
  xml.Currency options[:currency] || currency(money)
@@ -198,7 +198,7 @@ module ActiveMerchant #:nodoc:
198
198
  xml.Holder credit_card.name
199
199
  xml.Number credit_card.number
200
200
  xml.Brand credit_card.brand.upcase
201
- xml.Expiry(:month => credit_card.month, :year => credit_card.year)
201
+ xml.Expiry(month: credit_card.month, year: credit_card.year)
202
202
  xml.Verification credit_card.verification_value
203
203
  end
204
204
  end
@@ -248,10 +248,10 @@ module ActiveMerchant #:nodoc:
248
248
  # Private : Add the 3DSecure infos to XML
249
249
  def add_three_d_secure(xml, options)
250
250
  if options[:three_d_secure]
251
- xml.Authentication(:type => '3DSecure') do
251
+ xml.Authentication(type: '3DSecure') do
252
252
  xml.ResultIndicator eci_to_result_indicator options[:three_d_secure][:eci]
253
- xml.Parameter(:name => 'VERIFICATION_ID') { xml.text options[:three_d_secure][:cavv] }
254
- xml.Parameter(:name => 'XID') { xml.text options[:three_d_secure][:xid] }
253
+ xml.Parameter(name: 'VERIFICATION_ID') { xml.text options[:three_d_secure][:cavv] }
254
+ xml.Parameter(name: 'XID') { xml.text options[:three_d_secure][:xid] }
255
255
  end
256
256
  end
257
257
  end
@@ -260,10 +260,10 @@ module ActiveMerchant #:nodoc:
260
260
  def parse(body)
261
261
  xml = Nokogiri::XML(body)
262
262
  {
263
- :unique_id => xml.xpath('//Response/Transaction/Identification/UniqueID').text,
264
- :status => translate_status_code(xml.xpath('//Response/Transaction/Processing/Status/@code').text),
265
- :reason => translate_status_code(xml.xpath('//Response/Transaction/Processing/Reason/@code').text),
266
- :message => xml.xpath('//Response/Transaction/Processing/Return').text
263
+ unique_id: xml.xpath('//Response/Transaction/Identification/UniqueID').text,
264
+ status: translate_status_code(xml.xpath('//Response/Transaction/Processing/Status/@code').text),
265
+ reason: translate_status_code(xml.xpath('//Response/Transaction/Processing/Reason/@code').text),
266
+ message: xml.xpath('//Response/Transaction/Processing/Return').text
267
267
  }
268
268
  end
269
269
 
@@ -326,11 +326,11 @@ module ActiveMerchant #:nodoc:
326
326
  # Private: Translate AM operations to Monei operations codes
327
327
  def tanslate_payment_code(action)
328
328
  {
329
- :purchase => 'CC.DB',
330
- :authorize => 'CC.PA',
331
- :capture => 'CC.CP',
332
- :refund => 'CC.RF',
333
- :void => 'CC.RV'
329
+ purchase: 'CC.DB',
330
+ authorize: 'CC.PA',
331
+ capture: 'CC.CP',
332
+ refund: 'CC.RF',
333
+ void: 'CC.RV'
334
334
  }[action]
335
335
  end
336
336
  end
@@ -92,7 +92,7 @@ module ActiveMerchant #:nodoc:
92
92
  # gateways the two numbers are concatenated together with a ; separator as
93
93
  # the authorization number returned by authorization
94
94
  def capture(money, authorization, options = {})
95
- commit 'completion', crediting_params(authorization, :comp_amount => amount(money))
95
+ commit 'completion', crediting_params(authorization, comp_amount: amount(money))
96
96
  end
97
97
 
98
98
  # Voiding requires the original transaction ID and order ID of some open
@@ -130,7 +130,7 @@ module ActiveMerchant #:nodoc:
130
130
  end
131
131
 
132
132
  def refund(money, authorization, options = {})
133
- commit 'refund', crediting_params(authorization, :amount => amount(money))
133
+ commit 'refund', crediting_params(authorization, amount: amount(money))
134
134
  end
135
135
 
136
136
  def verify(credit_card, options={})
@@ -275,9 +275,9 @@ module ActiveMerchant #:nodoc:
275
275
  # Common params used amongst the +credit+, +void+ and +capture+ methods
276
276
  def crediting_params(authorization, options = {})
277
277
  {
278
- :txn_number => split_authorization(authorization).first,
279
- :order_id => split_authorization(authorization).last,
280
- :crypt_type => options[:crypt_type] || @options[:crypt_type]
278
+ txn_number: split_authorization(authorization).first,
279
+ order_id: split_authorization(authorization).last,
280
+ crypt_type: options[:crypt_type] || @options[:crypt_type]
281
281
  }.merge(options)
282
282
  end
283
283
 
@@ -301,10 +301,10 @@ module ActiveMerchant #:nodoc:
301
301
  successful?(response),
302
302
  message_from(response[:message]),
303
303
  response,
304
- :test => test?,
305
- :avs_result => {:code => response[:avs_result_code]},
306
- :cvv_result => response[:cvd_result_code] && response[:cvd_result_code][-1, 1],
307
- :authorization => authorization_from(response))
304
+ test: test?,
305
+ avs_result: {code: response[:avs_result_code]},
306
+ cvv_result: response[:cvd_result_code] && response[:cvd_result_code][-1, 1],
307
+ authorization: authorization_from(response))
308
308
  end
309
309
 
310
310
  # Generates a Moneris authorization string of the form 'trans_id;receipt_id'.
@@ -320,7 +320,7 @@ module ActiveMerchant #:nodoc:
320
320
  end
321
321
 
322
322
  def parse(xml)
323
- response = { :message => 'Global Error Receipt', :complete => false }
323
+ response = { message: 'Global Error Receipt', complete: false }
324
324
  hashify_xml!(xml, response)
325
325
  response
326
326
  end
@@ -45,7 +45,7 @@ module ActiveMerchant #:nodoc:
45
45
  end
46
46
 
47
47
  def refund(money, authorization, options = {})
48
- commit('refund', money, options.merge(:transactionid => authorization))
48
+ commit('refund', money, options.merge(transactionid: authorization))
49
49
  end
50
50
 
51
51
  def credit(money, authorization, options = {})
@@ -114,10 +114,10 @@ module ActiveMerchant #:nodoc:
114
114
  message = message_from(response)
115
115
 
116
116
  Response.new(success?(response), message, response,
117
- :test => test?,
118
- :authorization => response['transactionid'],
119
- :avs_result => {:code => response['avsresponse']},
120
- :cvv_result => response['cvvresponse']
117
+ test: test?,
118
+ authorization: response['transactionid'],
119
+ avs_result: {code: response['avsresponse']},
120
+ cvv_result: response['cvvresponse']
121
121
  )
122
122
  end
123
123
 
@@ -61,7 +61,7 @@ module ActiveMerchant #:nodoc:
61
61
  end
62
62
 
63
63
  def refund(money, authorization, options={})
64
- add_invoice(post={}, money, options)
64
+ add_invoice(post = {}, money, options)
65
65
  commit('refund', post, authorization)
66
66
  end
67
67
 
@@ -25,18 +25,18 @@ module ActiveMerchant #:nodoc:
25
25
 
26
26
  # Transactions currently accepted by NAB Transact XML API
27
27
  TRANSACTIONS = {
28
- :purchase => 0, # Standard Payment
29
- :refund => 4, # Refund
30
- :void => 6, # Client Reversal (Void)
31
- :unmatched_refund => 666, # Unmatched Refund
32
- :authorization => 10, # Preauthorise
33
- :capture => 11 # Preauthorise Complete (Advice)
28
+ purchase: 0, # Standard Payment
29
+ refund: 4, # Refund
30
+ void: 6, # Client Reversal (Void)
31
+ unmatched_refund: 666, # Unmatched Refund
32
+ authorization: 10, # Preauthorise
33
+ capture: 11 # Preauthorise Complete (Advice)
34
34
  }
35
35
 
36
36
  PERIODIC_TYPES = {
37
- :addcrn => 5,
38
- :deletecrn => 5,
39
- :trigger => 8
37
+ addcrn: 5,
38
+ deletecrn: 5,
39
+ trigger: 8
40
40
  }
41
41
 
42
42
  SUCCESS_CODES = ['00', '08', '11', '16', '77']
@@ -96,8 +96,8 @@ module ActiveMerchant #:nodoc:
96
96
  def add_metadata(xml, options)
97
97
  if options[:merchant_name] || options[:merchant_location]
98
98
  xml.tag! 'metadata' do
99
- xml.tag! 'meta', :name => 'ca_name', :value => options[:merchant_name] if options[:merchant_name]
100
- xml.tag! 'meta', :name => 'ca_location', :value => options[:merchant_location] if options[:merchant_location]
99
+ xml.tag! 'meta', name: 'ca_name', value: options[:merchant_name] if options[:merchant_name]
100
+ xml.tag! 'meta', name: 'ca_location', value: options[:merchant_location] if options[:merchant_location]
101
101
  end
102
102
  end
103
103
  end
@@ -234,16 +234,16 @@ module ActiveMerchant #:nodoc:
234
234
  response = parse(ssl_post(test? ? self.test_url : self.live_url, build_request(action, request)))
235
235
 
236
236
  Response.new(success?(response), message_from(response), response,
237
- :test => test?,
238
- :authorization => authorization_from(action, response)
237
+ test: test?,
238
+ authorization: authorization_from(action, response)
239
239
  )
240
240
  end
241
241
 
242
242
  def commit_periodic(action, request)
243
243
  response = parse(ssl_post(test? ? self.test_periodic_url : self.live_periodic_url, build_periodic_request(action, request)))
244
244
  Response.new(success?(response), message_from(response), response,
245
- :test => test?,
246
- :authorization => authorization_from(action, response)
245
+ test: test?,
246
+ authorization: authorization_from(action, response)
247
247
  )
248
248
  end
249
249
 
@@ -141,7 +141,7 @@ module ActiveMerchant #:nodoc:
141
141
  end
142
142
 
143
143
  def request_body(action, parameters = {})
144
- Nokogiri::XML::Builder.new(:encoding => 'utf-8') do |xml|
144
+ Nokogiri::XML::Builder.new(encoding: 'utf-8') do |xml|
145
145
  xml.MonetraTrans do
146
146
  xml.Trans(identifier: parameters.delete(:identifier) || '1') do
147
147
  xml.username(options[:username])
@@ -37,11 +37,11 @@ module ActiveMerchant
37
37
  self.homepage_url = 'http://www.netregistry.com.au'
38
38
 
39
39
  TRANSACTIONS = {
40
- :authorization => 'preauth',
41
- :purchase => 'purchase',
42
- :capture => 'completion',
43
- :status => 'status',
44
- :refund => 'refund'
40
+ authorization: 'preauth',
41
+ purchase: 'purchase',
42
+ capture: 'completion',
43
+ status: 'status',
44
+ refund: 'refund'
45
45
  }
46
46
 
47
47
  # Create a new NetRegistry gateway.
@@ -145,7 +145,7 @@ module ActiveMerchant
145
145
  response = parse(ssl_post(self.live_url, post_data(action, params)))
146
146
 
147
147
  Response.new(response['status'] == 'approved', message_from(response), response,
148
- :authorization => authorization_from(response, action)
148
+ authorization: authorization_from(response, action)
149
149
  )
150
150
  end
151
151