[ad_1]
Trying to initialize Stripe and create an event object in WordPress. Upon receipt of a webhook callback, Stripe fails to verify the response and returns the error, No signatures found matching the expected signature for payload
.
$webhookSecret = defined('STRIPE_WEBHOOK_SECRET') ? STRIPE_WEBHOOK_SECRET : false;
try {
$event = \Stripe\Webhook::constructEvent(
$request->get_body(),
$request->get_header('stripe-signature'),
$webhookSecret
);
error_log("initialized stripe event object");
} catch (\Exception $e) {
error_log("failed to initialize stripe event object");
error_log($e->getMessage());
return new WP_Error(403, 'error', __('message', $e->getMessage()));
}
[ad_2]