activemerchant 1.111.0 → 1.112.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: 680a672c616e4c329cc7fb7cafdd72c417615f6d523c3079f271147f94af6d55
4
- data.tar.gz: 2b16a9718878e8c7334ac0d7afbc80b605a525d4c267dc952bb25dbf15eb758f
3
+ metadata.gz: b190bcb3ae62de72a04d6ccf0bdbf8118bf3a7ed933047623376c19462f5300c
4
+ data.tar.gz: f189cc282450940147eab25223d1046382edb063c5df42205f954931df22bce3
5
5
  SHA512:
6
- metadata.gz: c59f0a8f9b0aa19abba63ca244be4ddc9537d9802858f8453eaef59a4015e2ab6ba9cfbd9fcdc6e1601854804de838d615f2621cb267d571ffa57adadcf6c063
7
- data.tar.gz: 3d2feb5a78bc21d2f844ff8c16c233cee05a29f1e260dc5b8c47a829ac4c3ee11c7ec5d8f29208b9408ab0c78334840623b557a87410e1a48bc204a01cd23163
6
+ metadata.gz: 720b7a70402af86c246c1f28cd2d5d310a84edc6528718b15bb3d6183001e1b1d083dfb43e5f8d2e89dddcaa75f385e1154059fd0e1d6ce6f4b168bd469cf119
7
+ data.tar.gz: c8206af39075a57a3c4d201ef0d80a2cd775509cd62e5f6f5bdcfbf60809a0dd4bfe16e61ed587f42a1f75ebbbe893c1f97947886e9c758e289cd6993f3f7ac5
data/CHANGELOG CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  == HEAD
4
4
 
5
+ == Version 1.112.0
6
+ * Cybersource: add `maestro` and `diners_club` eci brand mapping [bbraschi] #3708
7
+ * Cybersource: Ensure Partner Solution Id placement conforms to schema [britth] #3715
8
+ * Adyen: Adyen: Pass `subMerchantId` as `additionalData` [naashton] #3714
9
+ * Litle: Omit checkNum when nil [leila-alderman] #3719
10
+ * PayU Latam: Improve error response [esmitperez] #3717
11
+ * Vantiv: Vantiv Express - CardPresentCode, PaymentType, SubmissionType, DuplicateCheckDisableFlag [esmitperez] #3730,#3731
12
+ * Cybersource: Ensure issueradditionaldata comes before partnerSolutionId [britth] #3733
13
+
5
14
  == Version 1.111.0
6
15
  * Fat Zebra: standardized 3DS fields and card on file extra data for Visa scheme rules [montdidier] #3409
7
16
  * Realex: Change 3DSecure v1 message_version to a valid format [shuhala] #3702
@@ -214,6 +214,7 @@ module ActiveMerchant #:nodoc:
214
214
  add_shopper_data(post, options)
215
215
  add_risk_data(post, options)
216
216
  add_shopper_reference(post, options)
217
+ add_merchant_data(post, options)
217
218
  end
218
219
 
219
220
  def add_shopper_data(post, options)
@@ -225,6 +226,10 @@ module ActiveMerchant #:nodoc:
225
226
  post[:additionalData][:updateShopperStatement] = options[:update_shopper_statement] if options[:update_shopper_statement]
226
227
  end
227
228
 
229
+ def add_merchant_data(post, options)
230
+ post[:additionalData][:subMerchantId] = options[:sub_merchant_id] if options[:sub_merchant_id]
231
+ end
232
+
228
233
  def add_risk_data(post, options)
229
234
  if (risk_data = options[:risk_data])
230
235
  risk_data = Hash[risk_data.map { |k, v| ["riskdata.#{k}", v] }]
@@ -30,9 +30,11 @@ module ActiveMerchant #:nodoc:
30
30
  ECI_BRAND_MAPPING = {
31
31
  visa: 'vbv',
32
32
  master: 'spa',
33
+ maestro: 'spa',
33
34
  american_express: 'aesk',
34
35
  jcb: 'js',
35
36
  discover: 'pb',
37
+ diners_club: 'pb',
36
38
  }.freeze
37
39
  DEFAULT_COLLECTION_INDICATOR = 2
38
40
 
@@ -278,10 +280,11 @@ module ActiveMerchant #:nodoc:
278
280
  add_threeds_services(xml, options)
279
281
  add_payment_network_token(xml) if network_tokenization?(creditcard_or_reference)
280
282
  add_business_rules_data(xml, creditcard_or_reference, options)
281
- add_stored_credential_options(xml, options)
283
+ add_stored_credential_subsequent_auth(xml, options)
282
284
  add_issuer_additional_data(xml, options)
283
- add_merchant_description(xml, options)
284
285
  add_partner_solution_id(xml)
286
+ add_stored_credential_options(xml, options)
287
+ add_merchant_description(xml, options)
285
288
 
286
289
  xml.target!
287
290
  end
@@ -322,17 +325,20 @@ module ActiveMerchant #:nodoc:
322
325
  add_mdd_fields(xml, options)
323
326
  if !payment_method_or_reference.is_a?(String) && card_brand(payment_method_or_reference) == 'check'
324
327
  add_check_service(xml)
328
+ add_issuer_additional_data(xml, options)
329
+ add_partner_solution_id(xml)
325
330
  else
326
331
  add_purchase_service(xml, payment_method_or_reference, options)
327
332
  add_threeds_services(xml, options)
