activemerchant 1.130.0 → 1.131.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68d19e25c325eedb9f632b67713bd61ec67f09794560add0c22ba7b45c33cda6
4
- data.tar.gz: 3c9405afcad2c9d066b76f1ad055d264e55569c14d9b9e322e2c6d3d83867b29
3
+ metadata.gz: 353c5193fc7b56d5ad6aee9a6ac5d21a691235f5ec3ef324af88e83b8333bffd
4
+ data.tar.gz: 7961954d7d9efd01188a87131576407c9e5f4cb5058b5541efe5b41e7547a431
5
5
  SHA512:
6
- metadata.gz: e5c803983440bd24cbadd24fc5c689061ece449436010f3ad2f328dd3bdbaf2cc3c68c43dae86482f4fee84de454d2e626b89bacf54ad67468285410d8860610
7
- data.tar.gz: 77458ab3d685b3ea7b7f3f1a26617d201eb071ef540414e6934677a1541166bbd68b132bc5f980dbf60656058d97877e70c907ab950b2314a2cfcf205e9e2de3
6
+ metadata.gz: 56778ad0daa66ed3807ba7c099fbaf4d0686f87a940dafdf5d30faba63024ea6c4c3cf11b853333d0febdf78d4396ba311bd401f92e50ef23fd56977276eea0a
7
+ data.tar.gz: d5e52402becff2de0a529bd3de9f70c49e4e4dafa09e797dd54eccb51624de71264d8e961bc1ccc5e5c32ef47ab5b1f8abd3db04fefbfef2cdfd772c5493d05e
data/CHANGELOG CHANGED
@@ -3,6 +3,12 @@
3
3
 
4
4
  == HEAD
5
5
 
6
+ == Version 1.131.0 (June 21, 2023)
7
+ * Redsys: Add supported countries [jcreiff] #4811
8
+ * Authorize.net: Truncate nameOnAccount for bank refunds [jcreiff] #4808
9
+ * CheckoutV2: Add support for several customer data fields [rachelkirk] #4800
10
+ * Worldpay: check payment_method responds to payment_cryptogram and eci [bbraschi] #4812
11
+
6
12
  == Version 1.130.0 (June 13th, 2023)
7
13
  * Payu Latam - Update error code method to surface network code [yunnydang] #4773
8
14
  * CyberSource: Handling Canadian bank accounts [heavyblade] #4764
@@ -362,7 +362,7 @@ module ActiveMerchant
362
362
  xml.accountType(options[:account_type])
363
363
  xml.routingNumber(options[:routing_number])
364
364
  xml.accountNumber(options[:account_number])
365
- xml.nameOnAccount("#{options[:first_name]} #{options[:last_name]}")
365
+ xml.nameOnAccount(truncate("#{options[:first_name]} #{options[:last_name]}", 22))
366
366
  end
367
367
  else
368
368
  xml.creditCard do
@@ -139,6 +139,7 @@ module ActiveMerchant #:nodoc:
139
139
  add_authorization_type(post, options)
140
140
  add_payment_method(post, payment_method, options)
141
141
  add_customer_data(post, options)
142
+ add_extra_customer_data(post, payment_method, options)
142
143
  add_shipping_address(post, options)
143
144
  add_stored_credential_options(post, options)
144
145
  add_transaction_data(post, options)
@@ -239,6 +240,15 @@ module ActiveMerchant #:nodoc:
239
240
  end
240
241
  end
241
242
 
243
+ # created a separate method for these fields because they should not be included
244
+ # in all transaction types that include methods with source and customer fields
245
+ def add_extra_customer_data(post, payment_method, options)
246
+ post[:source][:phone] = {}
247
+ post[:source][:phone][:number] = options[:phone] || options.dig(:billing_address, :phone) || options.dig(:billing_address, :phone_number)
248
+ post[:source][:phone][:country_code] = options[:phone_country_code] if options[:phone_country_code]
249
+ post[:customer][:name] = payment_method.name if payment_method.respond_to?(:name)
250
+ end
251
+
242
252
  def add_shipping_address(post, options)
243
253
  if address = options[:shipping_address]
244
254
  post[:shipping] = {}
@@ -39,7 +39,7 @@ module ActiveMerchant #:nodoc:
39
39
  self.live_url = 'https://sis.redsys.es/sis/operaciones'
40
40
  self.test_url = 'https://sis-t.redsys.es:25443/sis/operaciones'
41
41
 
42
- self.supported_countries = ['ES']
42
+ self.supported_countries = %w[ES FR GB IT PL PT]
43
43
  self.default_currency = 'EUR'
44
44
  self.money_format = :cents
45
45
 
@@ -997,12 +997,18 @@ module ActiveMerchant #:nodoc:
997
997
  when String
998
998
  token_type_and_details(payment_method)
999
999
  else
1000
- type = payment_method.respond_to?(:source) ? :network_token : :credit
1000
+ type = network_token?(payment_method) ? :network_token : :credit
1001
1001
 
1002
1002
  { payment_type: type }
1003
1003
  end
1004
1004
  end
1005
1005
 
1006
+ def network_token?(payment_method)
1007
+ payment_method.respond_to?(:source) &&
1008
+ payment_method.respond_to?(:payment_cryptogram) &&
1009
+ payment_method.respond_to?(:eci)
1010
+ end
1011
+
1006
1012
  def token_type_and_details(token)
1007
1013
  token_details = token_details_from_authorization(token)
1008
1014
  token_details[:payment_type] = token_details.has_key?(:token_id) ? :token : :pay_as_order
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = '1.130.0'
2
+ VERSION = '1.131.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.130.0
4
+ version: 1.131.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: 2023-06-13 00:00:00.000000000 Z
11
+ date: 2023-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -480,7 +480,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
480
480
  - !ruby/object:Gem::Version
481
481
  version: '0'
482
482
  requirements: []
483
- rubygems_version: 3.4.13
483
+ rubygems_version: 3.4.14
484
484
  signing_key:
485
485
  specification_version: 4
486
486
  summary: Framework and tools for dealing with credit card transactions.