activemerchant 1.92.0 → 1.93.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 +4 -4
- data/CHANGELOG +5 -1
- data/lib/active_merchant/billing/gateways/adyen.rb +2 -2
- data/lib/active_merchant/billing/gateways/stripe.rb +15 -28
- data/lib/active_merchant/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 077fd706902e893fc2824d409a604bc8512849f142e8503c6c1d2081f6fd64b4
|
4
|
+
data.tar.gz: 34a4a0385f319d09e2000ad4f150814f9b86a331b75941f594387ba7cb30c5b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bc0752fc32fb159b99aa2d0fe36fe3b7d2f1f3059945c76b30f80dad9a8d236f29e5ea5b7105636bb4de16398ae44b2dec13fac230dbc6380ff3496f0476a3c
|
7
|
+
data.tar.gz: 479edb7ec96840e1b05f89955f11fe2b89914dda0f8ebcd42428c40de80e84e93901b79d4549858aba3c95c308052b68412d9d6b984a154aaa3f636315b6e404
|
data/CHANGELOG
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
= ActiveMerchant CHANGELOG
|
2
2
|
|
3
3
|
== HEAD
|
4
|
+
== Version 1.93.0 (April 18, 2019)
|
5
|
+
* Stripe: Do not consider a refund unsuccessful if only refunding the fee failed [jasonwebster] #3188
|
6
|
+
* Stripe: Fix webhook creation for connected account [jknipp] #3193
|
7
|
+
* Adyen: Upgrade to v40 API version [davidsantoso] #3192
|
4
8
|
|
5
|
-
== Version 1.
|
9
|
+
== Version 1.92.0 (April 8, 2019)
|
6
10
|
* BluePay: Send customer IP address when provided [jknipp] #3149
|
7
11
|
* PaymentExpress: Use ip field for client_info field [jknipp] #3150
|
8
12
|
* Bambora Asia-Pacific: Adds Store [molbrown] #3147
|
@@ -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/
|
8
|
-
self.live_url = 'https://pal-live.adyen.com/pal/servlet/Payment/
|
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'
|
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'
|
@@ -150,14 +150,21 @@ module ActiveMerchant #:nodoc:
|
|
150
150
|
post[:reason] = options[:reason] if options[:reason]
|
151
151
|
post[:expand] = [:charge]
|
152
152
|
|
153
|
-
|
154
|
-
r.process { commit(:post, "charges/#{CGI.escape(identification)}/refunds", post, options) }
|
153
|
+
response = commit(:post, "charges/#{CGI.escape(identification)}/refunds", post, options)
|
155
154
|
|
156
|
-
|
157
|
-
|
158
|
-
|
155
|
+
if options[:refund_fee_amount] && options[:refund_fee_amount].to_s != '0'
|
156
|
+
charge = api_request(:get, "charges/#{CGI.escape(identification)}", nil, options)
|
157
|
+
|
158
|
+
if application_fee = charge['application_fee']
|
159
|
+
fee_refund_options = {
|
160
|
+
currency: options[:currency], # currency isn't used by Stripe here, but we need it for #add_amount
|
161
|
+
key: @fee_refund_api_key
|
162
|
+
}
|
163
|
+
refund_application_fee(options[:refund_fee_amount].to_i, application_fee, fee_refund_options)
|
159
164
|
end
|
160
165
|
end
|
166
|
+
|
167
|
+
response
|
161
168
|
end
|
162
169
|
|
163
170
|
def verify(payment, options = {})
|
@@ -168,21 +175,10 @@ module ActiveMerchant #:nodoc:
|
|
168
175
|
end
|
169
176
|
end
|
170
177
|
|
171
|
-
def application_fee_from_response(response)
|
172
|
-
return unless response.success?
|
173
|
-
response.params['application_fee'] unless response.params['application_fee'].empty?
|
174
|
-
end
|
175
|
-
|
176
178
|
def refund_application_fee(money, identification, options = {})
|
177
|
-
return Response.new(false, 'Application fee id could not be found') unless identification
|
178
|
-
|
179
179
|
post = {}
|
180
180
|
add_amount(post, money, options)
|
181
|
-
|
182
|
-
options.delete(:stripe_account)
|
183
|
-
|
184
|
-
refund_fee = commit(:post, "application_fees/#{CGI.escape(identification)}/refunds", post, options)
|
185
|
-
application_fee_response!(refund_fee, "Application fee could not be refunded: #{refund_fee.message}")
|
181
|
+
commit(:post, "application_fees/#{CGI.escape(identification)}/refunds", post, options)
|
186
182
|
end
|
187
183
|
|
188
184
|
# Note: creating a new credit card will not change the customer's existing default credit card (use :set_default => true)
|
@@ -317,6 +313,8 @@ module ActiveMerchant #:nodoc:
|
|
317
313
|
post = {}
|
318
314
|
post[:url] = options[:callback_url]
|
319
315
|
post[:enabled_events] = events
|
316
|
+
post[:connect] = true if options[:stripe_account]
|
317
|
+
options.delete(:stripe_account)
|
320
318
|
commit(:post, 'webhook_endpoints', post, options)
|
321
319
|
end
|
322
320
|
|
@@ -516,17 +514,6 @@ module ActiveMerchant #:nodoc:
|
|
516
514
|
post[:metadata][:card_read_method] = creditcard.read_method if creditcard.respond_to?(:read_method)
|
517
515
|
end
|
518
516
|
|
519
|
-
def fetch_application_fee(identification, options = {})
|
520
|
-
options[:key] = @fee_refund_api_key
|
521
|
-
|
522
|
-
fetch_charge = commit(:get, "charges/#{CGI.escape(identification)}", nil, options)
|
523
|
-
application_fee_response!(fetch_charge, "Application fee id could not be retrieved: #{fetch_charge.message}")
|
524
|
-
end
|
525
|
-
|
526
|
-
def application_fee_response!(response, message)
|
527
|
-
response.success? ? response : Response.new(false, message)
|
528
|
-
end
|
529
|
-
|
530
517
|
def parse(body)
|
531
518
|
JSON.parse(body)
|
532
519
|
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.
|
4
|
+
version: 1.93.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-04-
|
11
|
+
date: 2019-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|