Streamlined pro upgrade process

This commit is contained in:
Hillel Coren 2014-11-17 00:23:11 +02:00
parent 58a64c9490
commit 680b67bf7b
5 changed files with 18 additions and 18 deletions

View File

@ -117,14 +117,16 @@ class AccountController extends \BaseController {
public function enableProPlan()
{
$invoice = $this->accountRepo->enableProPlan();
$invitation = $this->accountRepo->enableProPlan();
/*
if ($invoice)
{
$this->contactMailer->sendInvoice($invoice);
}
*/
return RESULT_SUCCESS;
return $invitation->invitation_key;
}
public function setTrashVisible($entityType, $visible)

View File

@ -330,17 +330,15 @@ class UserController extends BaseController {
if (Session::has(REQUESTED_PRO_PLAN))
{
Session::forget(REQUESTED_PRO_PLAN);
if ($invoice = $this->accountRepo->enableProPlan())
$invitation = $this->accountRepo->enableProPlan();
return Redirect::to($invitation->getLink());
}
else
{
$this->contactMailer->sendInvoice($invoice);
$notice_msg = trans('texts.pro_plan_success');
}
}
return Redirect::action('UserController@login')->with( 'message', $notice_msg );
}
}
}
else
{
$error_msg = trans('texts.confide.wrong_confirmation');

View File

@ -109,9 +109,9 @@ class AccountRepository
$publicId = $lastInvoice ? ($lastInvoice->public_id + 1) : 1;
$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)
@ -146,7 +146,7 @@ class AccountRepository
$invitation->invitation_key = str_random(RANDOM_KEY_LENGTH);
$invitation->save();
return $invoice;
return $invitation;
}
public function getNinjaAccount()

View File

@ -255,7 +255,7 @@ define('NINJA_GATEWAY_ID', GATEWAY_AUTHORIZE_NET);
define('NINJA_GATEWAY_CONFIG', '{"apiLoginId":"626vWcD5","transactionKey":"4bn26TgL9r4Br4qJ","testMode":"","developerMode":""}');
define('NINJA_WEB_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_FROM_EMAIL', 'maildelivery@invoiceninja.com');
define('RELEASES_URL', 'https://github.com/hillelcoren/invoice-ninja/releases/');

View File

@ -343,7 +343,7 @@ Want something changed? We're {{ link_to('https://github.com/hillelcoren/invoice
@endif
{{-- Per our license, please do not remove or modify this link. --}}
@if (Utils::isNinjaDev() || !Utils::isNinja())
@if (!Utils::isNinja())
<div class="container">
{{ trans('texts.powered_by') }} <a href="https://www.invoiceninja.com/?utm_source=powered_by" target="_blank">InvoiceNinja.com</a> |
@if (Auth::user()->account->isWhiteLabel())
@ -516,8 +516,8 @@ Want something changed? We're {{ link_to('https://github.com/hillelcoren/invoice
type: 'POST',
url: '{{ URL::to('account/go_pro') }}',
success: function(result) {
$('#proPlanSuccess, #proPlanFooter').show();
$('#proPlanWorking, #proPlanButton').hide();
NINJA.formIsChanged = false;
window.location = '{{ Utils::isNinjaDev() ? '' : NINJA_APP_URL }}/view/' + result;
}
});
} else {