diff --git a/app/Http/Controllers/CompanyGatewayController.php b/app/Http/Controllers/CompanyGatewayController.php index 8d69b3738a1c..fab62b6164c1 100644 --- a/app/Http/Controllers/CompanyGatewayController.php +++ b/app/Http/Controllers/CompanyGatewayController.php @@ -565,9 +565,11 @@ class CompanyGatewayController extends BaseController public function importCustomers(TestCompanyGatewayRequest $request, CompanyGateway $company_gateway) { + // $x = Cache::pull("throttle_polling:import_customers:{$company_gateway->company->company_key}:{$company_gateway->hashed_id}"); + //Throttle here - // if (Cache::get("throttle_polling:import_customers:{$company_gateway->company->company_key}:{$company_gateway->hashed_id}")) - // return response()->json(['message' => ctrans('texts.import_started')], 200); + if (Cache::has("throttle_polling:import_customers:{$company_gateway->company->company_key}:{$company_gateway->hashed_id}")) + return response()->json(['message' => 'Please wait whilst your previous attempts complete.'], 200); dispatch(function () use($company_gateway) { MultiDB::setDb($company_gateway->company->db); diff --git a/app/PaymentDrivers/Authorize/AuthorizeCustomer.php b/app/PaymentDrivers/Authorize/AuthorizeCustomer.php index a9fd927294da..9a4d2f5765b1 100644 --- a/app/PaymentDrivers/Authorize/AuthorizeCustomer.php +++ b/app/PaymentDrivers/Authorize/AuthorizeCustomer.php @@ -103,7 +103,7 @@ class AuthorizeCustomer } else { // nlog("creating client"); - $first_payment_profile = $profile['payment_profiles'][0]; + $first_payment_profile = &$profile['payment_profiles'][0]; if (! $first_payment_profile) { continue; diff --git a/app/PaymentDrivers/AuthorizePaymentDriver.php b/app/PaymentDrivers/AuthorizePaymentDriver.php index 87c74fdb9209..0e8c820d133f 100644 --- a/app/PaymentDrivers/AuthorizePaymentDriver.php +++ b/app/PaymentDrivers/AuthorizePaymentDriver.php @@ -195,6 +195,8 @@ class AuthorizePaymentDriver extends BaseDriver { $this->init(); + nlog("starting import auth.net"); + return (new AuthorizeCustomer($this))->importCustomers(); }