mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2026-03-03 02:47:02 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user