When it comes to Salesforce Billing, it is termed as an add-on package that automates invoicing and allows businesses to accept and allocate payments on the salesforce platform simply. In Salesforce CPQ, a sales rep finalizes a quote and creates an order from it. Salesforce Billing picks up the order for generating an invoice, payment, and revenue recognition records. In this way, it plays a significant role in the Quote-to-Cash process. An organization needs to maintain the correct billing standards. A key to customer satisfaction is invoicing and handling the payment in a way that works best.
In this blog, we will explore more about payment processing in Salesforce Billing.
Below is the high-level flow of the Payment Data Model, which involves leading objects like Account, Invoice, and Payment.
Salesforce Billing allows you to create an invoice record manually or automate the invoice creation process with an Invoice scheduler. When it comes to an invoice scheduler, it evaluates order products as per user-defined criteria and creates an invoice with invoice lines.
Invoices display an inventory of purchased items and services alongside the total amount a customer must pay. The invoice record itself contains important details like the balance, due date, and payment status.
Before going into much detail to understand how the invoices are processed for payment, Let's explore the critical fields and functioning of objects like Payment Gateway, Payment Method, Payment Scheduler, Payment Run and Payment.
Payment Gateways are external service providers that process the payments. It contains the information for building the connection between salesforce billing and the external gateway.
Salesforce Billing offers payment processing integration with many payment gateways like CyberSource, AuthorizeDotNet, Payeezy, etc. To configure the payment gateway, we need to install the AppExchange package and follow the steps mentioned in its documentation.
Here we are using CyberSource as Payment Gateway as shown below:
|Active||It must be Active.|
|Default||If it is checked, then all transactions in Salesforce Billing use this payment gateway.|
|Gateway Type||It is a picklist having values for CyberSource, AuthorizeDotNet, and Payeezy.|
Now that the payment gateway record is created, Let's create a payment method:
The Payment Method stores ACH or credit card details for a customer and information about the payment gateway. The most efficient payment methods are to quickly submit payments rather than manually entering the payment information each time while payment occurs.
In Salesforce, we can create payment method records from the related list on Account. It is shown below:
Note: There can be only one Payment Method on an Account that must be selected as AutoPay.
While creating a payment method, the user needs to enter credit card details. The sample test data is shown below:
|Payment Gateway||It is a lookup of the payment gateway record used for creating the payment.|
|Payment Type||It is a picklist having values for Credit Card and ACH.|
|AutoPay||It is a checkbox field. If it is checked, then this payment method is automatically considered for creating payments on this Account.|
|Payment Gateway Token||It is a unique value representing the payment method with the payment gateway.
Salesforce does not expose sensitive customer information during the payment process, such as credit card numbers; instead, it uses this token value against the payment.
After a record is created for the payment gateway and the payment method, you must create a payment scheduler to process payments for posted invoices with unpaid payment status.
Payment Scheduler is an object used to schedule the payment run process, as the name suggests. It has information for start date & time, target date, payment type, and schedule type. The scheduled frequency can be once, daily, weekly, or monthly.
|Payment Batch||It is an optional field, but it has value. It evaluates the invoices with a matching value.|
|Payment Type||It is a multi-select picklist with values such as ACH and Credit Card|
|Start Date and Time||It is needed to start the first payment run, regardless of type.|
|Target Date||It is used to evaluate the invoices for processing payment based on date value.|
Based on the Salesforce billing package level settings shown below, we can choose whether the scheduler picks up the invoices based on invoice date or invoice due date.
Payment Run is used to automate the collection of payments against recurring charges. A payment run evaluates an account's payment method or the payment method overridden on the Invoice and uses that method to collect payments for posted invoices.
Once the Payment schedular picks the invoices for processing, the corresponding payment run record gets created. It is available as a related list on payment Schedular as shown below:
The Payment run contains information about the number of Invoices processed, successful transactions, failed transactions, total transactions generated, and total payment processed.
It also has details for start time & completed time for payment run.
|Payment Scheduler||It is a lookup to the payment scheduler record from which this payment run is created.|
|Status||It is a picklist with values like Started, Processing, Completed, Failed.|
|Target Date||It stores the value from the payment scheduler Target Date to process the invoices.|
|Start Time||It stores the start date and time for the payment run.|
|Completed Time||It stores the completed date and time for the payment run.|
Once the payment run completes processing, it generates Payment Transaction records for the invoices. It has details like Gateway Status, Response Code, Response Status, Response Gateway ID, etc. as shown below:
If the transaction is Approved, the "Payment Created" checkbox is checked on the payment transaction record, and the corresponding payment record is generated in Salesforce.
It is used in Salesforce to capture the payment details. A payment record stores information about the amount of the payment, the payment type and looks up to the Account where the payment can be applied.
It also stores information about Payment Allocations, Unallocations, and Refunds.
|Payment Number||It is an autogenerated unique ID for this payment record.|
|Payment Type||It stores the value for the type of payment used. It has values like ACH, Bank Transfer, Cash, Check, and Credit Card.|
|Amount||It is a currency field that stores the amount for processed payment.|
|Status||It is a picklist field that defines the state of the payment. It has values like Draft, Cancelled, and Posted.|
When a payment run creates a payment for an invoice, it automatically creates Payment Allocations against the full balance of each invoice line. It is available as a related list on the payment record.
There is one more important feature provided by Salesforce Billing, that is to apply for Refunds. It can be provided when customers want to cancel or change their invoiced order products by un-allocating the payment amount.
Criteria for Invoices to be picked up by Payment Scheduler
For an Invoice to be picked up by Payment Scheduler, the following are important criteria that must be satisfied.
- Invoice Status should be posted.
- The balance on the Invoice should be greater than 0.
- The Payment Batch field on the Invoice must be contained in the multi-select picklist Payment Batch on the Payment Scheduler, or they must both be null.
- The Default Payment type, i.e. (Credit Card, ACH), must be contained in the Payment Type on the Payment Scheduler.
- The Target Date on the Payment Run must be greater than or equal to the invoice date or Invoice due date based on the package settings "Payment Scheduler Pickup Date (on or after)."
- There must be an Active, Default Payment Method on the Account that is set to "Auto Pay" or Autopay Payment Method must be overridden on the Invoice.
- The Payment Gateway value on the Active Default Payment Method must match the Payment Gateway value on the Payment Scheduler.
- The Corrective Action (Payment Run) field on the Invoice should be null.
If any of the above criteria is not fulfilled, then there might be a chance for invoices not to be picked up by the payment scheduler.