Note: Merchant Warrior requires payments to be processed directly from the Chargent Order record and therefore Chargent Anywhere will not work for Payment Request and Payment Console.
Chargent Anywhere #
Chargent Anywhere allows you to process payments from any object in Salesforce. The Chargent Anywhere component contains four buttons.
- Send Pay Request – Allows you to send an email with a URL to a secure payment page
- Payment Console – Allows you to enter credit card information in a secure manner and either process one time payment or setup recurring billing.
- Add Cash – Allows you to create a transaction record for a cash entry (does not get sent to your payment gateway).
- Add Check – allows you to create a transaction record for a paper check entry (does not get sent to your payment gateway).
Using Chargent Anywhere with Payment Console and tokenization you reduce the scope of PCI Compliance by never storing sensitive credit card or bank account number information in Salesforce.
For an overview of configuring Chargent Anywhere, Payment Requests, and Payment Console, check out the following video.
For setting up and customizing Chargent Anywhere, check out our Chargent Anywhere Quick Start Guide for Chargent Anywhere
Also check out the Chargent Anywhere User Guide for Chargent Anywhere.
Direct Debit Network for Your Region
This feature is only available on version 6.15 and newer. You can update your Chargent package using our PIM (Package Installation Manager) on our website. Chargent recommends always updating and testing in Sandbox prior to Production.
In Chargent version 6.15 you can select the appropriate Direct Debit Network for your region. This is for Bank Account Transfers (ACH, EFT, BECS, and SEPA) and will allow you to have the correct network and terminology displayed on the Payment Request form and Payment Console.
![]() | . ![]() |
You can select from the following options.
- US – ACH (also known as echeck or electronic check)
- Canada – EFT (ACSS) Electronic Funds Transfer
- Australia – BECS
- Europe – SEPA
Note: The Direct Debit Network feature is available for select Gateways that support Bank Account Drafts and can be set up using the Chargent Setup Wizard.
Please see the Gateway Documentation to see if your Gateway supports Bank Account (ACH, Direct Debit) and for complete instructions.
Payment Request Setup #
Set Up Your Site:
- Click the gear icon and choose Setup
- In the Quick Find type and select Sites
- Click “New” to Create a New Site
- Site Label: Choose a name, for example: Payment Request
- Site Name: Choose a name, for example: PaymentRequest
- Clickjack Protection Level: Use default or check with your IT department
- Select PaymentRequest as Active Site Home Page
- Active: Checked
- Require Secure Connections (HTTPS): Checked
- [Save]

Note: If you are upgrading from an older version, you will need to replace the “Active Site Home Page” component with the “PaymentRequest” lightning web component to use your original pages. This is done by going into your Salesforce Setup and Editing your Site. This can be enabled in the Layout section of the Setup under Developer Pages.
Payment Request Setup #
Once you have your Site setup, you want to use the Payment Request Setup wizard to set up your Payment Request templates.
- Click on the App Launcher and select the Chargent app
- Click Chargent Settings
- Click the sub tab for Payment Request Setup.
If you have set up your Site correctly, you will now see the option to create a new Payment Request Template. Click the [New] button to create a new template. With version 6.20 you can now have multiple Payment Request pages to choose from.

Site Selection: Site Selection
Step 1: Select your Site
The first step of the configuration is the Site Selection. Here you will see any Salesforce Site you set up previously. Choose the one dedicated to your Payment Requests:

Configure: Configure the Payment Request Payform:
The configuration page will allow you to name your Template. If this is your first time setting up Payment Requests, it will provide the recommended settings based on your Gateway settings, or the settings Chargent recommends as default.
Step 2: Enter a Name and Description
Name your Payment Request template. If you have multiple Payment Request forms, the name should help you identify the correct template when you select it later.
Step 3: Select allowed Payment Methods and PR Link Expiration Rules
Which payment methods will you be accepting? Card and Bank Account, Card Only, or Bank Account only. You can also set the number of days before a Payment Request link expires.
Step 4: Configure Extra Settings
Create Payment Request Record for All Orders will create a Payment Request record for every Chargent Order record created. .
Show Debug is for when you need to test and see what data is sent to your Payment Gateway. This should always be set to No if you are processing live transactions.
Default Payment Request – Select ‘Yes’ if you want this to be the default payform.

Layout: Customize Payment Request Page
Step 5: Edit Your Welcome Text
Your welcome text should be friendly towards the customer and ask them to enter the billing information in your Payform.
Step 6: Edit Your Payment Messages
Customize your Success, Cancel, and Fail Page to let customers know the payment they used was processed as expected or if the payment was declined. If they cancel the payment, it will let them know they successfully canceled and payment will not be processed. You can also edit the footer of your Payform.
Developer Pages:
Developer Pages should only be used if you are a Salesforce Developer and using your own Visualforce Pages.

Design: Change Look & Feel
Step 7: Upload your Company Logo
Upload your company logo by clicking the [Upload Files] button or drag and drop your image. Make sure your logo is the actual size before uploading.
Step 8: Edit Your Tab Names
Your Payform has two sections. One for the Billing Address and the other for the Credit Card details. Here you can edit the titles of each section to better fit your company’s branding.
Step 9: Edit Your Payform Button
The default button name is Charge however you can change the button to say Donate, or Process Payment. You can also change the color of the button to fit your company’s branding.
Step 10: Select a Background
In order to change your background image, you will need to do a couple of steps.
- Upload your background image as a Public Static Resource in Salesforce
- Copy the URL for the image
- Enable Custom Background in your Payment Request Setup
- Paste the URL for the Public Static Resource into the blank field.
Step 11: Choose your Payform Location
This sets the alignment of your form to either Left, Center, or Right.

