Fix error with payment methods

This commit is contained in:
Hillel Coren 2016-09-19 13:29:56 +03:00
parent 8d0adbde61
commit cb44f8e9a6

View File

@ -557,6 +557,7 @@ class BasePaymentDriver
$paymentMethod->setRelation('account_gateway_token', $customer);
$paymentMethod = $this->creatingPaymentMethod($paymentMethod);
if ($paymentMethod) {
// archive the old payment method
$oldPaymentMethod = PaymentMethod::clientId($this->client()->id)
->wherePaymentTypeId($paymentMethod->payment_type_id)
@ -566,7 +567,6 @@ class BasePaymentDriver
$oldPaymentMethod->delete();
}
if ($paymentMethod) {
$paymentMethod->save();
}