activemerchant 1.94.0 → 1.95.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: 5a2728fa6c7116ab636feb7ba715c2e4d5305fb54898d1687d633cbfb2a4795f
4
- data.tar.gz: d63425c0a65919bc4a2a007d41b145a355a341667be616ae8fc0337ce2d8d145
3
+ metadata.gz: 0af5c8a759df2f80d48246fe7d1c71bff144e2e4916ccf47aad3a96f79820f79
4
+ data.tar.gz: 5f2865f068ee003ea07f304f64894800ed870f32020b71f73c06e3d422508f1c
5
5
  SHA512:
6
- metadata.gz: f577b5623169e0e7a1a12f4f2fa212517fba33a5ec40fb61a8e14c9df629939a4e31ed6a24ed9fabe783404553ff98ff8bdb5f0fabdc3c9da8fe8bc31c8ad97f
7
- data.tar.gz: 2d37c0742319a5533236acaeb9e885692b8610208d540adda49dc21147584a3dbc50ba28632d014fb7d280d4ff9202032e5fe05dde1b1741eabf4889e9a08a42
6
+ metadata.gz: 7b341fa74b52b79347fc60ab22e3953616ff0cba341f1564b39f0174c3821d241ae7d63e5965151d73d16d13a1fb40a2175c01b6b27a2d32355f6adc18b61f2f
7
+ data.tar.gz: 119cece41b0a7c469be3df3c6db040d67de82f82c389fd3b5695300d361cdd37b0b70e2d1ad1e8604a61802b9e8dd3159fef92b158bdce35238c40a98157df47
data/CHANGELOG CHANGED
@@ -1,6 +1,12 @@
1
1
  = ActiveMerchant CHANGELOG
2
2
 
3
3
  == HEAD
4
+
5
+ == Version 1.95.0 (May 23, 2019)
6
+ * Adyen: Constantize version to fix subdomains [curiousepic] #3228
7
+ * Qvalent: Adds support for standard stored credential framework [molbrown] #3227
8
+ * Cybersource: Send tokenization data when card is :master [pi3r] #3230
9
+
4
10
  == Version 1.94.0 (May 21, 2019)
5
11
  * Mundipagg: Fix number lengths for both VR and Sodexo [dtykocki] #3195
6
12
  * Stripe: Support show and list webhook endpoints [jknipp] #3196
@@ -16,7 +22,7 @@
16
22
  * WorldPay: Support Unknown Card Type [tanyajajodia] #3213
17
23
  * Mundipagg: Make gateway_affiliation_id an option [curiousepic] #3219
18
24
  * CyberSource: Adds Elo Card Type [tanyajajodia] #3220
19
- * CyberSource: Support standalone credit for cards [curiousepic] 3225
25
+ * CyberSource: Support standalone credit for cards [curiousepic] #3225
20
26
 
21
27
  == Version 1.93.0 (April 18, 2019)
22
28
  * Stripe: Do not consider a refund unsuccessful if only refunding the fee failed [jasonwebster] #3188
@@ -4,8 +4,8 @@ module ActiveMerchant #:nodoc:
4
4
 
5
5
  # we recommend setting up merchant-specific endpoints.
6
6
  # https://docs.adyen.com/developers/api-manual#apiendpoints
7
- self.test_url = 'https://pal-test.adyen.com/pal/servlet/Payment/v40'
8
- self.live_url = 'https://pal-live.adyen.com/pal/servlet/Payment/v40'
7
+ self.test_url = 'https://pal-test.adyen.com/pal/servlet/Payment/'
8
+ self.live_url = 'https://pal-live.adyen.com/pal/servlet/Payment/'
9
9
 