Preview: Preview and Save
Preview and Save your Payment Request. Click on the [Preview] button to see what your Payment Request form will look like. You can go back and make any changes you need before saving the form.

Once you have your first template created you can easily add additional templates with different branding by following the same steps.

Sending a Payment Request #
Our Payment Request feature allows you to generate and send a payment link (URL) to your customers directly from any object that has Chargent Anywhere configured. You can use this payment link in Salesforce email templates, or anywhere method you want to share it.
- Click the Send Payment Request button in the Chargent Anywhere Lightning component
- If you have multiple Payment Request Templates you will need to select the template you want to use.
- Click the Contact picklist to choose the contact to which you’re sending the request (You may also manually enter an email address in the Recipient Email Address field instead).
- Enter the Request Amount
- Enter optional info in the Request Notes (These are notes the recipient of this Payment Request will see in the email they receive)
- Click the [Send] Request button

The payment link takes them to a secure payment page, where their contact information and the amount is already populated. The customer simply has to enter their credit card, CSC (Card Security Code), and Expiration Date then press Charge.

The Payment Request will create the following records in your Salesforce Org:
- Chargent Order – the Chargent Order acts as a payment source for the transaction. Its where the token will be stored for future payments and recurring billing.
- Chargent Payment Request – the Payment Request object consists of all Payment Requests for all transactions. Each payment request generated is associated with a Chargent Order.
- Transaction – Once the Payment Request is completed and payment has been made a transaction record is created showing the payment and associating the transaction back to the Chargent Order.
Once the Payment Request is paid, the Status field will change from Created to Paid.

