diff --git a/app/Http/Controllers/AccountGatewayController.php b/app/Http/Controllers/AccountGatewayController.php index 34a378379d21..fef9a511636e 100644 --- a/app/Http/Controllers/AccountGatewayController.php +++ b/app/Http/Controllers/AccountGatewayController.php @@ -87,6 +87,7 @@ class AccountGatewayController extends BaseController ->where('id', '!=', GATEWAY_GOCARDLESS) ->where('id', '!=', GATEWAY_DWOLLA) ->where('id', '!=', GATEWAY_STRIPE) + ->where('id', '!=', GATEWAY_WEPAY) ->orderBy('name')->get(); $data['hiddenFields'] = Gateway::$hiddenFields; @@ -245,8 +246,11 @@ class AccountGatewayController extends BaseController $accountGateway = AccountGateway::createNew(); $accountGateway->gateway_id = $gatewayId; - if ($gatewayId == GATEWAY_WEPAY && !$this->setupWePay($accountGateway, $wepayResponse)) { - return $wepayResponse; + if ($gatewayId == GATEWAY_WEPAY) { + if(!$this->setupWePay($accountGateway, $wepayResponse)) { + return $wepayResponse; + } + $oldConfig = $accountGateway->getConfig(); } } @@ -265,7 +269,7 @@ class AccountGatewayController extends BaseController $config->$field = $value; } } - } else { + } elseif($oldConfig) { $config = clone $oldConfig; } diff --git a/resources/views/accounts/partials/account_gateway_wepay.blade.php b/resources/views/accounts/partials/account_gateway_wepay.blade.php index edda271d1479..4d6832a8c1f5 100644 --- a/resources/views/accounts/partials/account_gateway_wepay.blade.php +++ b/resources/views/accounts/partials/account_gateway_wepay.blade.php @@ -10,6 +10,9 @@ {!! Former::populateField('first_name', $user->first_name) !!} {!! Former::populateField('last_name', $user->last_name) !!} {!! Former::populateField('email', $user->email) !!} +{!! Former::populateField('show_address', 1) !!} +{!! Former::populateField('update_address', 1) !!} +{!! Former::populateField('token_billing_type_id', $account->token_billing_type_id) !!}