activemerchant 1.58.0 → 1.59.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +54 -0
  3. data/README.md +3 -3
  4. data/lib/active_merchant/billing/check.rb +3 -0
  5. data/lib/active_merchant/billing/credit_card.rb +7 -2
  6. data/lib/active_merchant/billing/credit_card_methods.rb +5 -1
  7. data/lib/active_merchant/billing/gateway.rb +5 -3
  8. data/lib/active_merchant/billing/gateways/authorize_net.rb +3 -3
  9. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +34 -5
  10. data/lib/active_merchant/billing/gateways/blue_pay.rb +1 -1
  11. data/lib/active_merchant/billing/gateways/blue_snap.rb +348 -0
  12. data/lib/active_merchant/billing/gateways/braintree_blue.rb +6 -3
  13. data/lib/active_merchant/billing/gateways/card_stream.rb +33 -15
  14. data/lib/active_merchant/billing/gateways/cashnet.rb +1 -0
  15. data/lib/active_merchant/billing/gateways/cyber_source.rb +7 -3
  16. data/lib/active_merchant/billing/gateways/global_collect.rb +293 -0
  17. data/lib/active_merchant/billing/gateways/jetpay.rb +11 -8
  18. data/lib/active_merchant/billing/gateways/latitude19.rb +416 -0
  19. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +13 -0
  20. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +10 -7
  21. data/lib/active_merchant/billing/gateways/mercury.rb +1 -1
  22. data/lib/active_merchant/billing/gateways/metrics_global.rb +1 -1
  23. data/lib/active_merchant/billing/gateways/moneris.rb +8 -1
  24. data/lib/active_merchant/billing/gateways/nmi.rb +25 -9
  25. data/lib/active_merchant/billing/gateways/openpay.rb +1 -1
  26. data/lib/active_merchant/billing/gateways/orbital.rb +5 -3
  27. data/lib/active_merchant/billing/gateways/paymill.rb +1 -1
  28. data/lib/active_merchant/billing/gateways/paypal_express.rb +1 -6
  29. data/lib/active_merchant/billing/gateways/payu_in.rb +3 -2
  30. data/lib/active_merchant/billing/gateways/s5.rb +8 -5
  31. data/lib/active_merchant/billing/gateways/sage.rb +1 -7
  32. data/lib/active_merchant/billing/gateways/sage_pay.rb +0 -4
  33. data/lib/active_merchant/billing/gateways/secure_net.rb +0 -5
  34. data/lib/active_merchant/billing/gateways/secure_pay.rb +1 -1
  35. data/lib/active_merchant/billing/gateways/securion_pay.rb +46 -17
  36. data/lib/active_merchant/billing/gateways/stripe.rb +5 -8
  37. data/lib/active_merchant/billing/gateways/tns.rb +1 -1
  38. data/lib/active_merchant/billing/gateways/trans_first.rb +1 -2
  39. data/lib/active_merchant/billing/gateways/vanco.rb +1 -1
  40. data/lib/active_merchant/billing/gateways/visanet_peru.rb +218 -0
  41. data/lib/active_merchant/billing/gateways/world_net.rb +344 -0
  42. data/lib/active_merchant/billing/gateways/worldpay.rb +8 -11
  43. data/lib/active_merchant/billing/network_tokenization_credit_card.rb +4 -0
  44. data/lib/active_merchant/country.rb +0 -2
  45. data/lib/active_merchant/version.rb +1 -1
  46. metadata +7 -2
@@ -8,6 +8,7 @@ module ActiveMerchant #:nodoc:
8
8
  self.money_format = :cents
9
9
  self.supported_countries = %w(HK GB AU AD BE CH CY CZ DE DK ES FI FR GI GR HU IE IL IT LI LU MC MT NL NO NZ PL PT SE SG SI SM TR UM VA)
10
10
  self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :maestro, :laser, :switch]
11
+ self.currencies_without_fractions = %w(HUF IDR ISK JPY KRW)
11
12
  self.homepage_url = 'http://www.worldpay.com/'
12
13
  self.display_name = 'Worldpay Global'
13
14
 
@@ -136,7 +137,7 @@ module ActiveMerchant #:nodoc:
136
137
  def build_authorization_request(money, payment_method, options)
137
138
  build_request do |xml|
138
139
  xml.tag! 'submit' do
139
- xml.tag! 'order', {'orderCode' => options[:order_id], 'installationId' => @options[:inst_id]}.reject{|_,v| !v} do
140
+ xml.tag! 'order', order_tag_attributes(options) do
140
141
  xml.description(options[:description].blank? ? "Purchase" : options[:description])
141
142
  add_amount(xml, money, options)
142
143
  if options[:order_content]
@@ -151,6 +152,10 @@ module ActiveMerchant #:nodoc:
151
152
  end
152
153
  end
153
154
 
155
+ def order_tag_attributes(options)
156
+ { 'orderCode' => options[:order_id], 'installationId' => options[:inst_id] || @options[:inst_id] }.reject{|_,v| !v}
157
+ end
158
+
154
159
  def build_capture_request(money, authorization, options)
155
160
  build_order_modify_request(authorization) do |xml|
156
161
  xml.tag! 'capture' do
@@ -177,12 +182,11 @@ module ActiveMerchant #:nodoc:
177
182
 
178
183
  def add_amount(xml, money, options)
179
184
  currency = options[:currency] || currency(money)
180
- amount = localized_amount(money, currency)
181
185
 
182
186
  amount_hash = {
183
- :value => amount,
187
+ :value => amount(money),
184
188
  'currencyCode' => currency,
185
- 'exponent' => 2
189
+ 'exponent' => non_fractional_currency?(currency) ? 0 : 2
186
190
  }
