billing: asynchrone Zahlarten (PayPal, SEPA) korrekt erfüllen
checkout.session.completed feuert bei asynchronen Zahlarten schon nach dem Redirect mit payment_status=unpaid — der Listener hat trotzdem sofort erfüllt (Credits gutgeschrieben / Kauf bezahlt), auch wenn die Zahlung später scheitert. Erfüllung jetzt nur bei payment_status paid/no_payment_required, zusätzlich reagiert der Listener auf checkout.session.async_payment_succeeded; Fehlschläge werden geloggt, der Kauf bleibt wiederholbar auf Pending. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
67f6906b87
commit
425467bbec
4 changed files with 95 additions and 1 deletions
|
|
@ -89,6 +89,7 @@ test('the checkout webhook credits the wallet from session metadata', function (
|
|||
'data' => ['object' => [
|
||||
'id' => 'cs_test_hook',
|
||||
'payment_intent' => 'pi_test_hook',
|
||||
'payment_status' => 'paid',
|
||||
'metadata' => ['credit_topup_id' => (string) $topup->id],
|
||||
]],
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue