1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Set default payment method when inserting first record

This commit is contained in:
David Bomba 2019-09-19 21:31:49 +10:00
parent 970809f248
commit 85c645fbeb

View File

@ -175,7 +175,9 @@ class StripePaymentDriver extends BasePaymentDriver
$cgt->save();
if($is_default == 'true')
\Log::error('number of tokens = '. $this->client->gateway_tokens->count());
if($is_default == 'true' || $this->client->gateway_tokens->count() == 1)
{
$this->client->gateway_tokens()->update(['is_default'=>0]);