AppFrontier

Table of Contents

Chargent Features



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 Requests

Prerequisites

  • 1. Setup 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]

    site

    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.
  • Setup My Domain

    • Click the gear icon and select Setup
    • In the Quick Find search for and Select “My Domain
    • Follow the steps to setup My Domain

    domain

    Note: There is a time delay between Domain Registration and Domain Ready for Testing. You have to complete all steps and Deploy the domain to Users.


Payment Request Setup

Once you have My Domain deployed and your Site setup, make sure you are on Chargent version 6.20 or newer, so you can access the Payment Request Setup wizard

Note: If you are on a version prior to 5.84 please contact our support team for assistance with updating.

  1. Click on the App Launcher and select the Chargent app
  2. Click Chargent Settings
  3. 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.



Payment Request Legacy

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:

Payment Request Site Selection

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.

Payment Request 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. 

Payment Request Customize Page

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. 

  1. Upload your background image as a Public Static Resource in Salesforce
  2. Copy the URL for the image 
  3. Enable Custom Background in your Payment Request Setup
  4. 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.  

Payment Request change look and feel

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. 

Payment Request Card

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

Payment Request Card



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..

  1. Click the Send Payment Request button in the Chargent Anywhere Lightning component
  2. If you have multiple Payment Request Templates you will need to select the template you want to use. 
  3. 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).
  4. Enter the correct Currency
  5. Enter the Request Amount
  6. Enter the Payment Request Type: You have 3 of Payment Request Types
    Note: These options are only visible when configured through your Payment Gateway Record

    • Charge Full Amount (default) - This will charge the total of the Payment Request
    • Authorize Full Amount - This creates an authorization only and does not charge the transaction
    • Authorize Minimum - This will only authorize the minimum amount your gateway will allow (this is generally $1.00)

  7. Enter optional info in the Request Notes (These are notes the recipient of this Payment Request will see in the email they receive)
  8. Click the Send Request button


Payment Request

Here is the email that the customer will receive showing the link to make their payment (fully customizable Salesforce email template).

Payment Request Email

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.

Payment Request Card

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.

Payment Request Paid

Payment Requests for Developers

Using Developer Pages

If you choose to use Custom 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
Using <apex:slds />

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:support@appfrontier.com" styleClass="maillink">support@appfrontier.com</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 Custom Pages:

  1. Navigate to Setup > Sites & Domains > Sites
  2. Click the [Edit] button next to the Site your Payment Request configuration is using
  3. Click the Search icon next to the “Activate Site Home Page” field
  4. Select the Visualforce page you customized for Payment Request
  5. 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:

  1. Active Site Homepage
    • Placing your custom page here means that anyone who accesses the site URL will be presented with your custom Payment Request page
  2. Available Visualforce Pages
    • Placing 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 “Use Custom Page” setting to Enabled in the Payment Request Setup Wizard.

  1. Click the App Launcher icon applauncher at the top-left of your screen, then click the “Chargent” app
  2. Click the “Chargent Settings” tab
  3. Click the “Chargent Payment Request Setup Wizard” tab
  4. Click the [Next] button to navigate to the Layout page of the wizard
  5. Click the toggle switch for “Use Custom Page”
  6. 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.

Chargent Payment Console


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.

  1. Click the [App Launcher] in the top left corner and select [Chargent app].
  2. Click [Chargent Settings] and the sub tab for [Chargent Feature Activation].
  3. Copy and Paste the Activation Key and click [Save].

Chargent Payment Activation

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:

  1. Available Card Types: Visa, MasterCard, American Express, etc...
  2. Available Payment Methods: Credit Cards, and/or Bank Account (ACH, echeck, Direct Debit)
  3. Payment Buttons: Authorize, Charge, Update Token
  4. 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.

Advance Tokenization Setup

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.

Chargent Anywhere

When you click on the [Payment Console] button you will be prompted to enter the Billing Address.

Chargent Anywhere

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.

Recurring Billing

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.

Recurring Billing

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

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.

Recurring Billing

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.

Recurring Billing

Chargent Payment Console

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].


Chargent Payment Console

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.

  1. Press Add Cash or Add Check
  2. You can either select an existing Chargent Order or create a new one by selecting the box that says Create New Order
  3. Enter the Payment Date
  4. (Paper Check only) Add the check number
  5. Enter the Amount
  6. 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

  1. Click the [gear icon] and choose [Setup]
  2. Under [Objects & Fields] select [Object Manager]
  3. Choose the Object you have Chargent Anywhere installed
  4. Click [Fields & Relationships]
  5. 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.

