This document outlines the available automation capabilities within the Payment Connect application, enabling users to streamline and trigger various payment-related actions programmatically. It includes detailed examples and field requirements for automating ACH payments, generating payment links, processing payments using saved methods, initiating fund transfers, and issuing refunds.
1. Automate Requesting ACH Payment
Automate Payment
This automation allows you to initiate an ACH (Pay by Bank) payment directly from a Salesforce record. It supports both immediate and scheduled payments using manually entered bank details. Ideal for scenarios where customers prefer not to use cards and want to schedule payments from checking or savings accounts.
Use this when:
✅ You want to collect payment via bank account.
✅ The customer has not saved a payment method yet.
✅ You need to schedule the payment for a future date.
1.1 Wrapper Fields
|
Field Name |
Description |
Required |
Possible Values / Notes |
|---|---|---|---|
|
|
Mode of Payment |
✅ Yes |
|
|
|
ID of the Parent Record to which the Payment Transaction will be linked |
✅ Yes |
Must be a valid Salesforce Record ID |
|
|
ID of the Payment Gateway record |
✅ Yes |
Must be a valid |
|
|
ID of the existing Payment Method record |
❌ Optional |
Required only if reusing an existing payment method |
|
|
Amount (up to 4 decimal places) |
✅ Yes |
Example: |
|
|
Any additional application fee to include |
❌ Optional |
Decimal |
|
|
Date to schedule the payment. Defaults to the current date if not provided |
❌ Optional |
Format: |
|
|
How the payment should be processed |
❌ Optional |
|
|
|
Bank Account Number |
✅ Yes |
Required for ACH (bank) payments |
|
|
Bank Routing Number |
✅ Yes |
Required for ACH (bank) payments |
|
|
Name of the Account Holder |
✅ Yes |
- |
|
|
ACH Account Type |
✅ Yes |
|
|
|
ZIP Code |
❌ Optional |
- |
|
|
Street Address |
❌ Optional |
- |
|
|
State (2-letter code) |
❌ Optional |
Example: |
|
|
City |
❌ Optional |
- |
|
|
Related Account ID |
❌ Optional |
- |
|
|
Related Contact ID |
❌ Optional |
- |
|
|
Comma-separated list of related record IDs (e.g., Opportunity, Case) |
❌ Optional |
Format: |
|
|
Customer’s phone number |
❌ Optional |
Used if sending payment request via SMS |
|
|
Customer’s email address |
❌ Optional |
Used if sending payment request via email |
|
|
If true, sends the payment request via SMS |
❌ Optional |
|
InvocableAutomatePaymentProcess.PaymentRequestWrapper oWrapper = new InvocableAutomatePaymentProcess.PaymentRequestWrapper();
// Required fields
oWrapper.name = 'Bank'; // or 'Card'
oWrapper.recordId = '<Parent Record ID>'; // e.g., Account/Opportunity ID
oWrapper.gatewayId = '<Payment Gateway Record ID>';
oWrapper.amount = 123.4567; // up to 4 decimal places
oWrapper.scheduleDate = Date.today(); // or any future date
oWrapper.scheduleDate = Date.today(); // or any future date
oWrapper.selectedFrequency = 'Regular';
// If no saved Payment Method is used
oWrapper.accountNunber = '123456789';
oWrapper.routingNumber = '021000021';
oWrapper.accountName = 'John Doe';
oWrapper.paymentMode = 'Checking'; // or 'Savings'
// Optional Address Information
oWrapper.zip = '10001';
oWrapper.address = '123 Main Street';
oWrapper.state = 'NY'; // 2-character state code
oWrapper.city = 'New York';
// Optional Extras
oWrapper.paymentMethodId = '<Existing Payment Method ID>'; // If available
oWrapper.applicationFees = 2.50; // Optional fee amount
oWrapper.accountId = '<Account Record ID>'; // If applicable
oWrapper.contactId = '<Contact Record ID>'; // If applicable
oWrapper.relatedRecordIds = '006XXXXXX,500XXXXXX'; // Comma-separated related records
oWrapper.phone = '1234567890';
oWrapper.email = 'johndoe@example.com';
oWrapper.sendViaSms = true;
InvocableAutomatePaymentProcess.automatePayment(
new List<InvocableAutomatePaymentProcess.PaymentRequestWrapper>{ oWrapper }
);
Example:
InvocableAutomatePaymentProcess.PaymentRequestWrapper oWrapper = new InvocableAutomatePaymentProcess.PaymentRequestWrapper();
oWrapper.name = 'bank';
oWrapper.recordId = '003fK000003NU2HQAW';
oWrapper.gatewayId = 'a09fK000001vpBhQAI';
oWrapper.amount = 1.0;
oWrapper.scheduleDate = Date.today() + 5;
oWrapper.accountNunber = '1234567';
oWrapper.routingNumber = '123456780';
oWrapper.accountName = 'S S';
oWrapper.paymentMode = 'Checking';
oWrapper.zip = '32123';
oWrapper.address = 'sdfsf';
oWrapper.state = 'GA';
oWrapper.city = 'fsdf';
String sResponse = InvocableAutomatePaymentProcess.automatePayment(new List<InvocableAutomatePaymentProcess.PaymentRequestWrapper>{oWrapper});
1.2 Response
Response is a serialize Map. It has below attributes:
|
Field Name |
Type |
Description |
|---|---|---|
|
|
Boolean |
Tells whether the process was success or not |
|
|
String |
Reference id from the gateway |
|
|
String |
Current Payment Status |
|
|
Number |
API Status code. E.g. 200 |
|
|
String |
Error Details if any error comes while processing the payment |
|
|
Id |
Payment Transaction record Id |
|
|
Id |
Parent Record id which was passed in the wrapper |
Success Response Example -:
[{"parentRecordId":"003fK0000047mLxQAI","paymentTransactionId":"a0CfK00001CLbmvUAD","statusCode":"200","paymentStatus":"Accepted","transactionid":"37883307","isSuccess":true}]
Failed Response Example -:
[{"parentRecordId":"003fK0000047mLxQAI","paymentTransactionId":"a0CfK00001CLP5JUAX","errorMessage":"Exception while capturing payment : Missing FirstName/LastName","paymentStatus":"Failed","isSuccess":false}]
2. Automate Generating Payment Link
Generate Payment Link
This automation generates a hosted payment link that can be emailed to the customer for self-service payment. It’s useful in cases where agents or sales reps want to initiate payments without directly capturing sensitive data. The customer opens the link, enters their card or bank details, and completes the transaction.
Use this when:
✅ You want the customer to initiate payment themselves.
✅ You prefer sending a secure hosted link via email.
✅ You support one-time payments via Card or ACH.
2.1 Wrapper Fields
|
Field Name |
Description |
Required |
Possible Values / Notes |
|---|---|---|---|
|
|
ID of the Parent Record to which the Payment Transaction will be linked |
✅ Yes |
Must be a valid Salesforce Record ID |
|
|
ID of the Payment Gateway record |
✅ Yes |
Must be a valid |
|
|
Amount (up to 4 decimal places) |
✅ Yes |
Example: |
|
|
Full name of the recipient |
✅ Yes |
Example: Test User |
|
|
Email address of the recipient who will receive the payment link. |
✅ Yes |
Example: test@test.com |
|
|
Title which will be written on the payment page. |
❌ Optional |
Example: Invoice No-123 |
|
|
Description which can be written on payment page like product/service information. |
❌ Optional |
Example: Product 1 |
|
|
Document Id for the document or invoice that will be send in the mail as an attachment |
❌ Optional |
Type: Salesforce Content document id |
|
|
Automatically send email or not |
❌ Optional |
Default: true |
|
|
Which email classic template to use |
❌ Optional |
Type: String |
|
|
After how many days the link should get expired |
❌ Optional |
Default: Picked up from metadata if not passed |
|
|
To set recurring payment |
❌ Optional |
Default: false |
|
|
True when the payment should be capture in future |
❌ Optional |
Default: false |
|
|
Date to schedule the payment. Defaults to the current date if not provided |
❌ Optional |
Format: |
|
|
Date on which the recurring payment should stop. |
❌ Optional |
Format: |
|
|
Frequency for recurring payment. |
❌ Optional |
Example: |
|
|
If true, sends the payment request via SMS |
❌ Optional |
|
|
|
To process the transaction on same day pass it as true. |
❌ Optional |
Default: |
Example:
InvocableGeneratePaymentLink.PaymentRequestWrapper oWrapper = new
InvocableGeneratePaymentLink.PaymentRequestWrapper();
oWrapper.recordId = '0035e00001Fd3QqAAJ';
oWrapper.paymentGatewayId = 'a005e00000PzXIqAAN';
oWrapper.amount = 22.56;
oWrapper.sEmail = 'kunal.dk35@gmail.com';
oWrapper.fullName = 'Kunal Dhand';
InvocableGeneratePaymentLink.requestPayment(new List<InvocableGeneratePaymentLink.PaymentRequestWrapper>{oWrapper});
2.1 Response
Response is a serialize Map. It has below attributes:
|
Field Name |
Type |
Description |
|---|---|---|
|
|
Boolean |
Tells whether the process was success or not |
|
|
String |
Payment link which will be used to complete the payment |
|
|
String |
Current Payment Status. |
|
|
Boolean |
Tells whether the payment is recurring or not |
|
|
Boolean |
Tells whether the payment is scheduled for the future |
|
|
String |
Error Details if any error comes while processing the payment |
|
|
Id |
Payment Transaction record Id |
|
|
Id |
Parent Record id which was passed in the wrapper |
Response Example -:
[{"scheduledDate":"2025-10-29","isScheduled":true,"isRecurring":false,"paymentLink":"https://cm-sfqbconnector-dev-ed.develop.my.salesforce-sites.com/quickbooks/cm_finance__externalPaymentProcessVFPage?paymentData=EMOqzZntvE4vvMJjlVIVxhtZW4pc09Kwz6Wd5WK4N%2BhfZMUnGoM0T%2Bx13oy7aSywEbdxSumS39rLPdZtdl5pdZxREFUqUlHLSj1uBfKshtc%3D&gatewayId=a09fK000003QyQDQA0","parentRecordId":"003fK0000047mLxQAI","paymentTransactionId":"a0CfK00001D0u6RUAR","paymentStatus":"Open","isSuccess":true}]
3. Automate Payment with existing Payment Method
Automate Payment with Payment Method
This automation charges a payment method that has already been saved to a record, such as a previously used card or bank account. This is useful for businesses that store payment methods for repeat customers and want to trigger a charge programmatically without user input.
Use this when:
✅ The customer has a saved payment method.
✅ You want to automate recurring or repeat payments.
✅ Manual input of payment details is not required.
InvocableAutomatePaymentProcess.PaymentRequestWrapper oWrapper = new InvocableAutomatePaymentProcess.PaymentRequestWrapper();
oWrapper.name = 'card';
oWrapper.recordId = '003fK0000047mLxQAI';
oWrapper.gatewayId = 'a09fK000001vpBhQAI';
oWrapper.amount = 1.0;
oWrapper.scheduleDate = Date.today();
oWrapper.paymentMethodId = 'a09fK000001vpBhQAI';
InvocableAutomatePaymentProcess.automatePayment(new List<InvocableAutomatePaymentProcess.PaymentRequestWrapper>{oWrapper});
4. Automate sending Funds
Sending Funds
This automation enables outbound payments or disbursements using saved or provided bank details. It is especially useful for scenarios such as issuing payouts, reimbursements, loan disbursements where the business is sending funds instead of collecting them.
Use this when:
✅ You want to send money to a bank account.
✅ The use case involves refunds, payouts, or vendor disbursements.
✅ You are using a gateway (e.g., UnityFi) that supports outbound payments.
InvocableFundingProcess.FundingRequestWrapper oWrapper = new InvocableFundingProcess.FundingRequestWrapper();
oWrapper.gatewayId = 'a09fK000001vpBhQAI';
oWrapper.recordId = '003fK000003NU2HQAW';
oWrapper.firstName = 'firstName';
oWrapper.lastName = 'lastName';
oWrapper.accountNumber = '1234567';
oWrapper.routingNumber = '123456780';
oWrapper.accountName = 'firstName lastName';
oWrapper.paymentMode = 'Savings';
oWrapper.amount = 1.0000;
InvocableFundingProcess.automateFunding(new List<InvocableFundingProcess.FundingRequestWrapper>{oWrapper});
Response Example -:
[{"parentRecordId":"003fK00000BVwrFQAT","paymentTransactionId":"a0CfK00001D1DUUUA3","statusCode":"200","paymentStatus":"Accepted","transactionid":"38095308","isSuccess":true}]
5. Automate Refund