Create and Configure Single Payment Widget
This document provides configuration instructions for the Single Payment Widget.
Create
Before configuring the specific fields for the Single Payment Widget, you need to create a widget. If you haven't done this yet, please refer to the Create Widget section for instructions. This section covers the general fields that need to be specified during widget creation.
After completing the generic fields, return to this page to configure the Single Payment specific fields detailed below.
Configure
Payee Account Details
To set up a payment widget, you need to specify a payee account that will receive the funds. The following details are required:
| Name | Description | Requirement |
|---|---|---|
| Display Name | Can differ from the actual bank account name to support aliasing. | Optional |
| Account Name | Used when instructing the payment. | Required |
| Account Number | Valid UK bank account number. | Required |
| Sort Code | Valid UK sort code. | Required |
Default Payment Details
Next, specify the default payment details:
| Name | Description | Requirement |
|---|---|---|
| Amount | A default amount that the end user is expected to pay. | Required |
| Reference | A payment reference can be specified, which will be the same for every payment, or it can be left blank to generate a unique reference code for each payment. | Optional |
Overriding Default Values
After a widget is created, its default values can be overridden by passing in parameters during widget instantiation. These parameters include:
| Name | Description |
|---|---|
| payeeId | Once a widget is created, a unique Payee ID is associated with each payee created. You can change which payee the widget will use here. |
| amount | The payment amount in minor units. |
| reference | For example: invoice ID, vendor name. |
| endToEndId | Unique identification assigned by the initiating party to unambiguously identify the transaction. This identification is passed on, unchanged, throughout the entire end-to-end chain. |
Adding a Landing Page
A landing page is an optional first screen in the widget journey. When it's enabled, the payer enters the payment reference and amount themselves, then continues to connect their bank account and complete the payment.
The following settings control the landing page. Set them when creating or editing a Single Payment widget in the Admin Portal.
| Name | Description | Default | Requirement |
|---|---|---|---|
| Display landing page as the first page of the widget journey | Turns the landing page on. | Off | Optional |
| Require a custom payment reference pattern | Requires the payer's reference to match a pattern you define. | Off | Optional |
| Payment reference pattern | The pattern the reference must match, as a regular expression, for example ^[A-Z]{3}[0-9]{6}$. Up to 256 characters. | None | Required when a custom pattern is required |
| Payment reference error message | The message shown when the reference doesn't match the pattern. Up to 300 characters. If left blank, the default message is used. | The reference does not match the required reference format | Optional |
| Landing page disclaimer | Text shown under the payment reference field. Up to 319 characters. If left blank, the default text is used. | Please ensure your reference is correct. An incorrect reference may lead to a delay in your payment being received and reconciled. | Optional |
| Display business logo at the top of the widget | Shows the business logo at the top of the widget. Requires a logo on the business. | Off | Optional |
| Display business icon on Confirm payment page | Shows the business icon on the Confirm payment page. Requires an icon on the business. | Off | Optional |
Webhooks
The Single Payment Widget can send events via webhooks, allowing you to receive real-time notifications about payment processes. Here are the configurable webhook settings:
| Name | Description | Requirement |
|---|---|---|
| Webhook URI | Specify your endpoint URI to receive webhook events. This is optional but recommended for real-time updates. | Optional |
| Webhook format | Events will be sent in JWT format. This is preselected as the default format to ensure secure and structured data transmission. | Preselected default |
Handling Webhooks
Ensure your webhook endpoint correctly processes JWT payloads:
app.post('/webhook/receipt/moneyhub', (req, res) => {
try {
const payload = jwt.verify(req.body.token, publicKey);
// Process the payload
res.sendStatus(200);
} catch (error) {
console.error('Webhook error:', error);
res.sendStatus(500);
}
});For more information about webhooks and what events trigger them, see Webhooks .
Previewing the WidgetOnce a Widget has been created it can be Previewed via the top menu bar, see Preview
Updated 2 days ago
