activemerchant 1.60.0 → 1.61.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +64 -0
  3. data/lib/active_merchant/billing/gateways/authorize_net.rb +1 -1
  4. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +12 -1
  5. data/lib/active_merchant/billing/gateways/blue_pay.rb +1 -1
  6. data/lib/active_merchant/billing/gateways/blue_snap.rb +1 -1
  7. data/lib/active_merchant/billing/gateways/braintree_blue.rb +8 -0
  8. data/lib/active_merchant/billing/gateways/card_stream.rb +2 -0
  9. data/lib/active_merchant/billing/gateways/citrus_pay.rb +24 -0
  10. data/lib/active_merchant/billing/gateways/clearhaus.rb +12 -4
  11. data/lib/active_merchant/billing/gateways/conekta.rb +6 -1
  12. data/lib/active_merchant/billing/gateways/credorax.rb +234 -0
  13. data/lib/active_merchant/billing/gateways/cyber_source.rb +39 -52
  14. data/lib/active_merchant/billing/gateways/element.rb +13 -2
  15. data/lib/active_merchant/billing/gateways/fat_zebra.rb +12 -3
  16. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +5 -0
  17. data/lib/active_merchant/billing/gateways/global_collect.rb +3 -1
  18. data/lib/active_merchant/billing/gateways/jetpay.rb +11 -3
  19. data/lib/active_merchant/billing/gateways/linkpoint.rb +2 -0
  20. data/lib/active_merchant/billing/gateways/litle.rb +28 -12
  21. data/lib/active_merchant/billing/gateways/mastercard.rb +261 -0
  22. data/lib/active_merchant/billing/gateways/migs.rb +23 -1
  23. data/lib/active_merchant/billing/gateways/monei.rb +1 -1
  24. data/lib/active_merchant/billing/gateways/moneris.rb +13 -0
  25. data/lib/active_merchant/billing/gateways/netbanx.rb +245 -0
  26. data/lib/active_merchant/billing/gateways/nmi.rb +5 -0
  27. data/lib/active_merchant/billing/gateways/openpay.rb +7 -0
  28. data/lib/active_merchant/billing/gateways/opp.rb +362 -0
  29. data/lib/active_merchant/billing/gateways/orbital.rb +13 -0
  30. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +190 -0
  31. data/lib/active_merchant/billing/gateways/payflow.rb +6 -0
  32. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +1 -1
  33. data/lib/active_merchant/billing/gateways/paymill.rb +10 -0
  34. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +1 -1
  35. data/lib/active_merchant/billing/gateways/payu_latam.rb +386 -0
  36. data/lib/active_merchant/billing/gateways/pin.rb +1 -3
  37. data/lib/active_merchant/billing/gateways/redsys.rb +2 -0
  38. data/lib/active_merchant/billing/gateways/sage.rb +22 -0
  39. data/lib/active_merchant/billing/gateways/sage_pay.rb +12 -0
  40. data/lib/active_merchant/billing/gateways/securion_pay.rb +2 -2
  41. data/lib/active_merchant/billing/gateways/stripe.rb +29 -8
  42. data/lib/active_merchant/billing/gateways/telr.rb +275 -0
  43. data/lib/active_merchant/billing/gateways/tns.rb +12 -230
  44. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +1 -1
  45. data/lib/active_merchant/billing/gateways/vanco.rb +12 -8
  46. data/lib/active_merchant/billing/gateways/worldpay.rb +18 -0
  47. data/lib/active_merchant/country.rb +6 -2
  48. data/lib/active_merchant/version.rb +1 -1
  49. metadata +11 -3
@@ -486,7 +486,7 @@ module ActiveMerchant #:nodoc:
486
486
  def add_payment_method(doc, payment_method)
487
487
  doc["v1"].card {
488
488
  doc["v1"].pan payment_method.number
489
- doc["v1"].sec payment_method.verification_value
489
+ doc["v1"].sec payment_method.verification_value if payment_method.verification_value?
490
490
  doc["v1"].xprDt expiration_date(payment_method)
491
491
  }
492
492
  end
@@ -22,15 +22,15 @@ module ActiveMerchant
22
22
 
23
23
  def purchase(money, payment_method, options={})
24
24
  MultiResponse.run do |r|
25
- r.process { commit(login_request) }
26
- r.process { commit(purchase_request(money, payment_method, r.params["response_sessionid"], options)) }
25
+ r.process { login }
26
+ r.process { commit(purchase_request(money, payment_method, r.params["response_sessionid"], options), :response_transactionref) }
27
27
  end