Using Developer Pages #
If you choose to use Developer Pages for Payment Request, this section will outline how to create and prepare those pages. Please note that this section contains developer-level actions. As such, it is best practice that a Salesforce Certified Developer performs these tasks.
Useful Links
Use Lightning Components in Visualforce Pages
Existing Payment Request Pages
If you were already using Chargent Payment Request prior to upgrading to Chargent Base 5.84, and would like to continue using those customized pages, you will need to comment out the visualforce tag for the sitePaymentComponent and replace it with our new Chargent Payment Request Lightning Web Component.
An example custom page from the previous version of Payment Request might look like this:
<apex:page showHeader=”false” standardStylesheets=”true” id=”page”> <apex:outputPanel id=”content” layout=”block” styleClass=”customstyle”> <ChargentOrders:SitePaymentComponent showAddress=”true” cancel=”/PaymentCancel” success=”/PaymentSuccess” fail=”/PaymentFail”/> </apex:outputPanel> <apex:outputPanel id=”footer” layout=”block”> <apex:outputPanel layout=”block” styleClass=”footer”> <apex:outputText value=”AppFrontier LLC | 870 Market Street, Suite 809 | San Francisco, CA 94102 | USA | ” styleClass=”footertext”/> <apex:outputLink value=”http://www.AppFrontier.com” >www.AppFrontier.com</apex:outputLink> <apex:outputText value=” | ” styleClass=”footertext”/> <apex:outputLink value=”mailto:[email protected]” styleClass=”maillink”>[email protected]</apex:outputLink> <apex:outputPanel layout=”block” styleClass=”band” /> </apex:outputPanel> </apex:outputPanel> </apex:page> |
In this example, the line you are looking for is:
<ChargentOrders:SitePaymentComponent showAddress=”true” cancel=”/PaymentCancel” success=”/PaymentSuccess” fail=”/PaymentFail”/> |
To comment it out you would place a <!– in front of and –> after this line
Changing it to this:
<!– <ChargentOrders:SitePaymentComponent showAddress=”true” cancel=”/PaymentCancel” success=”/PaymentSuccess” fail=”/PaymentFail”/> –> |
Once complete, the next step is to add the chargentPaymentRequest component to the page. Adding the Chargent Payment Request LWC Component to your Payment Request page works just like adding any other LWC on a visualforce page as outlined in the Salesforce documentation linked above.
First, make sure your page has the following tag within its markup:
<apex:includeLightning /> |
Next, add the chargentPaymentRequest Lightning Web Component. Where to place the component is completely dependent on your implementation. If you already have an existing payment request page with the old sitePaymentComponent, the best starting place will be the same place that line of code was or just below it if you have commented it out.
Place this code where you want it on the page. There are additional options you can set, which will be described below. Please refer to the salesforce documentation linked above on how to use those options and where to specify them.
<script type=”text/javascript”> $Lightning.use(“ChargentBase:ChargentTakePaymentApp”, function () { $Lightning.createComponent( “ChargentBase:chargentPaymentRequest”, { ‘formName’: ‘Pay Request Form’, ‘req’: ‘{!$CurrentPage.parameters.req}’ }, “container”, function (cmp) {} ); }); </script> <div id=”container”></div> |
Note: The <div> with the id of “container” is where the platform will render the component. The script block can be placed anywhere on the page but typically is placed near this div.
Chargent Payment Request Configuration
The component you place on your page has several parameters used to properly render the component.
Parameter | Type | Required | Description |
req | String | YES | Must be set to: ‘{!$CurrentPage.parameters.req}’ DO NOT set to anything else |
formName | String | NO | The header that will be displayed with the payment request form |
hideEmailField | Boolean | NO | Defaults to false. Set to true if you do not wish to display the email address field on the payment form |
hideCountryField | Boolean | NO | Defaults to false. Set to true if you do not wish to display the country field on the payment form |
failPage | String | NO | If using custom pages, set this to the name of the Visualforce page you wish to display to the user for a failed transaction |
successPage | String | NO | If using custom pages, set this to the name of the Visualforce page you wish to display to the user for a successful transaction |
cancelPage | String | NO | If using custom pages, set this to the name of the Visualforce page you wish to display to the user if they click cancel on the payment request page |
Setting Custom Result Pages
Assume you have visualforce pages named:
- FailPage
- Success Page (Make sure to replace the space with _ )
- CancelPage
You would specify this in the component as follows:
<script type=”text/javascript”> $Lightning.use(“ChargentBase:ChargentTakePaymentApp”, function () { $Lightning.createComponent( “ChargentBase:chargentPaymentRequest”, { ‘formName’: ‘Pay Request Form’, ‘req’: ‘{!$CurrentPage.parameters.req}’, ‘failPage’ : ‘FailPage’, ‘successPage’ : ‘Success_Page’, ‘cancelPage’ : ‘CancelPage’ }, “container”, function (cmp) {} ); }); </script> <div id=”container”></div> |
Activating Your Developer Pages
Now that you’ve edited your pages to include the proper chargentPaymentRequest component, follow these steps to activate your Developer Pages:
- Navigate to Setup > Sites & Domains > Sites
- Click the [Edit] button next to the Site your Payment Request configuration is using
- Click the Search icon next to the “Activate Site Home Page” field
- Select the Visualforce page you customized for Payment Request
- Click the [Save] button
NOTE: These steps describe the most direct implementation of using the custom page you’ve created: adding it as the Active Site Homepage. However, when using custom pages, the payment request link will navigate the user to the Active Site Home Page for the specified site. Where you add your custom page to your site depends on your specific implementation requirements. The two options are:
Active Site HomepagePlacing your custom page here means that anyone who accesses the site URL will be presented with your custom Payment Request pageAvailable Visualforce PagesPlacing your custom page here will require that your active site homepage is coded to serve up the correct page. This is useful if you are using your site for multiple purposes or want to present another page prior to the Payment Request
Now that you’ve edited your Site to point to your custom Visualforce page, it’s time to toggle the “Developer” setting to Enabled in the Payment Request Setup Wizard.
- Click the App Launcher icon
at the top-left of your screen, then click the “Chargent” app
- Click the “Chargent Settings” tab
- Click the “Payment Request Setup” tab
- Click the [Next] button to navigate to the Layout page of the wizard
- Click the toggle switch for “Use Custom Page”
- Click the [Next] button, then click the [Finish] button
Your custom pages are ready to test. Create a new Payment Request record and follow the Payment Link to view and test your custom page.
Basic Custom Page Code
If you’re using Custom Pages and need a quick starting point, here’s the code for that. Note that this code includes only our chagentPaymentRequest component and nothing else. You may place this component in any section / table / etc, and it will expand to fill the available space. You’ll want to customize this further to include your branding, layout, tracking pixels, etc.
<apex:page showHeader=”false” standardStylesheets=”true” id=”PaymentRequest” cache=”false”> <apex:includeLightning /> <apex:slds /> <script type=”text/javascript”> $Lightning.use(“ChargentBase:ChargentTakePaymentApp”, function () { $Lightning.createComponent( “ChargentBase:chargentPaymentRequest”, { ‘formName’: ‘Pay Request’, ‘showCountryField’: true, ‘showEmailField’: true, ‘req’: ‘{!$CurrentPage.parameters.req}’ }, “container”, function (cmp) { } ); }); </script> <div id=”container”></div> </apex:page> |
Chargent Payment Console #
AppFrontier always strives to provide features that lower the scope of your PCI compliance. Chargent’s Payment Console with tokenization can further reduce your PCI scope by allowing secure entry of payment information via the phone, protecting cardholder data that is never stored in your Salesforce database.
Chargent’s Payment Console feature allows you to process one time payments and set up recurring payments, directly from a Salesforce popup window. This makes it a convenient interface for call center agents, customer service, billing or sales teams since it is able to initiate payments, receive tokens back from the payment gateway, and create transaction records in Salesforce.
Most importantly, with the Payment Console feature, transactions and tokens are created without ever saving or storing cardholder account number information in Salesforce. This helps you reduce the scope of your PCI Compliance.
How Payment Console Works
When a user clicks the Payment Console button in Chargent Anywhere, they will see a popup prompting you to enter the billing address and payment data. You will be able to select what payment method you want to use in order to process a one time payment or setup a recurring payment schedule.
Activation Key:
When you set up your Payment Gateway using the Chargent Setup Wizard, you are prompted to set up the Payment Console. When you select ‘Yes’, an email is sent on your behalf requesting an Activation Key. Once you receive the Activation Key you will need to enter it into Salesforce.
You can enter your Activation Key by navigating to Chargent Settings and selecting the Chargent Feature Activation tab. You will also be able to request an activation key if you didn’t request it during the gateway setup.
- Click the [App Launcher] in the top left corner and select [Chargent app].
- Click [Chargent Settings] and the sub tab for [Chargent Feature Activation].
- Copy and Paste the Activation Key and click [Save]
Payment Console Setup
If you originally chose to add the Payment Console during the initial setup of your payment gateway, you have already selected the buttons you want to display along with the types of credit cards you accept, and the payment methods. You can update these settings through your Gateway record to enable or disable specific features.
Payment Console configuration options are divided into several fields in the Gateway record:
- Available Card Types: Visa, MasterCard, American Express, etc…
- Available Payment Methods: Credit Cards, and/or Bank Account (ACH, echeck, Direct Debit)
- Payment Buttons: Authorize, Charge, Update Token
- Require CVV: This setting will require the CVV / CVV2 Security Code in the Payment Console. This is the 3 digit code on the back of the credit card. It will be either 3 digits for Visa / MasterCard or 4 digits for American Express.
For more information regarding your Payment Gateway settings, please check out the documentation specific to your gateway.
Using the Payment Console
When you have Chargent Anywhere installed on your Page Layout you will see the button to access the Payment Console.

