activemerchant 1.113.0 → 1.114.0

This diff has not been reviewed by any users.
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e55d83260a0ec7b9a824a6313782d8c2b086d55aeb33d99554a09a18836f40a5
4
- data.tar.gz: 35b24d3dd8e61c096ec4f5ef5d241a5ae3f905f32ba159e4332be36942cd3c56
3
+ metadata.gz: 4d467cbeefbc698298d8e87dc6f9655cb8105cd6b949753082696802cd667d15
4
+ data.tar.gz: e7a09ed0f9dbead854bf3bab3940e2a335109aa4a76c2a8f2f824c27a2236833
5
5
  SHA512:
6
- metadata.gz: 337249552ee4b5fd33ff2ca257cfcc90265e9aff657b5c42f42563aae070fd583308f5e6cfe05ed5ba1d23a791bac04edf50d0b8afce796c051d36f0b0dca256
7
- data.tar.gz: d21728f2c2448e36842ccf5c38d64bf21ace79bd61ddf37367cf08f62ec98d33e0e277d5c5d21adb32ae7db4b03b15fa8e9f6d18b3acdf2be46ac153141585da
6
+ metadata.gz: 45db32004cb0fb161a6ae422b64b3401d9c6b3bf780549ba17cc50b2f94e79f94baa76353fdc5cfbad771423613ab5a3030b164e69f1de8ae44c612cd6982bf2
7
+ data.tar.gz: 2ea821b491e9c6cd21442c7563fcac422d42190a8a222583d15783fc1e1a87f77894a6d4eac7a41a5bb1c63d69c59cc17f2d6aaf1540d0d01e5ae4ee168e2b5f
data/CHANGELOG CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  == HEAD
4
4
 
5
+ == Version 1.114.0
6
+ * BlueSnap: Add address1,address2,phone,shipping_* support #3749
7
+ * BlueSnap: Protect against `nil` metadata [carrigan] #3752
8
+ * Cybersource: [CyberSource] Ensure the default address doesn't override `ActionController::Parameters` [pi3r] #3755
9
+
5
10
  == Version 1.113.0
6
11
  * Orbital: Add cardIndicators field [meagabeth] #3734
7
12
  * Openpay: Add Colombia to supported countries [molbrown] #3740
@@ -177,7 +177,7 @@ module ActiveMerchant
177
177
  add_order(doc, options)
178
178
  doc.send('store-card', options[:store_card] || false)
179
179
  add_amount(doc, money, options)
180
- add_fraud_info(doc, options)
180
+ add_fraud_info(doc, payment_method, options)
181
181
 
182
182
  if payment_method.is_a?(String)
183
183
  doc.send('vaulted-shopper-id', payment_method)
@@ -200,6 +200,7 @@ module ActiveMerchant
200
200
  doc.send('last-name', payment_method.last_name)
201
201
  doc.send('personal-identification-number', options[:personal_identification_number]) if options[:personal_identification_number]
202
202
  doc.email(options[:email]) if options[:email]
203
+ doc.phone(options[:phone_number]) if options[:phone_number]
203
204
  add_address(doc, options)
204
205
  end
205
206
 
@@ -213,7 +214,7 @@ module ActiveMerchant
213
214
  end
214
215
 
215
216
  def add_metadata(doc, options)
216
- transaction_meta_data = options.fetch(:transaction_meta_data, {})
217
+ transaction_meta_data = options[:transaction_meta_data] || []
217
218
  return if transaction_meta_data.empty? && !options[:description]
218
219
 
219
220
  doc.send('transaction-meta-data') do
@@ -252,7 +253,8 @@ module ActiveMerchant
252
253
 
253
254
  doc.country(address[:country]) if address[:country]
254
255
  doc.state(address[:state]) if address[:state] && STATE_CODE_COUNTRIES.include?(address[:country])
255
- doc.address(address[:address]) if address[:address]
256
+ doc.address(address[:address1]) if address[:address1]
257
+ doc.address2(address[:address2]) if address[:address2]
256
258
  doc.city(address[:city]) if address[:city]
257
259
  doc.zip(address[:zip]) if address[:zip]
258
260
  end
@@ -314,12 +316,31 @@ module ActiveMerchant
314
316
  doc.send('transaction-id', authorization)
315
317
  end
316
318
 
317
- def add_fraud_info(doc, options)
319
+ def add_fraud_info(doc, payment_method, options)
318
320
  doc.send('transaction-fraud-info') do
319
321
  doc.send('shopper-ip-address', options[:ip]) if options[:ip]
322
+
323
+ unless payment_method.is_a? String
324
+ doc.send('shipping-contact-info') do
325
+ add_shipping_contact_info(doc, payment_method, options)
326
+ end
327
+ end
320
328
  end
321
329
  end
322
330
 
331
+ def add_shipping_contact_info(doc, payment_method, options)
332
+ # https://developers.bluesnap.com/v8976-XML/docs/shipping-contact-info
333
+ doc.send('first-name', payment_method.first_name)
334
+ doc.send('last-name', payment_method.last_name)
335
+
336
+ doc.country(options[:shipping_country]) if options[:shipping_country]
337
+ doc.state(options[:shipping_state]) if options[:shipping_state] && STATE_CODE_COUNTRIES.include?(options[:shipping_country])
338
+ doc.address1(options[:shipping_address1]) if options[:shipping_address1]
339
+ doc.address2(options[:shipping_address2]) if options[:shipping_address2]
340
+ doc.city(options[:shipping_city]) if options[:shipping_city]
341
+ doc.zip(options[:shipping_zip]) if options[:shipping_zip]
342
+ end
343
+
323
344
  def add_alt_transaction_purchase(doc, money, payment_method_details, options)
324
345
  doc.send('merchant-transaction-id', truncate(options[:order_id], 50)) if options[:order_id]
325
346
  doc.send('soft-descriptor', options[:soft_descriptor]) if options[:soft_descriptor]
@@ -330,7 +351,7 @@ module ActiveMerchant
330
351
 
331
352
  add_echeck_transaction(doc, payment_method_details.payment_method, options, vaulted_shopper_id.present?) if payment_method_details.check?
332
353
 
333
- add_fraud_info(doc, options)
354
+ add_fraud_info(doc, payment_method_details.payment_method, options)
334
355
  add_metadata(doc, options)
335
356
  end
336
357
 
@@ -268,7 +268,7 @@ module ActiveMerchant #:nodoc:
268
268
  }
269
269
 
270
270
  submitted_address = options[:billing_address] || options[:address] || default_address
271
- options[:billing_address] = default_address.merge(submitted_address) { |_k, default, submitted| submitted.blank? ? default : submitted }
271
+ options[:billing_address] = default_address.merge(submitted_address.symbolize_keys) { |_k, default, submitted| submitted.blank? ? default : submitted }
272
272
  options[:shipping_address] = options[:shipping_address] || {}
273
273
  end
274
274
 
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = '1.113.0'
2
+ VERSION = '1.114.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.113.0
4
+ version: 1.114.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: 2020-09-01 00:00:00.000000000 Z
11
+ date: 2020-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport