Developer Resources

Scenario simulators
GoCardless CLIInstallation Testing Webhooks (CLI) About CLI gocardless gocardless analytics gocardless analytics disable gocardless analytics enable gocardless analytics status gocardless cancel gocardless completion gocardless config gocardless config current-session gocardless create gocardless delete gocardless get gocardless get creditor gocardless get customer gocardless get customer_bank_account gocardless get customer_notification gocardless get event gocardless get mandate gocardless get mandate_import gocardless get payer_authorisation gocardless get payment gocardless get payout gocardless get refund gocardless get subscription gocardless get webhook gocardless list gocardless list creditors gocardless list customer_bank_accounts gocardless list customer_notifications gocardless list customers gocardless list events gocardless list mandate_imports gocardless list mandates gocardless list payer_authorisations gocardless list payments gocardless list payouts gocardless list refunds gocardless list subscriptions gocardless list webhooks gocardless listen gocardless login gocardless mcp gocardless mcp add gocardless mcp add claude gocardless mcp add codex gocardless mcp remove gocardless mcp remove claude gocardless mcp remove codex gocardless mcp run gocardless open gocardless trigger gocardless trigger billing_request_fulfilled gocardless trigger billing_request_fulfilled_payment_failed gocardless trigger billing_request_fulfilled_payment_paid_out gocardless trigger billing_request_pending gocardless trigger mandate_activated gocardless trigger mandate_expired gocardless trigger mandate_failed gocardless trigger mandate_pending_submission gocardless trigger mandate_transferred gocardless trigger payment_chargeback_settled gocardless trigger payment_charged_back gocardless trigger payment_confirmed gocardless trigger payment_failed gocardless trigger payment_paid_out gocardless trigger payment_pending_submission gocardless trigger payment_submitted gocardless update gocardless version
Test Bank Details Testing Webhooks (Dashboard) Viewing events in the dashboard Client Libraries Postman Collection Custom Payment Page Tools Bank ID Scenario simulators MCP New

Custom Payment Page Tools

Custom Payment Page Tools is a collection of tools designed to minimise effort in building your own payments UI powered by GoCardless billing APIs. They can be effortlessly utilised when developing a custom web UI with different JS frameworks or in mobile development with WebViews.

At the moment the following tools are available:

  • compliance.js

Compliance.js

It adds elements to the HTML layout of custom payment pages to make the UI compliant. For example, for bank authorisation, you must append the GoCardless legal note with Payer Terms of Use and Privacy Notice links before starting the bank authorisation process for Instant Bank Pay or Variable Recurring Payments in the UK.

Getting started

Include compliance.js with a script tag in the head section of your index.html:

<head> ... <script src="https://custom-payment-page-tools.gocardless.com/compliance.js"></script> </head>

Once the script is loaded, your application can use the GoCardlessCompliance client, as it is added globally in window. Let's now call render:

window.GoCardlessCompliance.render("BRQ123", "bank-authorisation");

The render method requires the following parameters:

  1. A valid Billing Request Id to display elements and content dependent on the bank scheme.

  2. namespace to display elements and content relevant to a particular step in the flow. Available options: "bank_authorisation".

Testing

To test the integration with GoCardless Sandbox before going live, include compliance.js with the sandbox value in the environment attribute. If nothing is passed, the production environment will be used.

<script src="https://custom-payment-page-tools.gocardless.com/compliance.js" environment="sandbox"></script>

Render options

You can pass the options object to define the position of the compliance elements in your layout or change basic styles for the light/dark mode.

Name

Type

Default

Description

parentId

string

The component will be attached as the last child of document.body

Id of an existing HTML element in the document to render the component in.

theme

"light", "dark"

"light"

The colour theme

const options = { parentId: "my-element-id", theme: "dark" }; window.GoCardlessCompliance.render( "BRQ123", "bank-authorisation", options );

Using with JS frameworks

We suggest separating the GoCardlessCompliance.render call into an independent component to be used across your application. We also recommend generating unique identifiers for the containers where compliance elements are supposed to be rendered for each instance.

Error Handling

Error

Reasons

A valid billingRequestId is required

You haven't passed a Billing Request Id in the render method.

Namespace must be one of ...

You haven't passed a valid namespace in the render method - check the available options above.

The parent element doesn't exist in the document

We haven't found any element in your document.body with the id passed in options - make sure that it is attached to the DOM tree before calling the render method.

GoCardless API returned an error when trying to get payment flow details

We weren't able to get payment flow details to show relevant elements: very likely you have used an invalid Billing Request Id or a valid one but for the wrong environment.