field

Configure Default Settings

  1. Navigate to a record on the object with Chargent Anywhere.
  2. Click the [gear icon] and select [Edit Page]
  3. Select the Chargent Anywhere Lightning Component.
  4. Add the field names and record ID where specified.
  5. Click Activate and Save.

Field References:

Gateway ID: You can get the Gateway ID from the URL on the Gateway record.

gateway

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.

gateway id

Chargent Payment Console should now be configured. For additional help with Payment Console, please check out our Knowledge Base or contact our Support team.


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:

  1. Click on the gear icon gear icon on the top right side and select Setup.
  2. Under Custom Code select Apex Classes.
  3. Click Schedule Apex.

  4. apex

  5. 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.

    • 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.

frequency

Processing Payments Using Chargent Orders

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:

  1. Bank Account Type (Checking, Savings or Business Checking)
  2. Bank Account Number
  3. Bank Routing Number
  4. Bank Account Name (person or company name on bank account)
  5. 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 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.

credit card

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

frequency

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).

  • 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 Receivedfield 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 a 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 ensure 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).

recurring

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:

  1. Create a workflow rule that fires when the Payment Status is Recurring and the Stop is Balance Due
  2. Have it check the Charge Amount.
  3. 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

  1. 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.

  2. 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

payment

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).

  1. Set Payment Frequency to "Once"
  2. Set Payment Status to "Recurring"
  3. Set Payment Start Date to the date you want the single charge to run.
  4. Save the record


Recurring Billing Declines

If a card is declined as part of the scheduled Apex batch that runs recurring billing transactions:

  1. Payment Status will automatically change from Recurring to Error.
  2. Once you have received updated billing information, change the Payment Status back to Recurring.
  3. 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 Dateahead 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.

  1.   Schedule the Account Updater Batch
  2.   Add SOQL String to the Chargent Settings
  3.   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 customers credit card.

To Set Up the Batch:

  1. Click the gear icon and select Setup
  2. In the Quick Find search and select Apex Classes
  3. Click the [Schedule Apex] button
  4. Name the batch Account Updater
  5. Use the Magnifying Glass to search for the Apex Class TChargentBatchCheckCards
  6. 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.
  7. 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).
  8. 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.
  9. Click [Save]

Account Updater Scheduling

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.


  1. Click on the App Launcher and select Chargent App
  2. Click the Chargent Settings tab
  3. Click on Advanced Settings
  4. In the Account Updater Search Criteria enter the following string.

  5. ChargentOrders__Payment_Status__c = 'Recurring'

  6. 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.

  1. Click the App Launcher and select the Chargent App
  2. Click the Chargent Orders tab
  3. Click [New]
  4. 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.
  5. 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);

Enter Apex Code

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.

  1. Click on the gear icon and select Setup
  2. In the Quick Find Search and Select Classic Email Templates
  3. From the dropdown menu select the Chargent Templates folder
  4. Click the Email Template Name for Account Updater Feature Html
  5. 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.

  1. From the Select Field dropdown, choose the object you want to pull fields from
  2. Select the Field you want from the Select Field dropdown
  3. Copy the merge field into the template

Available Merge Fields

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)


Account Updater Customization
To access Chargent Advanced Settings:
  1. Click the App Launcher and select Chargent App .
  2. Click the Chargent Settings tab.
  3. 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 failed 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

  • You are on the most current version of Chargent Base and Chargent Orders Transaction Packages
  • Chargent configured with active gateway
  • Payment Request is already configured
  • The Automated Collections feature is activated (subscription required)

Enabling Automated Collections

  1. Click the App Launcher and select the Chargent App
  2. Click the “Chargent Settings” tab and select the “ Automated Collections” subtab
  3. Toggle the Automated Collections switch to Enabled

What type of Automated Collections process would you like to create?

There are two types of processes that are able to be set up with Automated Collections.

  1. Automatic Retries + Emails
  2. Automatic Retries Only


Create Automated Collection

Automatic Retries + Emails

This option will allow you to retry the transactions and send an email notification, that contains a Payment Request link, on a schedule that you set up.

Automatic Retries Only

This option will only retry the transactions on a schedule you set up. It will not send email notifications with Payment Request links.

Setting Up a New Automated Collections Process

