Fixes for save payment methods dialogue

This commit is contained in:
David Bomba 2022-02-08 07:55:56 +11:00
parent 364978d282
commit 8c589ec0c4
3 changed files with 24 additions and 6 deletions

View File

@ -385,7 +385,7 @@ class CompanyGatewayController extends BaseController
$company_gateway->save(); $company_gateway->save();
ApplePayDomain::dispatch($company_gateway, $company_gateway->company->db); // ApplePayDomain::dispatch($company_gateway, $company_gateway->company->db);
return $this->itemResponse($company_gateway); return $this->itemResponse($company_gateway);
} }

View File

@ -61,6 +61,9 @@ class UpdateCompanyGatewayRequest extends Request
$input['fees_and_limits'] = $this->cleanFeesAndLimits($input['fees_and_limits']); $input['fees_and_limits'] = $this->cleanFeesAndLimits($input['fees_and_limits']);
} }
if (isset($input['token_billing']) && $input['token_billing'] == 'disabled')
$input['token_billing'] = 'off';
$this->replace($input); $this->replace($input);
} }
} }

View File

@ -1,7 +1,22 @@
@php @php
$token_billing = $gateway instanceof \App\Models\CompanyGateway // $token_billing = $gateway instanceof \App\Models\CompanyGateway
? $gateway->token_billing !== 'always' // ? $gateway->token_billing !== 'always'
: $gateway->company_gateway->token_billing !== 'always'; // : $gateway->company_gateway->token_billing !== 'always';
$gateway_instance = $gateway instanceof \App\Models\CompanyGateway ? $gateway : $gateway->company_gateway;
$token_billing = true;
$checked_on = '';
$checked_off = 'checked';
if($gateway_instance->token_billing == 'off' || $gateway_instance->token_billing == 'always'){
$token_billing = false;
}
if($gateway_instance->token_billing == 'optout' || $gateway_instance->token_billing == 'always'){
$checked_on = 'checked';
$checked_off = '';
}
@endphp @endphp
@if($token_billing) @if($token_billing)
@ -13,13 +28,13 @@
<label class="mr-4"> <label class="mr-4">
<input type="radio" class="form-radio cursor-pointer" name="token-billing-checkbox" <input type="radio" class="form-radio cursor-pointer" name="token-billing-checkbox"
id="proxy_is_default" id="proxy_is_default"
value="true"/> value="true" {{ $checked_on }}/>
<span class="ml-1 cursor-pointer">{{ ctrans('texts.yes') }}</span> <span class="ml-1 cursor-pointer">{{ ctrans('texts.yes') }}</span>
</label> </label>
<label> <label>
<input type="radio" class="form-radio cursor-pointer" name="token-billing-checkbox" <input type="radio" class="form-radio cursor-pointer" name="token-billing-checkbox"
id="proxy_is_default" id="proxy_is_default"
value="false" checked /> value="false" {{ $checked_off }} />
<span class="ml-1 cursor-pointer">{{ ctrans('texts.no') }}</span> <span class="ml-1 cursor-pointer">{{ ctrans('texts.no') }}</span>
</label> </label>
</dd> </dd>