187
191
 
188
192
  if options[:debit_credit_indicator]
@@ -337,13 +341,6 @@ module ActiveMerchant #:nodoc:
337
341
  credentials = "#{@options[:login]}:#{@options[:password]}"
338
342
  "Basic #{[credentials].pack('m').strip}"
339
343
  end
340
-
341
- def localized_amount(money, currency)
342
- amount = amount(money)
343
- return amount unless CURRENCIES_WITHOUT_FRACTIONS.include?(currency.to_s)
344
-
345
- amount.to_i / 100 * 100
346
- end
347
344
  end
348
345
  end
349
346
  end
@@ -27,6 +27,10 @@ module ActiveMerchant #:nodoc:
27
27
  end
28
28
  end
29
29
 
30
+ def credit_card?
31
+ true
32
+ end
33
+
30
34
  def type
31
35
  "network_tokenization"
32
36
  end
@@ -181,7 +181,6 @@ module ActiveMerchant #:nodoc:
181
181
  { alpha2: 'KI', name: 'Kiribati', alpha3: 'KIR', numeric: '296' },
182
182
  { alpha2: 'KP', name: 'Korea, Democratic People\'s Republic of', alpha3: 'PRK', numeric: '408' },
183
183
  { alpha2: 'KR', name: 'Korea, Republic of', alpha3: 'KOR', numeric: '410' },
184
- { alpha2: 'KV', name: 'Kosovo', alpha3: 'KSV', numeric: '377' },
185
184
  { alpha2: 'KW', name: 'Kuwait', alpha3: 'KWT', numeric: '414' },
186
185
  { alpha2: 'KG', name: 'Kyrgyzstan', alpha3: 'KGZ', numeric: '417' },
187
186
  { alpha2: 'LA', name: 'Lao People\'s Democratic Republic', alpha3: 'LAO', numeric: '418' },
@@ -220,7 +219,6 @@ module ActiveMerchant #:nodoc:
220
219
  { alpha2: 'NR', name: 'Nauru', alpha3: 'NRU', numeric: '520' },
221
220
  { alpha2: 'NP', name: 'Nepal', alpha3: 'NPL', numeric: '524' },
222
221
  { alpha2: 'NL', name: 'Netherlands', alpha3: 'NLD', numeric: '528' },
223
- { alpha2: 'AN', name: 'Netherlands Antilles', alpha3: 'ANT', numeric: '530' },
224
222
  { alpha2: 'NC', name: 'New Caledonia', alpha3: 'NCL', numeric: '540' },
225
223
  { alpha2: 'NZ', name: 'New Zealand', alpha3: 'NZL', numeric: '554' },
226
224
  { alpha2: 'NI', name: 'Nicaragua', alpha3: 'NIC', numeric: '558' },
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = "1.58.0"
2
+ VERSION = "1.59.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.58.0
4
+ version: 1.59.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-03-01 00:00:00.000000000 Z
11
+ date: 2016-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -177,6 +177,7 @@ files:
177
177
  - lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb
178
178
  - lib/active_merchant/billing/gateways/beanstream_interac.rb
179
179
  - lib/active_merchant/billing/gateways/blue_pay.rb
180
+ - lib/active_merchant/billing/gateways/blue_snap.rb
180
181
  - lib/active_merchant/billing/gateways/bogus.rb
181
182
  - lib/active_merchant/billing/gateways/borgun.rb
182
183
  - lib/active_merchant/billing/gateways/bpoint.rb
@@ -223,6 +224,7 @@ files:
223
224
  - lib/active_merchant/billing/gateways/flo2cash_simple.rb
224
225
  - lib/active_merchant/billing/gateways/forte.rb
225
226
  - lib/active_merchant/billing/gateways/garanti.rb
227
+ - lib/active_merchant/billing/gateways/global_collect.rb
226
228
  - lib/active_merchant/billing/gateways/global_transport.rb
227
229
  - lib/active_merchant/billing/gateways/hdfc.rb
228
230
  - lib/active_merchant/billing/gateways/hps.rb
@@ -239,6 +241,7 @@ files:
239
241
  - lib/active_merchant/billing/gateways/itransact.rb
240
242
  - lib/active_merchant/billing/gateways/jetpay.rb
241
243
  - lib/active_merchant/billing/gateways/komoju.rb
244
+ - lib/active_merchant/billing/gateways/latitude19.rb
242
245
  - lib/active_merchant/billing/gateways/linkpoint.rb
243
246
  - lib/active_merchant/billing/gateways/litle.rb
244
247
  - lib/active_merchant/billing/gateways/maxipago.rb
@@ -346,9 +349,11 @@ files:
346
349
  - lib/active_merchant/billing/gateways/vanco.rb
347
350
  - lib/active_merchant/billing/gateways/verifi.rb
348
351
  - lib/active_merchant/billing/gateways/viaklix.rb
352
+ - lib/active_merchant/billing/gateways/visanet_peru.rb
349
353
  - lib/active_merchant/billing/gateways/webpay.rb
350
354
  - lib/active_merchant/billing/gateways/wepay.rb
351
355
  - lib/active_merchant/billing/gateways/wirecard.rb
356
+ - lib/active_merchant/billing/gateways/world_net.rb
352
357
  - lib/active_merchant/billing/gateways/worldpay.rb
353
358
  - lib/active_merchant/billing/gateways/worldpay_online_payments.rb
354
359
  - lib/active_merchant/billing/gateways/worldpay_us.rb