When you click on the [Payment Console] button you will be prompted to enter the Billing Address.
When you click [Continue] you will have the option to select the Payment Method and choose whether you want to do a one time payment, a recurring payment, or a combination of both (one time payment with recurring payments).
Payment Method
This is the payment method (Credit Card of ACH) you configured in the previous section or when setting up your gateway using the Chargent Setup Wizard.
Card: Credit Card (Visa, MasterCard, Discover, American Express, etc…). Chargent works with all major credit cards.
Bank Account: This can be either a Checking or Savings account. Bank Account also refers to ACH, eCheck, or Direct Debit in Australia.
One Time: This indicates that you are looking to process a one time payment.
Recurring: This will allow you to process a one time payment and set up a recurring billing schedule.
One Time Payments
If you are processing a one time payment, and do not need to set up a recurring schedule, you can just enter the above information and press the [Charge] Button.

If the transaction was successful you will see a green success window pop up and a Transaction record will be created. If the transaction is unsuccessful, you will see a red pop-up showing the decline and a Transaction record will be created with the decline reason.

Recurring Billing #
Setting Up A Recurring Schedule
When you choose Recurring, you will have the option of adding a one time initial payment to be processed immediately along with the options to set up your recurring schedule. This field can be left blank if you only want to schedule payments for a future date.

When you have entered in the credit card or bank information, and filled out Amount fields to be processed, you can click the [Next] button to set up the schedule. There are some required fields and some optional fields to set up the billing to your requirements.
Required fields for Recurring Billing
- Frequency
- Payment Start Date
Optional fields for Recurring Billing
- Fixed Day of the Month to Charge
- Stop Rule is defaulted to Unending. Updating this field allows you to set when the recurring schedule should end.
- Date: Recurring Billing schedule ends on a specific date. This requires you to set the Payment End Date field
- Count: Recurring Billing schedule ends after a specific number of transactions. This requires you to set the Number of Payments field.
- Balance Due: Recurring Billing schedule ends once the balance has been met.
- Unending: Recurring Billing schedule continues until you change the status to Stopped.
Clicking [Next] will bring you to the Preview page where you will see the payment schedule. You should verify that the Frequency, Amount, and the schedule is correct. Once everything looks good you can click the button [Charge One Time Amount and Start Recurring Billing].
Add Cash / Add Check #
Add Cash and Add Check both will create a transaction but do not send the payment information to your gateway. They are designed to help you keep track of additional payment types that are associated with the record. Add Check refers to a paper check. These buttons can also be hidden from the page.
- Press Add Cash or Add Check
- You can either select an existing Chargent Order or create a new one by selecting the box that says Create New Order
- Enter the Payment Date
- (Paper Check only) Add the check number
- Enter the Amount
- Click Save.
Customizing the Payment Console
Once you have the configuration done and Payment Console working, you can now customize the Chargent Anywhere Component. You can set the defaults for the following items (please note, some may require custom fields to be added prior)
There are several items that can be setup to pre-populate in Chargent Anywhere.
- Gateway – Assign a specific gateway to be populated automatically when you process a transaction.
- Default Charge Amount – If you have a specific amount that you want to charge every time, you can automatically populate this based on a specific field.
- Default Recurring Amount – Similar to the Default Charge Amount, if you have a specific recurring amount to be processed in your scheduled payments, you can set this as a default based on the field on the record.
- Account – The Account is usually already set on the record however this field can also be set to default when processing payments using the Payment Console.
- Contact – Allows you to select the contact on the record you are processing the transaction from. This will automatically populate to the Payment Console along with this contacts address for billing.
For the above items you will need to add custom fields to the Page Layout in order for these to populate.
- Account and Contact, you would want to do a Lookup field.
- Charge Amount and Recurring Amount you want to do a currency field.
- Gateway you need the Gateway record ID
Create Custom Fields
- Click the [gear icon] and choose [Setup]
- Under [Objects & Fields] select [Object Manager]
- Choose the Object you have Chargent Anywhere installed
- Click [Fields & Relationships]
- Choose [New] and go through the setup for custom fields
When you create your custom fields it will give you a Field Name which you will use to configure the Chargent Anywhere LWC.
Configure Default Settings
- Navigate to a record on the object with Chargent Anywhere.
- Click the [gear icon] and select [Edit Page]
- Select the Chargent Anywhere Lightning Component.
- Add the field names and record ID where specified.
- Click Activate and Save.
Field References:
Gateway ID: You can get the Gateway ID from the URL on the Gateway record.
Additional Items to Configure:
- Show / Hide Remove Buttons: Allows you to display or remove buttons from your Chargent Anywhere Console. This includes Payment Request, Payment Console, Add Cash, and Add Check buttons.
- Change the name of the Charge button: This allows you to modify the button name to whatever suits your organization best.
Manually Scheduling the Apex Batch
If you originally said no when setting up your gateway, or if you are on a version prior to 5.40 and want to schedule your Apex batch manually, then do the following:
- Click on the gear icon
on the top right side and select Setup.
- Under Custom Code select Apex Classes.
- Click Schedule Apex.

