1. Home
  2. WHMCS + PayPal Billing Gateway
  3. Documentation
  4. Showing our AutoPay message in the Client Area Invoice View Page

Showing our AutoPay message in the Client Area Invoice View Page

One of the features we introduced in V2.6 is an option to show a green alert on the top of the invoice page in the WHMCS client area if a PayPal billing agreement or credit card is stored on the client’s account – and Auto CC Processing is on for that client. 

This is helpful/recommended to not only remind clients that their invoice will be automatically paid, but also to clarify what payment method they have on file, and give them an easy path to edit/manage that. 

Below is a screenshot of what this alert looks like in the client area.

Logic

To display the alert, the following conditions must be true:

  • The setting to Show AutoPay message in our module configuration must be on in Setup > Addons > MyWorks PayPal > Configure.
  • Auto CC Processing must be set to Yes in the Client’s Summary tab
  • A PayPal Billing Agreement must be active and on file OR a credit card token must exist on file.

If a billing agreement is on file, the message for PayPal Billing agreements will be displayed. If a credit card token is on file, the message for Credit Cards will be displayed. 

Customization

All of the elements involved in this alert are fully customizable. There are two elements – the language PHP file and the alert.tpl file in our module:

  • modules/addons/paypal_billing_center/lang/yourlanguage.php
  • modules/addons/paypal_billing_center/templates/alert.tpl

The language structure is fully multi-language compatible. Ensure you have a file matching your language in modules/addons/paypal_billing_center/lang/ – otherwise it will default to the included English.php file.

The alert.tpl file may be edited to your desire, however you must ensure the variables are not changed.

Setup

To enable this feature, simply check the setting to Show AutoPay alert in Client Area Invoice in our module configuration – in Setup > Addons > MyWorks PayPal > Configure.

Then, you must add the following code to your templates/activetemplatefolder/viewinvoice.tpl file. Also see below for a full viewinvoice.tpl file with the included code as an example.

{if $paypaltoken || $cardlastfour}
{include file="../../modules/addons/paypal_billing_center/templates/alert.tpl" type="success" headerTitle=$langpb_invoiceheader bodyContentPaypal=$langpb_invoicebody_paypal bodyContentCreditcard=$langpb_invoicebody_creditcard buttonPayPal=$langpb_invoicebutton_paypal buttonCreditCard=$langpb_invoicebutton_creditcard paypaltoken=$paypaltoken cardtype=$cardtype cardlastfour=$cardlastfour bodyTextCenter=true}
{/if}

This code should be added after line 15 of the file – after the opening div.

Updated on August 6, 2017

Article Attachments

Was this article helpful?