mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Streamlined pro upgrade process
This commit is contained in:
parent
58a64c9490
commit
680b67bf7b
@ -117,14 +117,16 @@ class AccountController extends \BaseController {
|
|||||||
|
|
||||||
public function enableProPlan()
|
public function enableProPlan()
|
||||||
{
|
{
|
||||||
$invoice = $this->accountRepo->enableProPlan();
|
$invitation = $this->accountRepo->enableProPlan();
|
||||||
|
|
||||||
|
/*
|
||||||
if ($invoice)
|
if ($invoice)
|
||||||
{
|
{
|
||||||
$this->contactMailer->sendInvoice($invoice);
|
$this->contactMailer->sendInvoice($invoice);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return RESULT_SUCCESS;
|
|
||||||
|
return $invitation->invitation_key;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setTrashVisible($entityType, $visible)
|
public function setTrashVisible($entityType, $visible)
|
||||||
|
@ -330,15 +330,13 @@ class UserController extends BaseController {
|
|||||||
if (Session::has(REQUESTED_PRO_PLAN))
|
if (Session::has(REQUESTED_PRO_PLAN))
|
||||||
{
|
{
|
||||||
Session::forget(REQUESTED_PRO_PLAN);
|
Session::forget(REQUESTED_PRO_PLAN);
|
||||||
|
$invitation = $this->accountRepo->enableProPlan();
|
||||||
if ($invoice = $this->accountRepo->enableProPlan())
|
return Redirect::to($invitation->getLink());
|
||||||
{
|
}
|
||||||
$this->contactMailer->sendInvoice($invoice);
|
else
|
||||||
$notice_msg = trans('texts.pro_plan_success');
|
{
|
||||||
}
|
return Redirect::action('UserController@login')->with( 'message', $notice_msg );
|
||||||
}
|
}
|
||||||
|
|
||||||
return Redirect::action('UserController@login')->with( 'message', $notice_msg );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -109,9 +109,9 @@ class AccountRepository
|
|||||||
$publicId = $lastInvoice ? ($lastInvoice->public_id + 1) : 1;
|
$publicId = $lastInvoice ? ($lastInvoice->public_id + 1) : 1;
|
||||||
|
|
||||||
$ninjaClient = $this->getNinjaClient($ninjaAccount);
|
$ninjaClient = $this->getNinjaClient($ninjaAccount);
|
||||||
$invoice = $this->createNinjaInvoice($publicId, $ninjaAccount, $ninjaClient);
|
$invitation = $this->createNinjaInvoice($publicId, $ninjaAccount, $ninjaClient);
|
||||||
|
|
||||||
return $invoice;
|
return $invitation;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function createNinjaInvoice($publicId, $account, $client)
|
private function createNinjaInvoice($publicId, $account, $client)
|
||||||
@ -146,7 +146,7 @@ class AccountRepository
|
|||||||
$invitation->invitation_key = str_random(RANDOM_KEY_LENGTH);
|
$invitation->invitation_key = str_random(RANDOM_KEY_LENGTH);
|
||||||
$invitation->save();
|
$invitation->save();
|
||||||
|
|
||||||
return $invoice;
|
return $invitation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNinjaAccount()
|
public function getNinjaAccount()
|
||||||
|
@ -255,7 +255,7 @@ define('NINJA_GATEWAY_ID', GATEWAY_AUTHORIZE_NET);
|
|||||||
define('NINJA_GATEWAY_CONFIG', '{"apiLoginId":"626vWcD5","transactionKey":"4bn26TgL9r4Br4qJ","testMode":"","developerMode":""}');
|
define('NINJA_GATEWAY_CONFIG', '{"apiLoginId":"626vWcD5","transactionKey":"4bn26TgL9r4Br4qJ","testMode":"","developerMode":""}');
|
||||||
define('NINJA_WEB_URL', 'https://www.invoiceninja.com');
|
define('NINJA_WEB_URL', 'https://www.invoiceninja.com');
|
||||||
define('NINJA_APP_URL', 'https://www.invoiceninja.com');
|
define('NINJA_APP_URL', 'https://www.invoiceninja.com');
|
||||||
define('NINJA_VERSION', '1.5.1');
|
define('NINJA_VERSION', '1.5.2');
|
||||||
define('NINJA_DATE', '2000-01-01');
|
define('NINJA_DATE', '2000-01-01');
|
||||||
define('NINJA_FROM_EMAIL', 'maildelivery@invoiceninja.com');
|
define('NINJA_FROM_EMAIL', 'maildelivery@invoiceninja.com');
|
||||||
define('RELEASES_URL', 'https://github.com/hillelcoren/invoice-ninja/releases/');
|
define('RELEASES_URL', 'https://github.com/hillelcoren/invoice-ninja/releases/');
|
||||||
|
@ -343,7 +343,7 @@ Want something changed? We're {{ link_to('https://github.com/hillelcoren/invoice
|
|||||||
@endif
|
@endif
|
||||||
|
|
||||||
{{-- Per our license, please do not remove or modify this link. --}}
|
{{-- Per our license, please do not remove or modify this link. --}}
|
||||||
@if (Utils::isNinjaDev() || !Utils::isNinja())
|
@if (!Utils::isNinja())
|
||||||
<div class="container">
|
<div class="container">
|
||||||
{{ trans('texts.powered_by') }} <a href="https://www.invoiceninja.com/?utm_source=powered_by" target="_blank">InvoiceNinja.com</a> |
|
{{ trans('texts.powered_by') }} <a href="https://www.invoiceninja.com/?utm_source=powered_by" target="_blank">InvoiceNinja.com</a> |
|
||||||
@if (Auth::user()->account->isWhiteLabel())
|
@if (Auth::user()->account->isWhiteLabel())
|
||||||
@ -516,8 +516,8 @@ Want something changed? We're {{ link_to('https://github.com/hillelcoren/invoice
|
|||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: '{{ URL::to('account/go_pro') }}',
|
url: '{{ URL::to('account/go_pro') }}',
|
||||||
success: function(result) {
|
success: function(result) {
|
||||||
$('#proPlanSuccess, #proPlanFooter').show();
|
NINJA.formIsChanged = false;
|
||||||
$('#proPlanWorking, #proPlanButton').hide();
|
window.location = '{{ Utils::isNinjaDev() ? '' : NINJA_APP_URL }}/view/' + result;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user