28
28
  end
29
29
 
30
30
  def refund(money, authorization, options={})
31
31
  MultiResponse.run do |r|
32
- r.process { commit(login_request) }
33
- r.process { commit(refund_request(money, authorization, r.params["response_sessionid"])) }
32
+ r.process { login }
33
+ r.process { commit(refund_request(money, authorization, r.params["response_sessionid"]), :response_creditrequestreceived) }
34
34
  end
35
35
  end
36
36
 
@@ -89,10 +89,10 @@ module ActiveMerchant
89
89
  end
90
90
  end
91
91
 
92
- def commit(request)
92
+ def commit(request, success_field_name)
93
93
  response = parse(ssl_post(url, request, headers))
94
+ succeeded = success_from(response, success_field_name)
94
95
 
95
- succeeded = success_from(response)
96
96
  Response.new(
97
97
  succeeded,
98
98
  message_from(succeeded, response),
@@ -102,8 +102,8 @@ module ActiveMerchant
102
102
  )
103
103
  end
104
104
 
105
- def success_from(response)
106
- !response[:response_errors]
105
+ def success_from(response, success_field_name)
106
+ !empty?(response[success_field_name])
107
107
  end
108
108
 
109
109
  def message_from(succeeded, response)
@@ -252,6 +252,10 @@ module ActiveMerchant
252
252
  doc.ClientID(@options[:client_id])
253
253
  end
254
254
 
255
+ def login
256
+ commit(login_request, :response_sessionid)
257
+ end
258
+
255
259
  def login_request
256
260
  build_xml_request do |doc|
257
261
  doc.Auth do
@@ -147,6 +147,9 @@ module ActiveMerchant #:nodoc:
147
147
  end
148
148
  add_payment_method(xml, money, payment_method, options)
149
149
  add_email(xml, options)
150
+ if options[:hcg_additional_data]
151
+ add_hcg_additional_data(xml, options)
152
+ end
150
153
  end
151
154
  end
152
155
  end
@@ -254,6 +257,14 @@ module ActiveMerchant #:nodoc:
254
257
  end
255
258
  end
256
259
 
260
+ def add_hcg_additional_data(xml, options)
261
+ xml.tag! 'hcgAdditionalData' do
262
+ options[:hcg_additional_data].each do |k, v|
263
+ xml.tag! "param", {name: k.to_s}, v
264
+ end
265
+ end
266
+ end
267
+
257
268
  def address_with_defaults(address)
258
269
  address ||= {}
259
270
  address.delete_if { |_, v| v.blank? }
@@ -297,6 +308,7 @@ module ActiveMerchant #:nodoc:
297
308
  message,
298
309
  raw,
299
310
  :authorization => authorization_from(raw),
311
+ :error_code => error_code_from(success, raw),
300
312
  :test => test?)
301
313
 
302
314
  rescue ActiveMerchant::ResponseError => e
@@ -326,6 +338,12 @@ module ActiveMerchant #:nodoc:
326
338
  [ success, message ]
327
339
  end
328
340
 
341
+ def error_code_from(success, raw)
342
+ unless success == "SUCCESS"
343
+ raw[:iso8583_return_code_code] || raw[:error_code] || nil
344
+ end
345
+ end
346
+
329
347
  def required_status_message(raw, success_criteria)
330
348
  if(!success_criteria.include?(raw[:last_event]))
331
349
  "A transaction status of #{success_criteria.collect{|c| "'#{c}'"}.join(" or ")} is required."
@@ -72,6 +72,7 @@ module ActiveMerchant #:nodoc:
72
72
  { alpha2: 'AD', name: 'Andorra', alpha3: 'AND', numeric: '020' },
73
73
  { alpha2: 'AO', name: 'Angola', alpha3: 'AGO', numeric: '024' },
74
74
  { alpha2: 'AI', name: 'Anguilla', alpha3: 'AIA', numeric: '660' },
75
+ { alpha2: 'AQ', name: 'Antarctica', alpha3: 'ATA', numeric: '010' },
75
76
  { alpha2: 'AG', name: 'Antigua and Barbuda', alpha3: 'ATG', numeric: '028' },
76
77
  { alpha2: 'AR', name: 'Argentina', alpha3: 'ARG', numeric: '032' },
