mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 20:24:30 -04:00
Fixes for webhook
This commit is contained in:
parent
0fe89ecf96
commit
dd1634a807
@ -749,7 +749,7 @@ class StripePaymentDriver extends BaseDriver
|
||||
return response()->json([], 200);
|
||||
} elseif ($request->type === "mandate.updated"){
|
||||
// Check if payment method BACS is still valid
|
||||
if ($request->data['status'] === "active"){
|
||||
if ($request->data['object']['status'] === "active"){
|
||||
// Check if payment method exists
|
||||
$clientgateway = ClientGatewayToken::query()
|
||||
->where('token', $request->data->payment_method)
|
||||
@ -759,14 +759,14 @@ class StripePaymentDriver extends BaseDriver
|
||||
$clientgateway->save();
|
||||
}
|
||||
}
|
||||
elseif ($request->data['status'] === "inactive"){
|
||||
elseif ($request->data['object']['status'] === "inactive"){
|
||||
// Deactivate payment method
|
||||
$clientgateway = ClientGatewayToken::query()
|
||||
->where('token', $request->data->payment_method)
|
||||
->first();
|
||||
$clientgateway->delete();
|
||||
}
|
||||
elseif ($request->data['status'] === "pending"){
|
||||
elseif ($request->data['object']['status'] === "pending"){
|
||||
// Do nothing
|
||||
}
|
||||
return response()->json([], 200);
|
||||
|
Loading…
x
Reference in New Issue
Block a user