You have the ability to set up different Automated Collections processes. If you have monthly subscriptions that are different from annual subscriptions you can send different collection messages for each situation.

  1. Click the App Launcher and select the Chargent app
  2. Click the sub tab for Automated Collections
  3. Make sure to toggleAutomated Collections to enable it
  4. Click the [New] button
  5. Select which type of Process you want to set up (Automatic Retries + Emails or Automatic Retries Only)
Automatic Retries + Emails
  1. Automated Collections Configuration Fields:

    • AC Process Name: Name the Process so that you can identify it later.
    • Sender Email Address: This is the email address that is set up in the Organization-Wide Email Address in your Salesforce settings.
    • Criteria: This will set which records the Automated Collections batch will consider for processing. Either All Chargent Orders or specific Rule Based criteria based on the AC Criteria field on the Chargent Order record.

      AC Criteria Value: This needs to match the AC Criteria field on the Chargent Order record. When the AC Criteria Value matches the Criteria field, The Automated Collections process will run. This will not review every Chargent Order.

    • Payment Request Page: If you have multiple Payment Request Payform Layouts set up you will be able to select which Payform to use when someone clicks on the paylink.

  1. Stages: Each Stage represents the steps of your Automated Collections process. You can add as many stages as you want, however, the goal is to retry payments, send emails, and if unpaid, mark the record as Error.

    • Time Frame: Time Frame indicates when the Stage should be triggered.

      • Immediately
      • # Days After
      • # Weeks After
      • # Months After
      • Day of the Month
      • Day of the Week

    • Time Frame Detail: This indicates the number of days, the day of the week, or the day of the month represented in the Time Frame.

    • Retry Payment: Do you want to retry the payment, just send an email, or mark the order as Error (unpaid)?

      • Yes / No
      • No Retry - Mark Order as Error

    • Send Email on Failed Retry: If the retried payment fails, do you want to send an email? You can select the default Automated Collections Email that is supplied or select any email template you have set up or created. See Customizing Email Templates below.

    • Sender Email Address: From your Organization-Wide Email Addresses (this is in your setup)

    • CC Email Address (Internal): Allows you to add a carbon copy email address to the Payment Request Emails that are sent out.


Create Automated Collection

Create Automated Collection

Add Stage: Continue adding stages until you are satisfied with your Automated Collections process.

Automatic Retries Only

Automatic Retries Only will allow you to set up the same Configuration as above (Automatic Retry + Email) but only sets up the ‘retry' option. Select this option if you do not want to send emails with an Automated Collections Payment Request.

Automated Collection

Rescheduling the Automated Collections Batch

When setting up Automated Collections, the batch is automatically created and scheduled for 5am daily when you toggle ‘on’ the Automated Collections feature. The daily batch looks for records with the following.

  • Payment Status = Automated Collections
  • Criteria will examine either all Chargent Order records or an AC Criteria Value from the Chargent Order field.

If you would like to change the time the batch runs you will need to delete the current batch and schedule a new batch for the time you choose. Keep in mind that batches should not be scheduled at the same time in order to prevent them from conflicting, and we recommend that Automated Collections run several hours after your Chargent recurring batch, to make sure the recurring process has fully completed first.

To Delete a Scheduled Batch:

  1. Click on the gear icon and select Setup.
  2. In the Quick Find, search and select Scheduled Jobs
  3. Locate the batch named Chargent Automated Collections Batch
  4. Click Del to delete it

To Schedule a new Batch

  1. In the Quick Find, search and select Apex Classes
  2. Click the [ScheduleApex] button
  3. Provide a Job Name
  4. Use the Magnifying Glass to search for Automated Collections ScheduledBatchAutomatedCollections
  5. Select the FrequencyWeekly and check every day of the week.
  6. Modify the End Date to be a distance in the future like 12/31/2099
  7. Select the Run Time for your batch (we recommend running the batch in the middle of the night so reconciliation can be done in the morning).
  8. Click [Save]


Automated Collection

Clone / Edit / Customize Email Templates

Chargent uses Salesforce Classic Email Templates for Automated Collections. Chargent provides a standard Email Template. You can modify the existing template or clone it to customize. You can also create your own to use as your Automated Collections Payment Request.

  1. Click the gear icon and select Setup
  2. In the Quick Find search and select Classic Email Templates
  3. From the dropdown menu select ‘Chargent Automated Collections Templates
  4. Click on the Name of Automated Collections Payment Request

Here you have the option to Clone or Edit the Email Template.

Automated Collection

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 begin 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.

Automated Collection

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.