1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Fixes for logic surrounding presenting the save payment method details radio buttons

This commit is contained in:
David Bomba 2023-01-26 09:36:59 +11:00
parent 57596ef26f
commit b67bbdcd7a
2 changed files with 11 additions and 6 deletions

View File

@ -112,8 +112,8 @@ class UpdateRecurringInvoiceRequest extends Request
$input['line_items'] = isset($input['line_items']) ? $this->cleanItems($input['line_items']) : [];
}
if (array_key_exists('auto_bill', $input) && isset($input['auto_bill']) && $this->setAutoBillFlag($input['auto_bill'])) {
$input['auto_bill_enabled'] = true;
if (array_key_exists('auto_bill', $input) && isset($input['auto_bill'])) {
$input['auto_bill_enabled'] = $this->setAutoBillFlag($input['auto_bill']);
}
if (array_key_exists('documents', $input)) {
@ -132,9 +132,9 @@ class UpdateRecurringInvoiceRequest extends Request
*
* @return bool
*/
private function setAutoBillFlag($auto_bill) :bool
private function setAutoBillFlag($auto_bill)
{
if ($auto_bill == 'always') {
if ($auto_bill == 'always' || $auto_bill == 'optout') {
return true;
}

View File

@ -10,8 +10,13 @@
$token_billing = false;
$token_billing_string = 'false';
}
if($gateway_instance->token_billing == 'optout' || $gateway_instance->token_billing == 'always'){
if($gateway_instance->token_billing == 'always'){
$token_billing = false;
$token_billing_string = 'true';
}
if($gateway_instance->token_billing == 'optout'){
$checked_on = 'checked';
$checked_off = '';
}