Table of Contents

Chargent Documentation

Payment Requests and Console

Chargent gives you a number of interfaces for controlling payments inside Salesforce.

  • Payment Request enables you to send links to your customers so they can securely enter their payment details online

  • Payment Console gives you a popup window for entering credit card or bank payment details while on the phone with your customer

  • Chargent Anywhere ties together both Payment Request and Payment Console, enabling them to be accessed from anywhere in Salesforce, as well as making Recurring Billing setup easier.

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.

Payment Requests

Our Payment Request feature allows you to generate and send a payment link (URL) to your customers directly from any object you’ve configured Chargent Anywhere on. This payment link can also be used in Salesforce email templates, your own email service / application, over IM, or really any media that has clickable links!

Chargent's Payment Request feature is available as a button on the Chargent Order, and can also be added through Chargent Anywhere, It is available with Chargent’s Sites Edition and above. Setup for Payment Request is required.

send payment

Note: If you are using your own Visualforce Pages from a previous version of Payment Requests, you can view the original documentation here. The setup instructions will no longer work with the Salesforce Security Updates to the Guest User (Winter ‘21) however this can be used as a guide in troubleshooting possible issues with any past configurations.

Payment Request Setup & Configuration

Note: Salesforce will be applying Security Updates that will affect how Payment Requests work in Chargent. This guide is designed to help you set up Payment Requests for the first time or If you’ve already applied these updates (or want to prepare for the updates).


  1. Setup your Site:

  2. Note: If you are upgrading, 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.

    • Create a 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


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


    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, you will want to make sure you are on Chargent version 5.84 or newer. If you are on an older version of Chargent you can upgrade using our PIM (Package Installation Manager). This will add the Chargent Payment Request Setup Wizard to your Chargent Package.

  • Some of the following steps have been updated and may be slightly different depending on the version of Chargent you are running.

  1. Click on the App Launcher and select the Chargent app
  2. Click Chargent Settings
  3. Click the sub tab for Chargent Payment Request Setup Wizard.

The App will determine if you have a previous version of Payment Requests installed and will walk you through mirroring the existing setup. If this is your first time installing Payment Requests, it will guide you through the process.

Site Selection:

The first step of the configuration is the Site Selection. Here you will see the Salesforce Site you setup previously and any additional Sites that may have already been setup. You will choose the one dedicated to your Payment Requests:



Step 2: The configuration page will mirror your Gateway settings. If this is your first time setting up Payment Requests, it will provide the recommended settings, otherwise it will mirror your Payment Request settings on the Advanced Settings tab. Here you will set the following:

  • Payment Methods you want to accept? This is either credit card or Bank Account (ACH, eCheck, Direct Debit)
  • Create Payment Requests for all Chargent Orders will create a Payment Request record for every Chargent Order created. Keep in mind this will also create a Payment Request for any transaction that is done from within Salesforce including the Payment Console.
  • When to have Payment Requests Expire in Days. This sets the expiration date for your Payment Request links. The Payment Request Status field on the record will change to Expired.
  • Show Debug is for when you need to test and see the data going from your Salesforce account to your Payment Gateway. This should always be set to No or unchecked in the gateway if you are processing live transactions.



The Use Developer Pages will be defaulted to enabled if you have a previous version of Chargent Payment Requests configured. This allows you to use your previously deployed Payment Request pages. If you would like to customize your Payment Request pages, you will want to toggle this setting to disabled and use the steps below.

Step 3: Upload your Company Logo

  • Click the [Upload] button to add your Logo (recommended size is 250px or less)

Step 4: Choose your Payform Location

  • This sets the alignment of your form to either Left, Center, or Right.

Step 5: Additional Fields

  • Show email field in billing address on the payform
  • Show Country field in billing address on the payform

Step 6: Edit Your Welcome Text

  • Your Welcome Text will display with the logo on your form and can provide direction to filling out the payment information.


