Closed Prometee closed 2 years ago
Merging #23 (ada4ddc) into master (6072ba8) will increase coverage by
0.00%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #23 +/- ##
=========================================
Coverage 99.74% 99.75%
- Complexity 398 408 +10
=========================================
Files 105 107 +2
Lines 1192 1221 +29
=========================================
+ Hits 1189 1218 +29
Misses 3 3
Impacted Files | Coverage Δ | |
---|---|---|
.../Action/Api/WebhookEvent/AbstractPaymentAction.php | 97.77% <ø> (ø) |
|
src/Action/EmbeddableTokenTrait.php | 100.00% <ø> (ø) |
|
src/Action/NotifyAction.php | 100.00% <ø> (ø) |
|
src/Action/StatusAction.php | 100.00% <ø> (ø) |
|
src/AbstractStripeGatewayFactory.php | 100.00% <100.00%> (ø) |
|
src/Action/Api/ResolveWebhookEventAction.php | 100.00% <100.00%> (ø) |
|
src/Action/Api/Resource/AllInvoiceAction.php | 100.00% <100.00%> (ø) |
|
src/Action/StatusSessionAction.php | 100.00% <100.00%> (ø) |
|
...kEvent/CheckoutSessionAsyncPaymentFailedAction.php | 100.00% <100.00%> (ø) |
|
...ent/CheckoutSessionAsyncPaymentSucceededAction.php | 100.00% <100.00%> (ø) |
|
... and 2 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 6072ba8...ada4ddc. Read the comment docs.
This PR aim to change the behaviour of the subscription handle by a
Session
to improve async payment status if you are using for example SEPA direct debit with subscriptions.Two new webhooks are available on Stripe :
checkout.session.async_payment_failed
checkout.session.async_payment_succeeded
They allow us to know if a
PaymentIntent
has failed or succeeded when they have been created by a Stripe CheckoutSession
.In case of
Session
modepayment
, nothing change because this library willSync
thePaymentIntent
inside theSession
object waiting forcheckout.session.completed
,checkout.session.async_payment_*
,payment_intent.succeeded
or apayment_intent.canceled
event which trigger anotherSync
.In case of
Session
modesetup
, nothing change because this library willSync
theSetupIntent
inside theSession
object waiting forcheckout.session.completed
,setup_intent.succeeded
or asetup_intent.canceled
event which trigger anotherSync
.In case of
Session
modesubscription
, this library will no longerSync
aSession
object to aSubscription
one. Instead it will keep aSession
object and wait forcheckout.session.completed
orcheckout.session.async_payment_*
event. Thing is Stripe API is not changing any field of theSession
object when theSession
iscompleted
,unpaid
and an async payment failed (happen whencheckout.session.async_payment_failed
webhook is triggered), that's why this library will try to get the underlyingPaymentIntent
of the createdSubscription
(Subscription->Last Invoice->PaymentIntent) and see if it has failed or not, to finally update the PayumPayment
status.