mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Change gateway flow
This commit is contained in:
parent
91faf106bd
commit
37752eb4ff
@ -89,26 +89,23 @@ class AccountGatewayController extends BaseController
|
|||||||
|
|
||||||
$account = Auth::user()->account;
|
$account = Auth::user()->account;
|
||||||
$accountGatewaysIds = $account->gatewayIds();
|
$accountGatewaysIds = $account->gatewayIds();
|
||||||
$otherProviders = Input::get('other_providers');
|
$wepay = Input::get('wepay');
|
||||||
|
|
||||||
if (! env('WEPAY_CLIENT_ID') || Gateway::hasStandardGateway($accountGatewaysIds)) {
|
|
||||||
$otherProviders = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$data = self::getViewModel();
|
$data = self::getViewModel();
|
||||||
$data['url'] = 'gateways';
|
$data['url'] = 'gateways';
|
||||||
$data['method'] = 'POST';
|
$data['method'] = 'POST';
|
||||||
$data['title'] = trans('texts.add_gateway');
|
$data['title'] = trans('texts.add_gateway');
|
||||||
|
|
||||||
if ($otherProviders) {
|
if ($wepay) {
|
||||||
|
return View::make('accounts.account_gateway_wepay', $data);
|
||||||
|
} else {
|
||||||
$availableGatewaysIds = $account->availableGatewaysIds();
|
$availableGatewaysIds = $account->availableGatewaysIds();
|
||||||
$data['primaryGateways'] = Gateway::primary($availableGatewaysIds)->orderBy('sort_order')->get();
|
$data['primaryGateways'] = Gateway::primary($availableGatewaysIds)->orderBy('sort_order')->get();
|
||||||
$data['secondaryGateways'] = Gateway::secondary($availableGatewaysIds)->orderBy('name')->get();
|
$data['secondaryGateways'] = Gateway::secondary($availableGatewaysIds)->orderBy('name')->get();
|
||||||
$data['hiddenFields'] = Gateway::$hiddenFields;
|
$data['hiddenFields'] = Gateway::$hiddenFields;
|
||||||
|
$data['accountGatewaysIds'] = $accountGatewaysIds;
|
||||||
|
|
||||||
return View::make('accounts.account_gateway', $data);
|
return View::make('accounts.account_gateway', $data);
|
||||||
} else {
|
|
||||||
return View::make('accounts.account_gateway_wepay', $data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
@extends('header')
|
@extends('header')
|
||||||
|
|
||||||
|
@section('top-right')
|
||||||
|
@if (! count($accountGatewaysIds))
|
||||||
|
{!! Button::primary(trans('texts.sign_up_with_wepay'))
|
||||||
|
->asLinkTo(URL::to('/gateways/create?wepay=true')) !!}
|
||||||
|
@endif
|
||||||
|
@stop
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
@parent
|
@parent
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@
|
|||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
<center>
|
<center>
|
||||||
{!! Button::normal(trans('texts.use_another_provider'))->large()->asLinkTo(URL::to('/gateways/create?other_providers=true')) !!}
|
{!! Button::normal(trans('texts.cancel'))->large()->asLinkTo(HTMLUtils::previousUrl('/gateways/create'))->appendIcon(Icon::create('remove-circle')) !!}
|
||||||
{!! Button::success(trans('texts.sign_up_with_wepay'))->submit()->large() !!}
|
{!! Button::success(trans('texts.sign_up_with_wepay'))->submit()->large() !!}
|
||||||
</center>
|
</center>
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
{!! Former::populateField(GATEWAY_STRIPE . '_apiKey', env('STRIPE_TEST_SECRET_KEY')) !!}
|
{!! Former::populateField(GATEWAY_STRIPE . '_apiKey', env('STRIPE_TEST_SECRET_KEY')) !!}
|
||||||
{!! Former::populateField('publishable_key', env('STRIPE_TEST_PUBLISHABLE_KEY')) !!}
|
{!! Former::populateField('publishable_key', env('STRIPE_TEST_PUBLISHABLE_KEY')) !!}
|
||||||
{!! Former::populateField('enable_ach', 1) !!}
|
|
||||||
{!! Former::populateField('plaid_client_id', env('PLAID_TEST_CLIENT_ID')) !!}
|
{!! Former::populateField('plaid_client_id', env('PLAID_TEST_CLIENT_ID')) !!}
|
||||||
{!! Former::populateField('plaid_secret', env('PLAID_TEST_SECRET')) !!}
|
{!! Former::populateField('plaid_secret', env('PLAID_TEST_SECRET')) !!}
|
||||||
{!! Former::populateField('plaid_public_key', env('PLAID_TEST_PUBLIC_KEY')) !!}
|
{!! Former::populateField('plaid_public_key', env('PLAID_TEST_PUBLIC_KEY')) !!}
|
||||||
|
@ -66,7 +66,7 @@ class AcceptanceTester extends \Codeception\Actor
|
|||||||
{
|
{
|
||||||
if ( ! $I->grabFromDatabase('account_gateways', 'id', ['id' => 1])) {
|
if ( ! $I->grabFromDatabase('account_gateways', 'id', ['id' => 1])) {
|
||||||
$I->wantTo('create a gateway');
|
$I->wantTo('create a gateway');
|
||||||
$I->amOnPage('/gateways/create?other_providers=true');
|
$I->amOnPage('/gateways/create');
|
||||||
$I->fillField(['name' =>'23_apiKey'], env('stripe_secret_key') ?: Fixtures::get('stripe_secret_key'));
|
$I->fillField(['name' =>'23_apiKey'], env('stripe_secret_key') ?: Fixtures::get('stripe_secret_key'));
|
||||||
$I->fillField(['name' =>'publishable_key'], '');
|
$I->fillField(['name' =>'publishable_key'], '');
|
||||||
$I->click('Save');
|
$I->click('Save');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user