diff --git a/app/Services/TemplateService.php b/app/Services/TemplateService.php index bcc371304e1e..f47038fe828f 100644 --- a/app/Services/TemplateService.php +++ b/app/Services/TemplateService.php @@ -4,6 +4,7 @@ use Form; use HTML; use Utils; use App\Models\Gateway; +use App\Models\GatewayType; class TemplateService { @@ -69,7 +70,10 @@ class TemplateService // Add variables for available payment types foreach (Gateway::$gatewayTypes as $type) { - $camelType = Utils::toCamelCase($type); + if ($type == GATEWAY_TYPE_TOKEN) { + continue; + } + $camelType = Utils::toCamelCase(GatewayType::getAliasFromId($type)); $variables["\${$camelType}Link"] = $invitation->getLink('payment') . "/{$type}"; $variables["\${$camelType}Button"] = Form::emailPaymentButton($invitation->getLink('payment') . "/{$type}"); } diff --git a/resources/views/accounts/templates_and_reminders.blade.php b/resources/views/accounts/templates_and_reminders.blade.php index 54969947a1a2..4f6369b2e140 100644 --- a/resources/views/accounts/templates_and_reminders.blade.php +++ b/resources/views/accounts/templates_and_reminders.blade.php @@ -299,11 +299,13 @@ // Add any available payment method links @foreach (\App\Models\Gateway::$gatewayTypes as $type) - {!! "keys.push('" . Utils::toCamelCase($type).'Link' . "');" !!} - {!! "vals.push('" . URL::to('/payment/...') . "');" !!} + @if ($type != GATEWAY_TYPE_TOKEN) + {!! "keys.push('" . Utils::toCamelCase(\App\Models\GatewayType::getAliasFromId($type)).'Link' . "');" !!} + {!! "vals.push('" . URL::to('/payment/...') . "');" !!} - {!! "keys.push('" . Utils::toCamelCase($type).'Button' . "');" !!} - {!! "vals.push('" . Form::flatButton('pay_now', '#36c157') . "');" !!} + {!! "keys.push('" . Utils::toCamelCase(\App\Models\GatewayType::getAliasFromId($type)).'Button' . "');" !!} + {!! "vals.push('" . Form::flatButton('pay_now', '#36c157') . "');" !!} + @endif @endforeach var includesPasswordPlaceholder = str.indexOf('$password') != -1;