- Enter the following fields:
- Job Name: You should name your batch something that reflects Recurring Billing so you can identify it later if needed.
- Apex Class: Click on the magnifying glass and select the “sheduledBatchProcessing” class to be run.
- Job Name: You should name your batch something that reflects Recurring Billing so you can identify it later if needed.
Note: The class name contains a typo – there is no “c” in the word “scheduled”. While that was not intentional, we can’t change it!
- Schedule Apex Execution:
- Frequency = Weekly
- Check every day of the week so that the batch runs daily.
- Start Date = today’s date
- End Date (important): The end date should be far into the future so that the schedule doesn’t end. Once the batch ends the recurring batch will no longer process recurring transactions. 2050 is generally a good year to use.
- Start Time: Although you can choose any time you want we recommend 3am to give your team the whole day to review transactions and make any required adjustments or voids during business hours.

Processing Payments Using Chargent Orders (Legacy Process) #
Note: Chargent Anywhere is the current way you should be processing Payments. If you are on Sites Edition or do not have access to the Payment Console, you may want to use our legacy method of processing transactions directly from the Chargent Order object.
You can also use the Chargent Orders records directly to process payments. Similar to Chargent Anywhere, which creates a Chargent Order record in the background, you can manually create a Chargent Order record and use the Charge, Authorize, Send Payment Request and use the Payment Console.
Chargent recommends you use tokenization rather than storing sensitive credit card information in Salesforce. Tokens can be used in place of the credit card in order to provide greater security. Storing credit card numbers is not recommended for PCI Compliance which is why Chargent provides settings to have the credit card data cleared after a successful transaction, after any transaction, or when a token is present on the Gateway record.
The minimum fields required to process a credit card transaction will vary slightly depending on your payment gateway and your settings. As a best practice, you should complete the basic fields below using the Payment Console or Payment Request tools.
In general terms, however, the following fields should be populated:
- Charge Amount: This is the amount that will be sent to the payment gateway. This field is defaulted to the balance due unless the manual charge box is checked. If you don’t check the manual charge box then you want to fill out the subtotal field, and optionally the shipping and tax fields. See Chargent Order Amounts for more information.
- Billing First Name and Billing Last Name (these automatically populate Credit Card Name when the information gets sent to the gateway)
- Billing Address: The address associated with the credit card
- Billing Zip Code:
- Payment Method (Credit Card or Check — Check applies to ACH / electronic check / Direct Debit)
- Card Type (Visa, Mastercard, Amex, Discover and other payment sources)
- Card Number
- Card Expiration Month (2 digits – MM)
- Card Expiration Year (4 digits – YYYY)
The CVC (Card Verification Code) will be required after you press the Charge button. If you have the CVC required with your payment gateway, then this needs to be populated when the popup asks for it. If you don’t have it required then you can leave it blank and press the Charge button.
If you are doing recurring billing you will need to use tokenization and provide the CVC for the initial transaction. Once a token is present recurring payments will occur as scheduled.
Optional but commonly used:
- Billing Email (some gateways will send a receipt to your customer – Chargent also sends a receipt to this email address when a transaction is processed).
- Invoice Number (may reduce your fees, useful for reconciliation).
- Order Information (may appear on customer receipt as description)
For ACH / eCheck transactions:
- Bank Account Type (Checking, Savings or Business Checking)
- Bank Account Number
- Bank Routing Number
- Bank Account Name (person or company name on bank account)
- Bank Name (name of the financial institution)
Card Details
A Visualforce field that you can add to the page layout to give you a summary of the card information – Type, Last 4, and Expiration Date. It appears green if the card is more than 2 months from expiration, yellow if the card is within 2 months of expiration, and red if the card is expired. When adding this Visualforce page to the Page Layout, update the settings to include the field name.

Chargent Order Amounts
The Chargent Orders Transaction package has the following fields that are involved in calculating a payment value:
- Subtotal
- Tax
- Shipping
The Total field is automatically populated from these three fields. The Balance Due field is made up of the Total minus the total of all past transactions, including both Charges & Refunds. The Balance Due field also populates the Charge Amount field which is the amount sent to be processed with your payment gateway.
The Charge Amount field is automatically populated with the Balance Due however this field can be updated with any Charge Amount providing the checkbox for Manual Charge is checked. If the Manual Charge box is checked then Chargent sends the amount you enter to the gateway.
Chargent Order Recurring Billing
In order to set up Recurring Charges directly from the Chargent Order (versus using the Chargent Anywhere Payment Console above), you will need to create a new Chargent Order record as outlined in the Using Chargent document. Some additional fields need to be set in order to process recurring / subscription billing. Here you will find a list of Recurring Billing options and how they work with Recurring Billing.
Payment Status
Chargent requires a value of “Recurring” to include a record in its batch. There are four Payment Status options that can regulate how Recurring transactions work.
- Recurring: Allows the record to be picked up in the batch for processing based on the frequency, and Payment Start Date.
- Error: If Chargent discovers a problem with the transaction such as a declined form of payment, the payment status will change to “Error” and no further transactions will be processed until the status is changed back to “Recurring”.
- Stopped: You may use the “Stopped” status to temporarily pause recurring transactions.
- Complete: When Chargent reaches a stop event, such as Balance Due, End Date or Count, it will change the status to “Complete”.
Payment Frequency
The Payment Frequency field tells the batch how often to process a payment. This field needs to be set in order for recurring payments to occur. Chargent will look at the last recurring transaction record, check the frequency, then determine by the other Recurring fields if the payment should be processed. Here are the different frequencies that can be set and what they mean.
- –None– (default) – This will not be processed in the Recurring Billing batch
- Once – a single transaction will occur on the Payment Start Date
- Daily – one transaction per day that the schedule process is executed
- Weekly – one transaction per calendar week on the same weekday
- Biweekly – one transaction every two weeks on the same weekday
- Monthly – one transaction per calendar month on the same day as the Payment Start Date
- Bimonthly – one transaction every two months on the same day of the month
- Quarterly – one transaction per every three months on the same day of the month
- Semiannual – one transaction per every six months on the same day of the month
- Annual – one transaction per every year on the same day
- Biennial – one transaction per every two years on the same day

