---
title: Process Payments
slug: payments/process-payments
description: Process payments end-to-end with Unaric Payments using cards, bank transfers, digital wallets, and more in Salesforce.
docTags: 
createdAt: 2025-02-03T23:12:37.584Z
---

Once created, payments are in the *Awaiting Submission* status. The next step is setting them for collection by processing them.

## Collect using Ecommerce URLs

Every payment object has its own **Ecommerce URLs**. These URLs can be shared via email, embedded on web pages, or used in other online contexts to direct customers to a payment page. In the context of the Unaric Payments package, these URLs invoke the Unaric Payments Paypage, allowing customers to securely enter their payment information.

When a new Payment object is created, a unique Data Integrity Token (DIT) is generated and associated with that object. This DIT value is appended to the Ecommerce URL, providing an additional layer of security. In this way, the URL can only display details for the specific Payment or Authorisation it references.

:::hint{type="warning"}
DIT was introduced in version 2.17.1 and is enabled by default for new Unaric Payments package installations. For existing clients upgrading the package, this feature is disabled by default. However, we *strongly recommend* enabling it to enhance security. This feature is controlled by a Salesforce custom setting: "Enable Pay/auth URL Data Integrity." For more information, see [v2.17.1 (Autumn '21)](docId:5ha6F0CNUFjq3f0HDOhe5) .
:::

## Collect one-off payments

For simple one-off payments without an authorisation (that require payment details to be entered), you can create a payment record specifying the amount and payment route options on the payment page.

You can then access the payment page via one of two ways:

- If the customer is providing you with payment details as you are in the org (such as over the phone), then hit the “Process payment” button on the top-right of the screen, then enter the required details into the form.
- If you wish to provide the customer with a link to the payment page that they can complete at their own convenience, copy the “Ecommerce URL” field and supply this to the customer (this might be via email or any other means).

## Collect payment from authorisation

:::hint{type="warning"}
Before processing a payment, ensure that the selected payment method, Merchant Group, and currency have a corresponding PSP connection configured in the **Unaric Payments Setup** page. Otherwise, your [paypage](docId\:TgpSyjQqFlnuZgiLpGS5m) may display a warning and some payment methods may be unavailable. For more information this issue, see [Payments & Authorisations](docId\:HJ7bjrgWCS7DyO0rThXkw).
:::

### Process manually

::::Tabs
:::Tab{title="Multiple Payments"}
1. Go to the **Unaric Payments&#x20;**&#x74;ab.
2. Use the checkbox to select Payment records.
3. Click the **Process Payments Now** button. Confirm you want to process the selected payments. A notification will let you know how many were successful and errors.

***
:::

:::Tab{title="Single Payment"}
1. Go to the **Unaric Payments&#x20;**&#x74;ab.
2. Find the Payment and enter to its record page.
3. Click the **Process Payment From Authorisation** button on the action bar.
4. Select the Authorisation from the dropdown menu and review the payment details.&#x20;
5. Click **Process Payment&#x20;**&#x74;o finish.&#x20;

***
:::
::::

### Process using flow

You can use a Salesforce Flow to process a single payment immediately using the linked authorisation. This flow can be invoked from code.

**Flow details**

- **API Name:** `asp04.Process_Immediate_Payment`
- **Required Input:** **paymentId**

**Sample code**

:::BlockQuote
Map\<String, Object> params = new Map\<String, Object>();
String paymentId = 'a040C000003pTXaQAM';  // Replace with actual payment ID
params.put('paymentId', paymentId);
Flow\.Interview calcFlow = new Flow\.Interview\.asp04.Process\_Immediate\_Payment(params);
calcFlow\.start();
:::

## Collect a payment and create an authorisation simultaneously

Many business cases require collecting an initial payment from a customer while simultaneously creating an authorisation for future transactions.

1. Create a new payment record with the amount of the initial payment.
2. Create a new authorisation record.
3. Set the **"Authorisation"** field on the payment record to the newly created authorisation.
4. Process the payment using one of the following methods:
   - Click the **Process payment** button within Salesforce.
   - Share the **Ecommerce URL** link with the customer for self-processing.
5. Once the customer completes the payment process, both the **payment** and **authorisation** records will be updated with the transaction result. The **authorisation record** can now be used for future payment collections as needed.

## On-demand processing of automated payments

Automated payments (payments linked to an authorisation) can be processed immediately with a button click instead of waiting for the scheduled job. This allows for on-demand processing, providing greater flexibility in managing payment collections.

### How it works

The **Process Payments Now** button on the Payments List View allows you to process payment collections quickly without waiting for the scheduled job. Simply select the desired payments from the list view and click the button.

The same criteria that apply to the **Repeat Payment Scheduled Job** also apply to the **Process Payments Now** button. A Payment must:

- Have an *In Force* Authorisation attached.
- Be in *Awaiting Submission* status.
- Have a payment date of today or earlier.

### Setup

To use the "Process Payments Now" button, you must add it to the Payment List View. Follow these steps:

1. In Salesforce, navigate to **Setup > Object Manager**.
2. Locate and select the **Payment** object (**asp04\_\_Payment\_\_c**).
3. In the left-hand navigation menu, click **List View Buttons**.
4. Click **Edit** next to the list view you want to modify (or create a new list view).
5. In the **Available Buttons** section, select **Process Payments Now** and move it to the **Selected Buttons** section.
6. Click **Save** to apply the changes. The **Process Payments Now** button will now appear on your selected **Payment List View**, allowing you to process eligible payments on demand.

## Collect Payments automatically

Payments can be automatically collected against an existing authorisation by creating a payment record where the following conditions are true:

- The payment record is set to *Awaiting submission.*
- The payment record is attached to an authorisation.
- The attached authorisation's status is either *In force* or *Pending.*
- The payment record has a *Due date* either today or in the past.
- The field value for *Payment route selected* has a matching value on the payment and attached authorisation records.

An overnight batch job will run and attempt to collect any payments that fulfil these above criteria.  This payment record can be created manually as above. However, more commonly in practice, it can also be created automatically as part of a Lightning flow, Process, Apex trigger or any other method Salesforce provides for automation.
