mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 04:04:34 -04:00
Fixes for trial plans
This commit is contained in:
parent
1e43e172a7
commit
df3a1832fe
@ -125,13 +125,14 @@ class NinjaPlanController extends Controller
|
|||||||
$gateway_driver->storeGatewayToken($data, ['gateway_customer_reference' => $customer->id]);
|
$gateway_driver->storeGatewayToken($data, ['gateway_customer_reference' => $customer->id]);
|
||||||
|
|
||||||
//set free trial
|
//set free trial
|
||||||
// $account = auth()->guard('contact')->user()->company->account;
|
|
||||||
if(auth()->guard('contact')->user()->client->custom_value2){
|
if(auth()->guard('contact')->user()->client->custom_value2){
|
||||||
MultiDB::findAndSetDbByAccountKey(auth()->guard('contact')->user()->client->custom_value2);
|
MultiDB::findAndSetDbByAccountKey(auth()->guard('contact')->user()->client->custom_value2);
|
||||||
$account = Account::where('key', auth()->guard('contact')->user()->client->custom_value2)->first();
|
$account = Account::where('key', auth()->guard('contact')->user()->client->custom_value2)->first();
|
||||||
$account->trial_started = now();
|
$account->trial_started = now();
|
||||||
$account->trial_plan = 'pro';
|
$account->trial_plan = 'pro';
|
||||||
$account->plan = 'pro';
|
$account->plan = 'pro';
|
||||||
|
$account->plan_term = 'month';
|
||||||
|
$account->plan_started = now();
|
||||||
$account->plan_expires = now()->addDays(14);
|
$account->plan_expires = now()->addDays(14);
|
||||||
$account->save();
|
$account->save();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user