Note: There is a difference between pressing the Manual Charge button and the “Recurring” transactions that occur in the batch. As such, if you are collecting a down payment and setting up Recurring billing, you should set the Payment Start Date to date you wish the next transaction to occur, to prevent it from running prematurely. This can lead to your customer getting charged twice.
Payment Stop
The Payment Stop field is dependent on Payment Frequency. This field determines when transactions should stop running. Chargent offers you four options to manage the payment schedule of a recurring transaction. If this field is left blank, the payment schedule will run indefinitely.
- Date – Chargent will process the last transaction on or before the Payment End Date depending on frequency. Payment End Date needs to be set for this to end based on a date.
- Count – Chargent will stop processing transactions when the number of approved recurring transactions equals the value in the Payment Count field. This is helpful to follow an agreed payment schedule based on number of payments instead of date.
Note: this only tracks against the total number of “Approved” recurring transactions and does not include manual transactions by hitting the Charge button. If you would like to monitor this field, you can display or report on “Transaction Count Recurring”.
- Balance Due – Chargent will continue to process transactions until Balance Due is less or equal to zero.
Note: If the number of payments exceeds the total balance due you may end up charging more than was intended, resulting in a negative Balance Due.
Chargent recommends only using Balance Due when the Charge Amount is evenly divided into the Total.
- Unending – Chargent will process transactions with no stop event for as long as the Scheduled Apex is automatically executed and the Payment Status remains as Recurring..
Charge Date
This optional field can be set to a value (1-31) and recurring charges will be done on that day of the month. Regardless of how long it took to get it paid last time. If a card is declined, then finally approved a week later, the customer will still be charged on the same date next month, rather than 30 days from the previous successful recurring transaction.
This field is not used in Daily, Weekly, or Biweekly recurring transactions, but will work for any time periods Monthly or above. If this field is set to 31, Chargent will automatically charge on the 30th for months with 30 days, or on the 28th/29th of February.
Next Transaction Date
Chargent runs its logic and indicates when the next recurring transaction is going to occur in this field. Useful for reporting, and double checking your configuration.
Please note that the Next Transaction Date field cannot be modified, as it is set automatically by Chargent when a record is saved. For this reason, we recommend setting it to Read Only at the Page Layout level (not the field level security level).
Other Transaction-Related Fields
- Transaction Total: Transaction Total field represents the sum of all transactions including both charges and refunds.
- Status: The Status field indicates the status of the Chargent Order. Based on the total minus all transactions, once the balance due is reached, the Status field gets updated to Complete.
- Transaction Count: will display the sum total and number (respectively) of the Transactions related to this Chargent Order. Once the total of Approved charges equals the Total of the Chargent Order, the order is considered to be paid.
- Payment Received: The Payment Received field should automatically be updated to reflect this status after transactions are finalized, and has no impact on transaction behavior. Values for Payment Received include None, Partial and Full.
- Balance Due: This field automatically calculates the difference between Amount and Transaction Total and is a useful field to display below or near Amount. Remember if “Manual Charge” is not checked, the Charge Amount will automatically reset to Balance Due.
Other fields that you may wish to send include:
- Order Information field, which shows up as the Description in most gateways and email receipts to your customers.
- Invoice Number. Not all gateways use the Invoice Number, but you may get more favorable rates if it is populated, and many companies use it for reconciliation.
Order Information and Invoice Number may be mapped to different fields within your Gateway. Please check our Gateway Guides to make sure your Gateway has these fields mapped and which fields are mapped within your gateway.
Process Builder and Validation Rules
Please be very cautious if you use the Process Builder, Validation Rules or Required fields on your Chargent Orders with recurring billing. Validation rules can prevent the Chargent Order from saving properly after a transaction occurs, and because Recurring transactions run in a batch you would only see the errors in the Apex Jobs monitoring page in Salesforce.
Certain validation rule problems can result in duplicate transactions, so please be sure to test any validation rules in Sandbox prior to deployment. Contact us for additional assistance.
Recurring Versus Manual Transactions
Chargent treats manual and recurring transactions separately. Many customers wish to charge the first transaction manually, to see if it goes through, before setting a recurring billing schedule.
The key thing to remember when running a manual transaction is that after you do a manual transaction, you need to set the Payment Start Date ahead a month or year, etc. to the day when you would like the customer to next be billed automatically, or use the new Charge Date field to indicate the day of the month when they should be billed. Because Chargent does not see manual charges as part of the recurring schedule, if you do not set the Payment Start Date ahead or the Charge Date is not populated, the following day it will once again attempt a transaction as part of its recurring schedule.
The Payment Start Date is the most effective way of preventing charges before a certain date, as Chargent does not evaluate records for possible charging until the Payment Start Date is today or in the past. So if my Charge Date is 15 and Payment Start Date is set for June 16th, the next transaction attempted will be July 15.
What determines a Recurring charge?
A record will only be considered for processing if the following criteria is met.
- The Payment Status = “Recurring”
- The Frequency is set
- The Payment Start Date is set to a date prior to the batch run
- The last transaction date was greater than the frequency.
- Eg: the last transaction was more than a month ago and frequency is monthly.
- This only applies to transactions that are marked ‘Recurring’. If no transactions are present, or only manually run transactions not marked as recurring, then it would also be counted as outside the frequency and needing to be charged.
Another consideration that determines if a transaction should be processed is the Charge Date.
- Charge Date – If there is a specific day of the month the transaction should be processed.
If no Charge Date is set, Chargent evaluates the “last recurring transaction” and ensures that it has been the correct number of days since the last one was processed (9/15, 10/15, 11/15 if it was monthly). Chargent only looks at the date of the last recurring transaction that was successful (Response = Approved, Recurring = True, not voided).
Chargent Orders that meet the criteria will then be processed, and a transaction with the Recurring field = true will be created (assuming the charge is successfully approved).