328
333
  add_payment_network_token(xml) if network_tokenization?(payment_method_or_reference)
329
334
  add_business_rules_data(xml, payment_method_or_reference, options) unless options[:pinless_debit_card]
335
+ add_stored_credential_subsequent_auth(xml, options)
336
+ add_issuer_additional_data(xml, options)
337
+ add_partner_solution_id(xml)
330
338
  add_stored_credential_options(xml, options)
331
339
  end
332
340
 
333
- add_issuer_additional_data(xml, options)
334
341
  add_merchant_description(xml, options)
335
- add_partner_solution_id(xml)
336
342
 
337
343
  xml.target!
338
344
  end
@@ -843,20 +849,27 @@ module ActiveMerchant #:nodoc:
843
849
  country_code&.code(:alpha2)
844
850
  end
845
851
 
846
- def add_stored_credential_options(xml, options={})
852
+ def add_stored_credential_subsequent_auth(xml, options={})
847
853
  return unless options[:stored_credential] || options[:stored_credential_overrides]
848
854
 
849
855
  stored_credential_subsequent_auth = 'true' if options.dig(:stored_credential, :initiator) == 'merchant'
856
+
857
+ override_subsequent_auth = options.dig(:stored_credential_overrides, :subsequent_auth)
858
+
859
+ xml.subsequentAuth override_subsequent_auth.nil? ? stored_credential_subsequent_auth : override_subsequent_auth
860
+ end
861
+
862
+ def add_stored_credential_options(xml, options={})
863
+ return unless options[:stored_credential] || options[:stored_credential_overrides]
864
+
850
865
  stored_credential_subsequent_auth_first = 'true' if options.dig(:stored_credential, :initial_transaction)
851
866
  stored_credential_transaction_id = options.dig(:stored_credential, :network_transaction_id) if options.dig(:stored_credential, :initiator) == 'merchant'
852
867
  stored_credential_subsequent_auth_stored_cred = 'true' if options.dig(:stored_credential, :initiator) == 'cardholder' && !options.dig(:stored_credential, :initial_transaction) || options.dig(:stored_credential, :initiator) == 'merchant' && options.dig(:stored_credential, :reason_type) == 'unscheduled'
853
868
 
854
- override_subsequent_auth = options.dig(:stored_credential_overrides, :subsequent_auth)
855
869
  override_subsequent_auth_first = options.dig(:stored_credential_overrides, :subsequent_auth_first)
856
870
  override_subsequent_auth_transaction_id = options.dig(:stored_credential_overrides, :subsequent_auth_transaction_id)
857
871
  override_subsequent_auth_stored_cred = options.dig(:stored_credential_overrides, :subsequent_auth_stored_credential)
858
872
 
859
- xml.subsequentAuth override_subsequent_auth.nil? ? stored_credential_subsequent_auth : override_subsequent_auth
860
873
  xml.subsequentAuthFirst override_subsequent_auth_first.nil? ? stored_credential_subsequent_auth_first : override_subsequent_auth_first
861
874
  xml.subsequentAuthTransactionID override_subsequent_auth_transaction_id.nil? ? stored_credential_transaction_id : override_subsequent_auth_transaction_id
862
875
  xml.subsequentAuthStoredCredential override_subsequent_auth_stored_cred.nil? ? stored_credential_subsequent_auth_stored_cred : override_subsequent_auth_stored_cred
@@ -188,6 +188,10 @@ module ActiveMerchant #:nodoc:
188
188
  xml.TransactionAmount amount(money.to_i) if money
189
189
  xml.MarketCode 'Default' if money
190
190
  xml.ReferenceNumber options[:order_id] || SecureRandom.hex(20)
191
+
192
+ xml.PaymentType options[:payment_type] if options[:payment_type]
193
+ xml.SubmissionType options[:submission_type] if options[:submission_type]
194
+ xml.DuplicateCheckDisableFlag options[:duplicate_check_disable_flag].to_s == 'true' ? 'True' : 'False' unless options[:duplicate_check_disable_flag].nil?
191
195
  end
192
196
  end
193
197
 
@@ -274,7 +274,7 @@ module ActiveMerchant #:nodoc:
274
274
  doc.accType(payment_method.account_type.capitalize)
275
275
  doc.accNum(payment_method.account_number)
276
276
  doc.routingNum(payment_method.routing_number)
277
- doc.checkNum(payment_method.number)
277
+ doc.checkNum(payment_method.number) if payment_method.number
278
278
  end
279
279
  else
280
280
  doc.card do
@@ -391,11 +391,14 @@ module ActiveMerchant #:nodoc:
391
391
  else
392
392
  if response['transactionResponse']
393
393
  response_message = response['transactionResponse']['responseMessage']
394
+
394
395
  response_code = response['transactionResponse']['responseCode'] || response['transactionResponse']['pendingReason']
396
+
397
+ response_message = response_code + ' | ' + response['transactionResponse']['paymentNetworkResponseErrorMessage'] unless response['transactionResponse']['paymentNetworkResponseErrorMessage'].nil?
395
398
  end
396
399
  return response_code if success
397
400
 
398
- response['error'] || response_message || response_code || 'FAILED'
401
+ response_message || response['error'] || response_code || 'FAILED'
399
402
  end
400
403
  end
401
404
 
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = '1.111.0'
2
+ VERSION = '1.112.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.111.0
4
+ version: 1.112.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-08-04 00:00:00.000000000 Z
11
+ date: 2020-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport