Closed miguelpeixe closed 2 years ago
This is in a case of an error – do you have steps to reproduce to trigger an error there?
This is in a case of an error
Indeed, an unhandled one.
do you have steps to reproduce to trigger an error there?
The unhandled error is this: Could not fetch invoice.
If the invoice is "optional" it should identify that is_wp_error()
and bail. If not, we should figure out why the invoice is missing.
Newspack\Stripe_Connection::get_invoice()
returns an error. However, it doesn't address the cause of the original error, and it's not clear to me whether we need to fix that. We have a live site which is experiencing a lot of such errors in their webhooks, so I'll plan to install #2103 on their site early next week to see if we can better diagnose the actual error.It looks like the invoice is created when a subscription is. So one-time transactions will not get the invoice ID in the webhook payload.
Resolved in #2103. The invoice is optional, as described in my previous comment.
Submitting a donation using the streamlined SDB (Stripe) is causing a fatal error on the Stripe webhook request:
Looks like the
Newspack\Stripe_Connection::get_invoice()
method is returningWP_Error
, which is not being handled byNewspack\Stripe_Connection::create_wc_transaction_payload()