mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Fix error with payment methods
This commit is contained in:
parent
8d0adbde61
commit
cb44f8e9a6
@ -557,16 +557,16 @@ class BasePaymentDriver
|
||||
$paymentMethod->setRelation('account_gateway_token', $customer);
|
||||
$paymentMethod = $this->creatingPaymentMethod($paymentMethod);
|
||||
|
||||
// archive the old payment method
|
||||
$oldPaymentMethod = PaymentMethod::clientId($this->client()->id)
|
||||
->wherePaymentTypeId($paymentMethod->payment_type_id)
|
||||
->first();
|
||||
|
||||
if ($oldPaymentMethod) {
|
||||
$oldPaymentMethod->delete();
|
||||
}
|
||||
|
||||
if ($paymentMethod) {
|
||||
// archive the old payment method
|
||||
$oldPaymentMethod = PaymentMethod::clientId($this->client()->id)
|
||||
->wherePaymentTypeId($paymentMethod->payment_type_id)
|
||||
->first();
|
||||
|
||||
if ($oldPaymentMethod) {
|
||||
$oldPaymentMethod->delete();
|
||||
}
|
||||
|
||||
$paymentMethod->save();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user