77
78
  { alpha2: 'AM', name: 'Armenia', alpha3: 'ARM', numeric: '051' },
@@ -90,6 +91,7 @@ module ActiveMerchant #:nodoc:
90
91
  { alpha2: 'BM', name: 'Bermuda', alpha3: 'BMU', numeric: '060' },
91
92
  { alpha2: 'BT', name: 'Bhutan', alpha3: 'BTN', numeric: '064' },
92
93
  { alpha2: 'BO', name: 'Bolivia', alpha3: 'BOL', numeric: '068' },
94
+ { alpha2: 'BQ', name: 'Bonaire, Sint Eustatius and Saba', alpha3: 'BES', numeric: '535' },
93
95
  { alpha2: 'BA', name: 'Bosnia and Herzegovina', alpha3: 'BIH', numeric: '070' },
94
96
  { alpha2: 'BW', name: 'Botswana', alpha3: 'BWA', numeric: '072' },
95
97
  { alpha2: 'BV', name: 'Bouvet Island', alpha3: 'BVD', numeric: '074' },
@@ -262,15 +264,17 @@ module ActiveMerchant #:nodoc:
262
264
  { alpha2: 'SC', name: 'Seychelles', alpha3: 'SYC', numeric: '690' },
263
265
  { alpha2: 'SL', name: 'Sierra Leone', alpha3: 'SLE', numeric: '694' },
264
266
  { alpha2: 'SG', name: 'Singapore', alpha3: 'SGP', numeric: '702' },
267
+ { alpha2: 'SX', name: 'Sint Maarten', alpha3: 'SXM', numeric: '534' },
265
268
  { alpha2: 'SK', name: 'Slovakia', alpha3: 'SVK', numeric: '703' },
266
269
  { alpha2: 'SI', name: 'Slovenia', alpha3: 'SVN', numeric: '705' },
267
270
  { alpha2: 'SB', name: 'Solomon Islands', alpha3: 'SLB', numeric: '090' },
268
271
  { alpha2: 'SO', name: 'Somalia', alpha3: 'SOM', numeric: '706' },
269
272
  { alpha2: 'ZA', name: 'South Africa', alpha3: 'ZAF', numeric: '710' },
270
273
  { alpha2: 'GS', name: 'South Georgia and the South Sandwich Islands', alpha3: 'SGS', numeric: '239' },
274
+ { alpha2: 'SS', name: 'South Sudan', alpha3: 'SSD', numeric: '728' },
271
275
  { alpha2: 'ES', name: 'Spain', alpha3: 'ESP', numeric: '724' },
272
276
  { alpha2: 'LK', name: 'Sri Lanka', alpha3: 'LKA', numeric: '144' },
273
- { alpha2: 'SD', name: 'Sudan', alpha3: 'SDN', numeric: '736' },
277
+ { alpha2: 'SD', name: 'Sudan', alpha3: 'SDN', numeric: '729' },
274
278
  { alpha2: 'SR', name: 'Suriname', alpha3: 'SUR', numeric: '740' },
275
279
  { alpha2: 'SJ', name: 'Svalbard and Jan Mayen', alpha3: 'SJM', numeric: '744' },
276
280
  { alpha2: 'SZ', name: 'Swaziland', alpha3: 'SWZ', numeric: '748' },
@@ -321,7 +325,7 @@ module ActiveMerchant #:nodoc:
321
325
  country_code = CountryCode.new(name)
322
326
  country = COUNTRIES.detect{|c| c[country_code.format] == upcase_name }
323
327
  else
324
- country = COUNTRIES.detect{|c| c[:name] == name }
328
+ country = COUNTRIES.detect{|c| c[:name].upcase == name.upcase }
325
329
  end
326
330
  raise InvalidCountryCodeError, "No country could be found for the country #{name}" if country.nil?
327
331
  Country.new(country.dup)
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = "1.60.0"
2
+ VERSION = "1.61.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemerchant
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.60.0
4
+ version: 1.61.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Luetke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-04 00:00:00.000000000 Z
11
+ date: 2016-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -196,10 +196,12 @@ files:
196
196
  - lib/active_merchant/billing/gateways/cenpos.rb
197
197
  - lib/active_merchant/billing/gateways/checkout.rb
198
198
  - lib/active_merchant/billing/gateways/checkout_v2.rb
199
+ - lib/active_merchant/billing/gateways/citrus_pay.rb
199
200
  - lib/active_merchant/billing/gateways/clearhaus.rb
