Refactor StripePaymentDriver webhook handling

Removed assignment of webhook_secret and fixed syntax error in webhook event construction.

Signed-off-by: TechNoNerd87 <113461509+TechNoNerd87@users.noreply.github.com>
This commit is contained in:
TechNoNerd87 2025-11-29 16:24:11 -06:00 committed by GitHub
parent 359abcfb5c
commit 8a6bfcd0a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 3 deletions

View File

@ -133,7 +133,6 @@ class StripePaymentDriver extends BaseDriver implements SupportsHeadlessInterfac
Stripe::setApiKey($this->company_gateway->getConfigField('apiKey'));
Stripe::setAPiVersion('2023-10-16');
}
$this->webhook_secret = $this->company_gateway->getConfigField('webhookSecret');
return $this;
}
@ -717,12 +716,11 @@ class StripePaymentDriver extends BaseDriver implements SupportsHeadlessInterfac
$request->getContent(),
$sig_header,
$webhook_secret
};
);
} catch (\Stripe\Exception\SignatureVerificationException $e) {
nlog("Stripe webhook signature verification failed: " . $e->getMessage());
return response()->json(['error' => 'Invalid signature'], 403);
}
}
if ($request->type === 'customer.source.updated') {
$ach = new ACH($this);