pay 6.0.2 → 6.0.3
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/lib/pay/stripe/subscription.rb +10 -2
- data/lib/pay/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1ffb1d86e804cae26df541cde3e1798a316c6176c271b1da5de66031f5ed99cc
|
|
4
|
+
data.tar.gz: a4fd5b34c5f873ef9c47d222688206ea318890cedc747c9059014001934f1c87
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d3c872342b43c5fa0ebc2aa797b7a145bdb99e310fd0db1019b6c19b9fe536fe8e242142ee5dc26edbf94a4bcdfca4e9b3aa7bb78444d1b1f3f3c35e3a2d236a
|
|
7
|
+
data.tar.gz: c3df896c8ba0056fcb0549c19e7b603322710ccf977832030414f2bfed5c0b14ed60a0574cf50ce237feaa56cc5bcab932cf6cc956fc0b33321d7d8117a6842b
|
|
@@ -261,6 +261,11 @@ module Pay
|
|
|
261
261
|
stripe_options
|
|
262
262
|
)
|
|
263
263
|
|
|
264
|
+
# Validate that swap was successful and handle SCA if needed
|
|
265
|
+
if (payment_intent = @stripe_subscription.latest_invoice.payment_intent)
|
|
266
|
+
Pay::Payment.new(payment_intent).validate
|
|
267
|
+
end
|
|
268
|
+
|
|
264
269
|
pay_subscription.sync!(object: @stripe_subscription)
|
|
265
270
|
rescue ::Stripe::StripeError => e
|
|
266
271
|
raise Pay::Stripe::Error, e
|
|
@@ -295,9 +300,12 @@ module Pay
|
|
|
295
300
|
::Stripe::Invoice.upcoming(options.merge(subscription: processor_id), stripe_options)
|
|
296
301
|
end
|
|
297
302
|
|
|
298
|
-
# Retries the latest invoice for a Past Due subscription
|
|
303
|
+
# Retries the latest invoice for a Past Due subscription and attempts to pay it
|
|
299
304
|
def retry_failed_payment
|
|
300
|
-
subscription.latest_invoice.
|
|
305
|
+
payment_intent = ::Stripe::PaymentIntent.confirm(subscription.latest_invoice.payment_intent.id)
|
|
306
|
+
Pay::Payment.new(payment_intent).validate
|
|
307
|
+
rescue ::Stripe::StripeError => e
|
|
308
|
+
raise Pay::Stripe::Error, e
|
|
301
309
|
end
|
|
302
310
|
|
|
303
311
|
private
|
data/lib/pay/version.rb
CHANGED