Filter
rpress_payments_stripe_webhook_unhandled
On this page
Filters the result string for Stripe webhook events RestroPress does not handle.
Runs at the end of rpress_payments_stripe_dispatch_event() for event types that the core switch does not handle (the handled ones are checkout session events, payment intent success and failure, and charge.refunded). The returned string is used for logs and tests. Handle the event yourself here and return a short description of what happened.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$value | string | Default result. |
$event | array | Decoded Stripe event. |
Return value#
string. Short description of what happened.
Example#
function my_stripe_unhandled( $result, $event ) {
if ( 'customer.created' === $event['type'] ) {
return 'customer_logged';
}
return $result;
}
add_filter( 'rpress_payments_stripe_webhook_unhandled', 'my_stripe_unhandled', 10, 2 );
Source#
Applied in:
includes/features/payments/stripe-webhooks.php(line 254), inrpress_payments_stripe_dispatch_event()
See also#
Was this page helpful?