10
10
  self.supported_countries = ['AT', 'AU', 'BE', 'BG', 'BR', 'CH', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GB', 'GI', 'GR', 'HK', 'HU', 'IE', 'IS', 'IT', 'LI', 'LT', 'LU', 'LV', 'MC', 'MT', 'MX', 'NL', 'NO', 'PL', 'PT', 'RO', 'SE', 'SG', 'SK', 'SI', 'US']
11
11
  self.default_currency = 'USD'
@@ -16,6 +16,8 @@ module ActiveMerchant #:nodoc:
16
16
  self.homepage_url = 'https://www.adyen.com/'
17
17
  self.display_name = 'Adyen'
18
18
 
19
+ API_VERSION = 'v40'
20
+
19
21
  STANDARD_ERROR_CODE_MAPPING = {
20
22
  '101' => STANDARD_ERROR_CODE[:incorrect_number],
21
23
  '103' => STANDARD_ERROR_CODE[:invalid_cvc],
@@ -375,11 +377,11 @@ module ActiveMerchant #:nodoc:
375
377
 
376
378
  def url
377
379
  if test?
378
- test_url
380
+ "#{test_url}#{API_VERSION}"
379
381
  elsif @options[:subdomain]
380
- "https://#{@options[:subdomain]}-pal-live.adyenpayments.com/pal/servlet/Payment/v18"
382
+ "https://#{@options[:subdomain]}-pal-live.adyenpayments.com/pal/servlet/Payment/#{API_VERSION}"
381
383
  else
382
- live_url
384
+ "#{live_url}#{API_VERSION}"
383
385
  end
384
386
  end
385
387
 
@@ -550,7 +550,7 @@ module ActiveMerchant #:nodoc:
550
550
  xml.tag!('commerceIndicator', 'vbv')
551
551
  xml.tag!('xid', payment_method.payment_cryptogram)
552
552
  end
553
- when :mastercard
553
+ when :master
554
554
  xml.tag! 'ucaf' do
555
555
  xml.tag!('authenticationData', payment_method.payment_cryptogram)
556
556
  xml.tag!('collectionIndicator', '2')
@@ -27,6 +27,7 @@ module ActiveMerchant #:nodoc:
27
27
  add_order_number(post, options)
28
28
  add_payment_method(post, payment_method)
29
29
  add_verification_value(post, payment_method)
30
+ add_stored_credential_data(post, payment_method, options)
30
31
  add_customer_data(post, options)
31
32
  add_soft_descriptors(post, options)
32
33
 
@@ -39,6 +40,7 @@ module ActiveMerchant #:nodoc:
39
40
  add_order_number(post, options)
40
41
  add_payment_method(post, payment_method)
41
42
  add_verification_value(post, payment_method)
43
+ add_stored_credential_data(post, payment_method, options)
42
44
  add_customer_data(post, options)
43
45
  add_soft_descriptors(post, options)
44
46
 
@@ -61,6 +63,7 @@ module ActiveMerchant #:nodoc:
61
63
  add_reference(post, authorization, options)
62
64
  add_customer_data(post, options)
63
65
  add_soft_descriptors(post, options)
66
+ post['order.ECI'] = options[:eci] || 'SSL'
64
67
 
65
68
  commit('refund', post)
66
69
  end
@@ -124,7 +127,6 @@ module ActiveMerchant #:nodoc:
124
127
  def add_invoice(post, money, options)
125
128
  post['order.amount'] = amount(money)
126
129
  post['card.currency'] = CURRENCY_CODES[options[:currency] || currency(money)]
127
- post['order.ECI'] = options[:eci] || 'SSL'
128
130
  end
129
131
 
130
132
  def add_payment_method(post, payment_method)
@@ -134,6 +136,46 @@ module ActiveMerchant #:nodoc:
134
136
  post['card.expiryMonth'] = format(payment_method.month, :two_digits)
135
137
  end
136
138
 
139
+ def add_stored_credential_data(post, payment_method, options)
140
+ post['order.ECI'] = options[:eci] || eci(options)
141
+ if (stored_credential = options[:stored_credential]) && %w(visa master).include?(payment_method.brand)
142
+ post['card.posEntryMode'] = stored_credential[:initial_transaction] ? 'MANUAL' : 'STORED_CREDENTIAL'
143
+ stored_credential_usage(post, payment_method, options) unless stored_credential[:initiator] && stored_credential[:initiator] == 'cardholder'
144
+ post['order.authTraceId'] = stored_credential[:network_transaction_id] if stored_credential[:network_transaction_id]
145
+ end
146
+ end
147
+
148
+ def stored_credential_usage(post, payment_method, options)
149
+ return unless payment_method.brand == 'visa'
150
+ stored_credential = options[:stored_credential]
151
+ if stored_credential[:initial_transaction]
152
+ post['card.storedCredentialUsage'] = 'INITIAL_STORAGE'
153
+ elsif stored_credential[:reason_type] == ('recurring' || 'installment')
154
+ post['card.storedCredentialUsage'] = 'RECURRING'
155
+ elsif stored_credential[:reason_type] == 'unscheduled'
156
+ post['card.storedCredentialUsage'] = 'UNSCHEDULED'
157
+ end
158
+ end
159
+
160
+ def eci(options)
161
+ if options.dig(:stored_credential, :initial_transaction)
162
+ 'SSL'
163
+ elsif options.dig(:stored_credential, :initiator) && options[:stored_credential][:initiator] == 'cardholder'
164
+ 'MTO'
165
+ elsif options.dig(:stored_credential, :reason_type)
166
+ case options[:stored_credential][:reason_type]
167
+ when 'recurring'
168
+ 'REC'
169
+ when 'installment'
170
+ 'INS'
171
+ when 'unscheduled'
172
+ 'MTO'
173
+ end
174
+ else
175
+ 'SSL'
176
+ end
177
+ end
178
+
137
179
  def add_verification_value(post, payment_method)
138
180
  post['card.CVN'] = payment_method.verification_value
139
181
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = '1.94.0'
2
+ VERSION = '1.95.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.94.0
4
+ version: 1.95.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: 2019-05-21 00:00:00.000000000 Z
11
+ date: 2019-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport