diff --git a/app/Http/Controllers/AccountGatewayController.php b/app/Http/Controllers/AccountGatewayController.php index d44ea51b646f..8c1db8731dd8 100644 --- a/app/Http/Controllers/AccountGatewayController.php +++ b/app/Http/Controllers/AccountGatewayController.php @@ -89,26 +89,23 @@ class AccountGatewayController extends BaseController $account = Auth::user()->account; $accountGatewaysIds = $account->gatewayIds(); - $otherProviders = Input::get('other_providers'); - - if (! env('WEPAY_CLIENT_ID') || Gateway::hasStandardGateway($accountGatewaysIds)) { - $otherProviders = true; - } + $wepay = Input::get('wepay'); $data = self::getViewModel(); $data['url'] = 'gateways'; $data['method'] = 'POST'; $data['title'] = trans('texts.add_gateway'); - if ($otherProviders) { + if ($wepay) { + return View::make('accounts.account_gateway_wepay', $data); + } else { $availableGatewaysIds = $account->availableGatewaysIds(); $data['primaryGateways'] = Gateway::primary($availableGatewaysIds)->orderBy('sort_order')->get(); $data['secondaryGateways'] = Gateway::secondary($availableGatewaysIds)->orderBy('name')->get(); $data['hiddenFields'] = Gateway::$hiddenFields; + $data['accountGatewaysIds'] = $accountGatewaysIds; return View::make('accounts.account_gateway', $data); - } else { - return View::make('accounts.account_gateway_wepay', $data); } } diff --git a/resources/views/accounts/account_gateway.blade.php b/resources/views/accounts/account_gateway.blade.php index fd60a98ed77f..3e2b7bdbc4ac 100644 --- a/resources/views/accounts/account_gateway.blade.php +++ b/resources/views/accounts/account_gateway.blade.php @@ -1,5 +1,12 @@ @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') @parent diff --git a/resources/views/accounts/account_gateway_wepay.blade.php b/resources/views/accounts/account_gateway_wepay.blade.php index 4093d2f02ce7..751f1448e158 100644 --- a/resources/views/accounts/account_gateway_wepay.blade.php +++ b/resources/views/accounts/account_gateway_wepay.blade.php @@ -145,7 +145,7 @@
- {!! 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() !!}
diff --git a/resources/views/accounts/partials/payment_credentials.blade.php b/resources/views/accounts/partials/payment_credentials.blade.php index dc3d7aae054f..e48dafbb0942 100644 --- a/resources/views/accounts/partials/payment_credentials.blade.php +++ b/resources/views/accounts/partials/payment_credentials.blade.php @@ -1,6 +1,5 @@ {!! Former::populateField(GATEWAY_STRIPE . '_apiKey', env('STRIPE_TEST_SECRET_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_secret', env('PLAID_TEST_SECRET')) !!} {!! Former::populateField('plaid_public_key', env('PLAID_TEST_PUBLIC_KEY')) !!} diff --git a/tests/_support/AcceptanceTester.php b/tests/_support/AcceptanceTester.php index a3dfcee14a7c..7e675fc98381 100644 --- a/tests/_support/AcceptanceTester.php +++ b/tests/_support/AcceptanceTester.php @@ -66,7 +66,7 @@ class AcceptanceTester extends \Codeception\Actor { if ( ! $I->grabFromDatabase('account_gateways', 'id', ['id' => 1])) { $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' =>'publishable_key'], ''); $I->click('Save');