200
201
  - lib/active_merchant/billing/gateways/commercegate.rb
201
202
  - lib/active_merchant/billing/gateways/conekta.rb
202
203
  - lib/active_merchant/billing/gateways/creditcall.rb
204
+ - lib/active_merchant/billing/gateways/credorax.rb
203
205
  - lib/active_merchant/billing/gateways/cyber_source.rb
204
206
  - lib/active_merchant/billing/gateways/data_cash.rb
205
207
  - lib/active_merchant/billing/gateways/dibs.rb
@@ -243,6 +245,7 @@ files:
243
245
  - lib/active_merchant/billing/gateways/latitude19.rb
244
246
  - lib/active_merchant/billing/gateways/linkpoint.rb
245
247
  - lib/active_merchant/billing/gateways/litle.rb
248
+ - lib/active_merchant/billing/gateways/mastercard.rb
246
249
  - lib/active_merchant/billing/gateways/maxipago.rb
247
250
  - lib/active_merchant/billing/gateways/merchant_e_solutions.rb
248
251
  - lib/active_merchant/billing/gateways/merchant_one.rb
@@ -265,6 +268,7 @@ files:
265
268
  - lib/active_merchant/billing/gateways/ncr_secure_pay.rb
266
269
  - lib/active_merchant/billing/gateways/net_registry.rb
267
270
  - lib/active_merchant/billing/gateways/netaxept.rb
271
+ - lib/active_merchant/billing/gateways/netbanx.rb
268
272
  - lib/active_merchant/billing/gateways/netbilling.rb
269
273
  - lib/active_merchant/billing/gateways/netpay.rb
270
274
  - lib/active_merchant/billing/gateways/network_merchants.rb
@@ -272,6 +276,7 @@ files:
272
276
  - lib/active_merchant/billing/gateways/ogone.rb
273
277
  - lib/active_merchant/billing/gateways/omise.rb
274
278
  - lib/active_merchant/billing/gateways/openpay.rb
279
+ - lib/active_merchant/billing/gateways/opp.rb
275
280
  - lib/active_merchant/billing/gateways/optimal_payment.rb
276
281
  - lib/active_merchant/billing/gateways/orbital.rb
277
282
  - lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb
@@ -282,6 +287,7 @@ files:
282
287
  - lib/active_merchant/billing/gateways/pay_gate_xml.rb
283
288
  - lib/active_merchant/billing/gateways/pay_hub.rb
284
289
  - lib/active_merchant/billing/gateways/pay_junction.rb
290
+ - lib/active_merchant/billing/gateways/pay_junction_v2.rb
285
291
  - lib/active_merchant/billing/gateways/pay_secure.rb
286
292
  - lib/active_merchant/billing/gateways/paybox_direct.rb
287
293
  - lib/active_merchant/billing/gateways/payeezy.rb
@@ -306,6 +312,7 @@ files:
306
312
  - lib/active_merchant/billing/gateways/payscout.rb
307
313
  - lib/active_merchant/billing/gateways/paystation.rb
308
314
  - lib/active_merchant/billing/gateways/payu_in.rb
315
+ - lib/active_merchant/billing/gateways/payu_latam.rb
309
316
  - lib/active_merchant/billing/gateways/payway.rb
310
317
  - lib/active_merchant/billing/gateways/pin.rb
311
318
  - lib/active_merchant/billing/gateways/plugnpay.rb
@@ -336,6 +343,7 @@ files:
336
343
  - lib/active_merchant/billing/gateways/spreedly_core.rb
337
344
  - lib/active_merchant/billing/gateways/stripe.rb
338
345
  - lib/active_merchant/billing/gateways/swipe_checkout.rb
346
+ - lib/active_merchant/billing/gateways/telr.rb
339
347
  - lib/active_merchant/billing/gateways/tns.rb
340
348
  - lib/active_merchant/billing/gateways/trans_first.rb
341
349
  - lib/active_merchant/billing/gateways/trans_first_transaction_express.rb
@@ -395,7 +403,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
395
403
  version: '0'
396
404
  requirements: []
397
405
  rubyforge_project: activemerchant
398
- rubygems_version: 2.2.3
406
+ rubygems_version: 2.5.1
399
407
  signing_key:
400
408
  specification_version: 4
401
409
  summary: Framework and tools for dealing with credit card transactions.