mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 17:54:30 -04:00
Merge pull request #7992 from turbo124/v5-develop
Wind back configuration changes
This commit is contained in:
commit
f7e9de9c6a
@ -26,6 +26,7 @@ use App\PaymentDrivers\StripePaymentDriver;
|
||||
use App\Utils\Ninja;
|
||||
use App\Utils\Traits\GeneratesCounter;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Stripe\Customer;
|
||||
use Stripe\PaymentMethod;
|
||||
|
||||
@ -37,6 +38,8 @@ class ImportCustomers
|
||||
/** @var StripePaymentDriver */
|
||||
public $stripe;
|
||||
|
||||
private bool $completed = true;
|
||||
|
||||
public $update_payment_methods;
|
||||
|
||||
public function __construct(StripePaymentDriver $stripe)
|
||||
@ -64,9 +67,14 @@ class ImportCustomers
|
||||
}
|
||||
|
||||
//handle
|
||||
if(is_array($customers->data) && end($customers->data) && array_key_exists('id', end($customers->data)))
|
||||
$starting_after = end($customers->data)['id'];
|
||||
else
|
||||
// if(is_array($customers->data) && end($customers->data) && array_key_exists('id', end($customers->data)))
|
||||
// $starting_after = end($customers->data)['id'];
|
||||
// else
|
||||
// break;
|
||||
|
||||
$starting_after = isset(end($customers->data)['id']) ? end($customers->data)['id'] : false;
|
||||
|
||||
if(!$starting_after)
|
||||
break;
|
||||
|
||||
} while ($customers->has_more);
|
||||
@ -132,10 +140,30 @@ class ImportCustomers
|
||||
$client->name = $customer->name ? $customer->name : $customer->email;
|
||||
|
||||
if (! isset($client->number) || empty($client->number)) {
|
||||
$client->number = $this->getNextClientNumber($client);
|
||||
}
|
||||
|
||||
$x = 1;
|
||||
|
||||
do {
|
||||
try {
|
||||
$client->number = $this->getNextClientNumber($client);
|
||||
$client->saveQuietly();
|
||||
|
||||
$this->completed = false;
|
||||
} catch (QueryException $e) {
|
||||
$x++;
|
||||
|
||||
if ($x > 10) {
|
||||
$this->completed = false;
|
||||
}
|
||||
}
|
||||
} while ($this->completed);
|
||||
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
$client->save();
|
||||
}
|
||||
|
||||
$contact = ClientContactFactory::create($client->company_id, $client->user_id);
|
||||
$contact->client_id = $client->id;
|
||||
|
@ -138,6 +138,9 @@ class PaymentIntentWebhook implements ShouldQueue
|
||||
|
||||
$hash = isset($charge['metadata']['payment_hash']) ? $charge['metadata']['payment_hash'] : false;
|
||||
|
||||
if(!$hash)
|
||||
return;
|
||||
|
||||
$payment_hash = PaymentHash::where('hash', $hash)->first();
|
||||
|
||||
if(!$payment_hash)
|
||||
|
@ -211,5 +211,4 @@ return [
|
||||
'dev_mode' => env("YODLEE_DEV_MODE", false),
|
||||
'config_name' => env("YODLEE_CONFIG_NAME", false),
|
||||
],
|
||||
'dbs' => ['db-ninja-01','db-ninja-02']
|
||||
];
|
@ -67,7 +67,7 @@ return [
|
||||
'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
|
||||
'queue' => env('REDIS_QUEUE', 'default'),
|
||||
'retry_after' => 90000000,
|
||||
'block_for' => 1,
|
||||
'block_for' => null,
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user