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.
Before GoCardless initiates a payment for your customer, we are legally required by the UK
Payment Services Regulations to provide them with a copy of a payment service contract governing
that service. This is the Payer Terms of Use doc which is linked inside Compliance.js.
Additionally, when obtaining your customer's personal data, we are legally required by the UK
General Data Protection Regulation to provide them with certain privacy information. This is the
Privacy Notice doc which is linked inside Compliance.js. When you build your own UI,
GoCardless is not able to directly provide these legal documents to the payer. So, to ensure that
we do not breach any law, we are not able to sign off on your UI unless you have added
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 Pay By Bank or Variable Recurring Payments in the UK.
Available at https://custom-payment-page-tools.gocardless.com/compliance.js
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.
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.
import { Component } from "@angular/core";@Component({selector: "app-compliance",templateUrl: "./compliance.component.html",})export class ComplianceComponent {parentId = `gc-compliance-${Math.random().toString(20).substring(2, 6)}`;ngAfterViewInit() {window.GoCardlessCompliance.render("BRQ123", "bank-authorisation", { parentId: this.parentId });}}
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.