Step 7: Edit your Success, Failure, and Cancel Page Messages

  • Customize your Success, Cancel, and Fail Page to let customers know the payment they used 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.

Step 8: Edit your Page Footer

  • You can include a small logo to your footer text as well as custom links to your company’s website.


Allows you to Preview the Page and finish.

Sending a Payment Request

If you have Chargent Anywhere installed, you can access the Payment Request button on the object you have Chargent Anywhere installed.


To send a Payment Request:

  1. Click the Send Payment Request button.
  2. Enter in the Email Address that you want to send to.
  3. Select a Contact (Optional)
  4. Click the Send Request button.


The recipient will receive the email with the secure link to the Payment Request Form that you created previously. They will enter in their payment information and process the transaction.


When the payment processes they will receive a success page that you created indicating the payment went through. Otherwise they will receive the fail message you created.


You are now setup with the Chargent Payment Request LWC feature.

Payment Requests for Developers

Using Custom 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 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="" ></apex:outputLink>
                  <apex:outputText value=" | " styleClass="footertext"/>
                  <apex:outputLink value="" styleClass="maillink"></apex:outputLink>
                  <apex:outputPanel layout="block" styleClass="band" />

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 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 () {
                        'formName': 'Pay Request Form',
                        'req': '{!$CurrentPage.parameters.req}'
                  function (cmp) {}
<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: 


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:

  1. FailPage
  2. Success Page (Make sure to replace the space with _ )
  3. CancelPage

You would specify this in the component as follows:

<script type="text/javascript">
      $Lightning.use("ChargentBase:ChargentTakePaymentApp", function () {
                        'formName': 'Pay Request Form',
                        'req': '{!$CurrentPage.parameters.req}',
                        'failPage' : 'FailPage',
                        'successPage' : 'Success_Page',
                        'cancelPage' : 'CancelPage'
                  function (cmp) {}
<div id="container"></div>

Activating Your Custom 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 () {
                                    'formName': 'Pay Request',
                                    'showCountryField': true,
                                    'showEmailField': true,
                                    'req': '{!$CurrentPage.parameters.req}'
                              function (cmp) {
      <div id="container"></div>


Chargent Payment Console Documentation


Note: If you are using Chargent for Opportunities, Cases, or you are processing payments directly from the Chargent Order object, you will want to use our Salesforce Classic setup and configuration documentation. This guide is specific to Chargent Anywhere, in Salesforce Lightning.


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.

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



If you chose to add Payment Console 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.


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.


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, Direct Debit

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.


Setting Up A Recurring Schedule

When you choose Recurring, you will be prompted to set up your recurring schedule.

Required fields for Recurring Billing

  • Frequency
  • Payment Start Date

Optional fields for Recurring Billing

  • Fixed Day of the Month to Charge
  • Stop Rule 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].


Customizing the Payment Console

Note: Chargent Anywhere should already be set up and configured to customize 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.


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.


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.

Account Updater

Account Updater is a Scheduled Apex batch which checks the Credit Card Expiration Date fields on the Chargent Order Transaction package. Credit Cards that are expiring this month (or are already expired when the batch runs) are sent update notifications.

Please note that many Payment Gateways offer Account Updater services as well. These work without the cardholder needing to make any update, by updating the card on file related to the token stored in Salesforce.

Account Updater is based on Chargent's Payment Request feature, and works similarly, but simply stores updated billing information without processing a payment. An email notification is sent to customers with expired or expiring cards, with a link that takes them to a self-service hosted payment page.

Hosted on your own Salesforce Site, the payment page features a brandable, secure credit card form, where your customers enter their payment information. A customer's billing address is already populated on the form, and they can update it if they wish, along with providing new credit card details. Those values are automatically updated into the associated Salesforce Chargent Order record. This saves time in tracking down customers to provide updated credit card information.


For complete details and setup of Account Updater, check out our Account Updater documentation page.