Merge pull request #7992 from turbo124/v5-develop

Wind back configuration changes
This commit is contained in:
David Bomba 2022-11-27 18:48:39 +11:00 committed by GitHub
commit f7e9de9c6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 9 deletions

View File

@ -26,6 +26,7 @@ use App\PaymentDrivers\StripePaymentDriver;
use App\Utils\Ninja; use App\Utils\Ninja;
use App\Utils\Traits\GeneratesCounter; use App\Utils\Traits\GeneratesCounter;
use App\Utils\Traits\MakesHash; use App\Utils\Traits\MakesHash;
use Illuminate\Database\QueryException;
use Stripe\Customer; use Stripe\Customer;
use Stripe\PaymentMethod; use Stripe\PaymentMethod;
@ -37,6 +38,8 @@ class ImportCustomers
/** @var StripePaymentDriver */ /** @var StripePaymentDriver */
public $stripe; public $stripe;
private bool $completed = true;
public $update_payment_methods; public $update_payment_methods;
public function __construct(StripePaymentDriver $stripe) public function __construct(StripePaymentDriver $stripe)
@ -64,9 +67,14 @@ class ImportCustomers
} }
//handle //handle
if(is_array($customers->data) && end($customers->data) && array_key_exists('id', end($customers->data))) // if(is_array($customers->data) && end($customers->data) && array_key_exists('id', end($customers->data)))
$starting_after = end($customers->data)['id']; // $starting_after = end($customers->data)['id'];
else // else
// break;
$starting_after = isset(end($customers->data)['id']) ? end($customers->data)['id'] : false;
if(!$starting_after)
break; break;
} while ($customers->has_more); } while ($customers->has_more);
@ -132,10 +140,30 @@ class ImportCustomers
$client->name = $customer->name ? $customer->name : $customer->email; $client->name = $customer->name ? $customer->name : $customer->email;
if (! isset($client->number) || empty($client->number)) { if (! isset($client->number) || empty($client->number)) {
$client->number = $this->getNextClientNumber($client);
}
$client->save(); $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 = ClientContactFactory::create($client->company_id, $client->user_id);
$contact->client_id = $client->id; $contact->client_id = $client->id;

View File

@ -138,6 +138,9 @@ class PaymentIntentWebhook implements ShouldQueue
$hash = isset($charge['metadata']['payment_hash']) ? $charge['metadata']['payment_hash'] : false; $hash = isset($charge['metadata']['payment_hash']) ? $charge['metadata']['payment_hash'] : false;
if(!$hash)
return;
$payment_hash = PaymentHash::where('hash', $hash)->first(); $payment_hash = PaymentHash::where('hash', $hash)->first();
if(!$payment_hash) if(!$payment_hash)

View File

@ -211,5 +211,4 @@ return [
'dev_mode' => env("YODLEE_DEV_MODE", false), 'dev_mode' => env("YODLEE_DEV_MODE", false),
'config_name' => env("YODLEE_CONFIG_NAME", false), 'config_name' => env("YODLEE_CONFIG_NAME", false),
], ],
'dbs' => ['db-ninja-01','db-ninja-02'] ];
];

View File

@ -67,7 +67,7 @@ return [
'connection' => env('REDIS_QUEUE_CONNECTION', 'default'), 'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
'queue' => env('REDIS_QUEUE', 'default'), 'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => 90000000, 'retry_after' => 90000000,
'block_for' => 1, 'block_for' => null,
'after_commit' => false, 'after_commit' => false,
], ],