- Schedule the Account Updater Batch
- Add SOQL String to the Advanced Settings
- Test Using the Developer Console
- Customizing Your Email Template
- Additional Customizations Using Chargent Advanced Settings
Chargent’s Account Updater feature will email your customers when their credit cards are about to expire, asking them to update their payment methods. Once configured, it runs in the background and customers can update their billing information via a secure payment link at their own convenience, making one less thing your team needs to worry about!
From a technical perspective, Account Updater is an automated process that will send an email when a credit card is about to expire on all Recurring Billing records where a Billing Email address is present and the Payment Status is set to Recurring. The email will contain a link to a secure site that allows your customers to update their billing information prior to a transaction being declined.
Setup can be done with 3 easy steps.
- Schedule the Account Updater Batch
- Add SOQL String to the Chargent Settings
- Testing Using the Developer Console
NOTE: Chargent’s Account Updater works differently from the Account Updater services offered by some payment processors. The Chargent Account Updater looks for expiring credit cards in Salesforce, and asks your customer to make an update online.
Updater services offered by payment processors typically update credit cards on the back end from a database of new credit cards. Chargent can support some of these services, depending on how the integration with existing tokens works. For more information, please contact our support team.
- Account Updater works with the latest version of Chargent Orders. If you are on an older version you will want to use our PIM (Package Installation Manager) to update to the current package.
- Account Updater requires that your Payment Request setup is done prior to setting up the Account Updater feature. To set up Payment Requests, check out the Payment Request section of our documentation under Chargent Features.
Schedule the Account Updater Batch #
In order for the Account Updater to search your Salesforce Org for expiring credit cards, you need to first set up the batch. The batch is what runs automatically looking for your recurring billing expiration dates, and triggers the Account Updater to send an email to update the customer’s credit card.
To Set Up the Batch: #
- Click the gear icon and select Setup
- In the Quick Find search and select Apex Classes
- Click the [Schedule Apex] button
- Name the batch Account Updater
- Use the Magnifying Glass to search for the Apex Class TChargentBatchCheckCards
- For Frequency select Weekly and check every day of the week. This allows you to check on a daily basis the cards that need to be updated.
- Start should be today’s date and End should be a date far in the future (to keep the batch running daily – we suggest the end year of 2050).
- Finally the Preferred Start Time can be anything however we recommend during the night and when no other process is running. This will help prevent batches from conflicting as they run.
- Click [Save]
Add SOQL String to the Advanced Settings #
The next step is to add the SOQL string to the Advanced Settings. This will tell the batch to search all records with a Payment Status of Recurring.
NOTE: This step is important, since otherwise you may email former customers or customers with expired cards on inactive billing records.
- Click on the App Launcher and select Chargent App
- Click the Chargent Settings tab
- Click on Advanced Settings
- In the Account Updater Search Criteria enter the following string.
ChargentOrders__Payment_Status__c = ‘Recurring’
- Click [Save]
Test Using the Developer Console #
In Order to test the Account Updater feature, you need to first create a Chargent Order with an expiration date that will expire in the current month. You will then run the batch using the Developer Console.
Create a Chargent Order: #
Since you are only checking for expired credit cards, you don’t need to add information that would normally be filled in when processing test transactions.
- Click the App Launcher and select the Chargent App
- Click the Chargent Orders tab
- Click [New]
- Fill in the following fields:
- Payment Status = Recurring
- Payment Frequency = Once
- Payment Start Date = today’s date
- Complete Billing Information
- First & Last Name
- Billing Address including State, Zip Code, and Country
- Billing email address (Billing email address is important because this will be the email address that receives the Account Updater email.
- Card Type = Visa
- Test Credit Card number = 4111 1111 1111 1111
- Expiration Date = the current month and year.
- Click [Save]
Run the Batch using the Developer Console #
- Click the gear icon and select Developer Console
- Click Debug in the Menu and choose Open Execute Anonymous Window.
- Copy the following code and hit [Execute]
ChargentOrders.TChargentBatchCheckCards b = new ChargentOrders.TChargentBatchCheckCards();
You will receive an email notification letting you know your credit card is about to expire. This email will be sent to the Billing Email Address listed on the Chargent Order.
Customizing Your Email Template #
Now that you have tested Account Updater you can choose to customize the Email Template that is sent to your customers.
- Click on the gear icon and select Setup
- In the Quick Find Search and Select Classic Email Templates
- From the dropdown menu select the Chargent Templates folder
- Click the Email Template Name for Account Updater Feature Html
- Here you can edit the HTML and Plain Text version of your template
Note: You want to be careful when you are modifying the email template and make sure you don’t remove the merge field for the Account Updater link.
Add Additional Merge Fields #
You can also add additional merge fields from any object in Salesforce. This can be either standard fields or custom fields.
- From the Select Field dropdown, choose the object you want to pull fields from
- Select the Field you want from the Select Field dropdown
- Copy the merge field into the template
When you are done customizing the template, be sure to save the changes.
Additional Customizations Using Chargent Advanced Settings #
There are a few additional customizations that you are able to do under the Chargent Advanced Settings options.
To Access Chargent Advanced Settings:
- Click the App Launcher and select Chargent App.
- Click the Chargent Settings tab.
- Click the Advanced Settings sub-tab.
Customizations with Chargent Advanced Settings
- Use Simple Account Updater Feature – When unchecked this will attempt to validate the new credit card and process an Authorization for the minimum amount (usually $1.00). If it’s checked, the Account Updater will update the information but will not attempt to validate the card.
- Account Updater Confirmation Text – When a new credit card is updated successfully, this is the message that will be displayed.
- Account Updater Error Text – When a new credit card is updated and fails, this will be the error message that is displayed.
- Account Updater Expiration Hours (Number) – You can control how long an Account Updater link is valid before it expires. This number is represented in Hours (2184 hours would be equivalent to 3 months)