Installment Payments
The Charge Amount field is the amount to be charged or authorized by the next transaction. If there are multiple charges, it will automatically reflect the Total of the Chargent Order, minus the total of past successful charges (also shown in the Balance Due field).
Check the Manual Charge field when you want to charge an amount different than the amount due on the Chargent Order, such as a fixed amount every month. This field prevents the Charge Amount from automatically being calculated and updated.
One thing to be aware of when using this manual override, however, is that your Charge Amount will not be prorated. So if the Amount is $100, and you set the Charge Amount is $30, Chargent will charge 4 x $30. The system does not automatically prorate the last amount to equal the remaining balance (if less than the Charge Amount).
To automatically set the Charge Amount to the final balance that is smaller than previous installments:
- Create a workflow rule that fires when the Payment Status is Recurring and the Stop is Balance Due
- Have it check the Charge Amount.
- If the Charge Amount is > Balance Due, set the Charge Amount to the Balance Due
When the next to last transaction gets run, the totals update and the charge amount would be updated at that time preparing it for the final charge.
Usage Examples
Charge a Credit Card manually from Salesforce, and then set a Recurring Payment schedule
- Recurring Payment Via Payment Console (Chargent Anywhere)
- Click Payment Console
- Select your Payment Gateway
- If you have your Page setup to select Contacts select the contact from the dropdown, otherwise enter the credit card billing address.
- Click Continue
- Select the Recurring option and enter in Payment Details
- Enter both the Initial Amount and Recurring Amount
- Click Next
- Set the Frequency and Payment Start
- Optional (set the Payment Stop)
- Optional (Set Day of the Month)
- Click Next
- Review the Scheduled Payments
- Press the “Charge One Time Amount and Start Recurring Billing” button.
- Recurring Payment Setup from a Chargent Order (Sites Edition)
- Enter a Subtotal or Total in the Chargent Order record
- Set Manual Charge to “TRUE” and enter Charge Amount (this prevents the Charge Amount from recalculating based on Total minus Transaction Total)
- Set Payment Method to “Credit Card”
- Choose a Payment Frequency (anything from daily to Biennial)
- OPTIONALLY choose a Payment Stop (Date, Count, Balance Due or unending)
- OPTIONALLY choose a Charge Date to have the customer billed on the same date of the month
- Set Payment Status to “Recurring”
- Save the record

Be sure to set your Payment Start Date to when the next transaction should process. The recurring batch will not recognize the initial charge using the charge button since the transaction record will not have the Recurring box checked.
Single Scheduled Transaction
To run a single scheduled charge in the recurring batch, first complete the Billing and credit card data as shown in the Recurring Billing setup above (Although it’s a one time charge Chargent still requires the recurring billing batch to pick it up automatically for a one time charge in the future).
- Set Payment Frequency to “Once”
- Set Payment Status to “Recurring”
- Set Payment Start Date to the date you want the single charge to run.
- Save the record
Recurring Billing Declines
If a card is declined as part of the scheduled Apex batch that runs recurring billing transactions:
- Payment Status will automatically change from Recurring to Error.
- Once you have received updated billing information, change the Payment Status back to Recurring.
- If you have processed a charge manually outside of the recurring billing schedule by clicking the Charge button, be sure to set the Payment Start Date ahead to the next time the record should be billed, to avoid a recurring charge the next time the batch runs.
Account Updater #
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
- Test 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.
Prerequisites
- Account Updater works with Chargent version 6.0 and newer. 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();
Database.executeBatch(b);

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.
{!ChargentOrders__Email_Notification__c.ChargentOrders__Account_Updater_Link_Formatted__c}
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
There are a few additional customizations that you are able to do under the Chargent Advanced Settings options.
- User 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)

