diff --git a/app/Http/Controllers/SetupController.php b/app/Http/Controllers/SetupController.php index b1e2a1b41838..48d3dfda84f6 100644 --- a/app/Http/Controllers/SetupController.php +++ b/app/Http/Controllers/SetupController.php @@ -291,7 +291,9 @@ class SetupController extends Controller Artisan::call('migrate', ['--force' => true]); Artisan::call('db:seed', ['--force' => true]); - return redirect('/?clear_cache=true'); + $this->buildCache(true); + + return redirect('/'); } } diff --git a/app/Http/Controllers/StripeConnectController.php b/app/Http/Controllers/StripeConnectController.php index e6d12a02f852..b24743fafc89 100644 --- a/app/Http/Controllers/StripeConnectController.php +++ b/app/Http/Controllers/StripeConnectController.php @@ -32,7 +32,8 @@ class StripeConnectController extends BaseController // Should we check if company has set country in the ap? Otherwise this will fail. if(!is_array($request->getTokenContent())) - throw new \Exception('Invalid token'); + abort(400, 'Invalid token'); + MultiDB::findAndSetDbByCompanyKey($request->getTokenContent()['company_key']); @@ -55,7 +56,7 @@ class StripeConnectController extends BaseController $link = Account::link($account->id, $token); - $company_gateway = CompanyGatewayFactory::create($request->getCompany()->id, $request->getContact()->client->user->id); + $company_gateway = CompanyGatewayFactory::create($request->getCompany()->id, $request->getContact()->id); $company_gateway->fill([ 'gateway_key' => 'd14dd26a47cecc30fdd65700bfb67b34', diff --git a/app/Http/Requests/StripeConnect/InitializeStripeConnectRequest.php b/app/Http/Requests/StripeConnect/InitializeStripeConnectRequest.php index 0805aacd71b4..ca0bd52d201b 100644 --- a/app/Http/Requests/StripeConnect/InitializeStripeConnectRequest.php +++ b/app/Http/Requests/StripeConnect/InitializeStripeConnectRequest.php @@ -14,6 +14,7 @@ namespace App\Http\Requests\StripeConnect; use App\Models\ClientContact; use App\Models\Company; +use App\Models\User; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Cache; @@ -55,7 +56,7 @@ class InitializeStripeConnectRequest extends FormRequest public function getContact() { - return ClientContact::findOrFail($this->getTokenContent()['user_id']); + return User::findOrFail($this->getTokenContent()['user_id']); } public function getCompany() diff --git a/app/PaymentDrivers/BaseDriver.php b/app/PaymentDrivers/BaseDriver.php index d3052847aefe..32b4316ea6a6 100644 --- a/app/PaymentDrivers/BaseDriver.php +++ b/app/PaymentDrivers/BaseDriver.php @@ -370,7 +370,7 @@ class BaseDriver extends AbstractPaymentDriver $invoices = Invoice::whereIn('id', $this->transformKeys(array_column($this->payment_hash->invoices(), 'invoice_id')))->get(); - $invoices->first()->invitations->each(function ($invitation) { + $invoices->first()->invitations->each(function ($invitation) use ($nmo){ if ($invitation->contact->send_email && $invitation->contact->email) { diff --git a/app/PaymentDrivers/CheckoutCom/Utilities.php b/app/PaymentDrivers/CheckoutCom/Utilities.php index a4d222dbdb54..cdfc171d3945 100644 --- a/app/PaymentDrivers/CheckoutCom/Utilities.php +++ b/app/PaymentDrivers/CheckoutCom/Utilities.php @@ -58,7 +58,7 @@ trait Utilities private function processSuccessfulPayment(Payment $_payment) { if ($this->getParent()->payment_hash->data->store_card) { - $this->storePaymentMethod($_payment); + $this->storeLocalPaymentMethod($_payment); } $data = [ @@ -118,7 +118,7 @@ trait Utilities } } - private function storePaymentMethod(Payment $response) + private function storeLocalPaymentMethod(Payment $response) { try { $payment_meta = new stdClass; diff --git a/app/Utils/Traits/AppSetup.php b/app/Utils/Traits/AppSetup.php index 1003a00ddb87..4b316b3dfedf 100644 --- a/app/Utils/Traits/AppSetup.php +++ b/app/Utils/Traits/AppSetup.php @@ -37,11 +37,8 @@ trait AppSetup { $cached_tables = config('ninja.cached_tables'); - if(request()->has('clear_cache')) - Artisan::call('optimize'); - foreach ($cached_tables as $name => $class) { - if (request()->has('clear_cache') || !Cache::has($name) || $force) { + if (!Cache::has($name) || $force) { // check that the table exists in case the migration is pending if (!Schema::hasTable((new $class())->getTable())) { @@ -64,9 +61,8 @@ trait AppSetup } /*Build template cache*/ - if (request()->has('clear_cache') || !Cache::has('templates')) { - $this->buildTemplates(); - } + $this->buildTemplates(); + } diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 6429e4e8ce12..6260c7b01f1c 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -1775,6 +1775,7 @@ $LANG = array( 'lang_Chinese - Taiwan' => 'Chinese - Taiwan', 'lang_Serbian' => 'Serbian', 'lang_Bulgarian' => 'Bulgarian', + 'lang_Russian' => 'Russian', // Industries 'industry_Accounting & Legal' => 'Accounting & Legal',