To Access Chargent Advanced Settings:
- Click the App Launcher and select Chargent App.
- Click the Chargent Settings tab.
- Click the Advanced Settings sub-tab.
Automated Collections #
What is Automated Collections?
Chargent Automated Collections is an add-on module that automatically communicates with customers, letting them know that they’ve missed a payment. This feature provides them with a Payment Request link that allows them to update their payment information and get their account back in good standing.
Automated Collections also allows you to automatically retry collecting payments based on the schedule and logic that you choose. It takes minutes to configure and activate. Once activated, there’s no more need to spend time sending emails and making phone calls to collect on late payments.
Prerequisites
- Chargent Base and Transaction Packages version 5.85 or newer installed
- Chargent configured with active gateway
- Payment Request is already configured
- The Automated Collections feature is activated (subscription required)
Setting up the Automated Collections Batch
In order for Automated Collections to work, you need to schedule a daily batch to run. The daily batch looks for records with the following.
- Payment Status = Automated Collections
- Next Transaction Retry date on the Automated Collections Stage Record
To Schedule the Batch:
- Click on the gear icon and select Setup.
- In the Quick Find, search and select Apex Classes
- Click the [Schedule Apex] button
- Provide a Job Name
- Use the Magnifying Glass to search for Automated Collections ScheduledBatchAutomatedCollections
- Select the Frequency Weekly and check every day of the week.
- Modify the End Date to be a distance in the future like 12/31/2099
- Select the Run Time for your batch (we recommend running the batch in the middle of the night so reconciling can be done in the morning).
- Click [Save]

Enabling Automated Collections
- Click the App Launcher and select the Chargent App
- Click the “Chargent Settings” tab and select the “Chargent Automated Collections” subtab
- Toggle the Automated Collections switch to Enabled
Add Your Failed Payment Stages
There are two things that need to be set in order to set up each stage of Automated Collections
- Email Template: The email you want to send for each stage
- Retry Options: How long after the failed payment you want Chargent to automatically retry charging the card or bank account on file

To add a new stage click the icon above the [Cancel] / [Save] buttons
If you already have an Email Template setup for this stage you can select it from the drop down menu then select the Retry Option based on the sequence.
Add / Edit Email Template
Note: The following merge fields need to remain in your email template in order for Automated Collections to work.
[[amount due]] [[decline date]][[payment request link]]
You can add new email templates or modify existing templates in order to customize your automated messages. Email templates are sent based on your Retry Options and should coincide with the sequence. For example, the first email may just be a reminder that a payment was missed, whereas the 3rd email may be a final attempt for payment before deactivation or termination.
To create a new email template or edit an existing one, click on the pencil icon and select the appropriate action.
You will see 3 icons: View: This allows you to view the existing Email Template
Edit: This allows you to edit the existing template
Delete: This will allow you to delete the existing template
To create a new template, click the [New Email Template] button
When creating the new template, you will need to provide the following:
- Email Template Name – a name to identify the template
- Description (optional) – a brief description of what the template should accomplish
- Subject Line for the email – something to catch their attention
- Email Body – what the template for this stage should say.
Be sure to click the [Save] button when you are finished setting up your Email Templates and Retry Options.
Advanced Settings:
In the “Advanced Settings” tab, you will have additional options for customizing your Automated Collections setup. You can control both the ‘Automated Collections Batch Chunk Size’ and the ‘Expiration Time in Hours’.
- Automated Collections Batch Chunk Size: This tells Salesforce how many records to batch. If you have 120 records, and this is set to 30, then you will have 4 batches of 30 records each.
- Automated Collections Expiration Time in Hours: This setting tells when to expire the completed Automated Collections Records, and also when they should be deleted.
How Automated Collections Works
When you enable Automated Collections and set up your stages above, the batch will run daily and look for failed payments. If a failed payment is detected, the Payment Status field of the Chargent Order record will change from ‘Recurring’ to ‘Automated Collections’ and begins the automated collections process.
Note: If the Payment Status updates to Error, you want to make sure that Automated Collections is enabled and you have at least one stage setup to be automated.
The transaction will be attempted based on the “Retry Options” you’ve chosen for each stage, and the automated collection email templates will be sent each time those retries fail.. Each time an Order record has the Payment Status of “Automated Collections,” a Chargent Automated Collections record is created along with a Chargent Automated Collections Stages record for each upcoming retry attempt.

When a successful Payment is made, all unused Chargent Automated Collections Stage records are deleted, and the used records are subsequently deleted based on the “Automated Collections Expiration Time in Hours” field in the “Advanced Settings” tab.
The Payment Status is automatically set back to Recurring in order to process all future payments as normal.
Example of an Automated Collection flow
Failed Payment #1
Email Template: Automated Collections Payment Request. This indicates to the customers that their payment failed and provides them with a link to update the payment information and re-submit the payment.
Retry Option: 3 Days After. This means that Chargent will try to charge the payment device on file 3 days after the initial declined payment.
Failed Payment #2
Email Template: An email explaining that the payment failed recently, and that you’ve recently sent a payment link they may use to correct the issue. This email can provide contact information for your billing department, as well as any next steps your customer should take to resolve this matter.
Retry Option: Day of The Month, 1 or 16. This retry will occur the day after most people receive their paycheck, and may have a better chance of success if the reason for the original decline was insufficient funds.
Failed Payment #3
Email Template: An email explaining to your customer that you’ve attempted to collect payment unsuccessfully, and that their subscription or service will be suspended (depending on your policy).
Retry Options: ‘Stop Recurring, Mark as Unpaid.’ This option will remove the Order from the daily recurring batch and mark it as ‘Unpaid’ or ‘Error.’
Looking for more information on Automated Collections? Check out our Automated Collections Page and our documentation.