Account Holder: {maskedBankAccount.account_holder_name}
Account Number: ****{maskedBankAccount.account_number_ending}
{maskedBankAccount.bank_name && (Bank: {maskedBankAccount.bank_name}
)}Thank you for your payment.
Your details have been saved for faster checkout next time
``` ```typescript const billingRequestId = "BR123456"; // From your backend const customerEmail = "customer@example.com"; const signup = gc.createComponent("remember-me-signup", { billingRequestId, email: customerEmail, onSuccess: (result) => { console.log("Customer enrolled in Remember Me:", result); signup.unmount(); document.getElementById("signup-confirmation").hidden = false; }, onError: (error) => { console.error("Signup failed:", error); // Optional: Show user-friendly message // Don't block user from proceeding if signup fails }, }); await signup.mount("#gc-billing-signup"); ``` `gc` is the instance returned by `GcComponents.init(...)` in [Configure Components](#34-configure-components). #### Signup Config | Property | Type | Required | Description | | ------------------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------- | | `billingRequestId` | string | Yes | Billing request ID for this transaction | | `email` | string | Yes | Customer's email address (already validated) | | `onSuccess` | function | No | Called when customer details are successfully saved | | `onError` | function | No | Called if enrollment fails. Takes priority over the `onError` passed to `GcComponents.init` | | `appearance` | object | No | Appearance variables for this component, merged on top of the global `appearance` (see [Customisation](#5-customisation)) | #### Callback Data Structures **onSuccess:** ```typescript { email?: string; phoneNumber?: string | null; } ``` ## 5. Customisation ### 5.1. Theming Both components use the GoCardless theme by default. The theme automatically adapts to create a cohesive experience. The Remember Me components can be customised to fit the UI of your page. This is done through the optional `appearance` object, which you can pass to `GcComponents.init` to style every component on the page, or to `createComponent` to style a single component. When both are set, the component's `appearance` takes priority. Example: ```javascript const gc = GcComponents.init({ environment: "sandbox", sessionToken: () => fetch("/your-backend/session-token").then((r) => r.text()), appearance: { backgroundColor: "#bfe6f2", inputBorderRadius: "0px", wrapperBorderRadius: "0", textFontFamily: "Georgia, serif", buttonPrimaryColor: "#004d40", }, }); gc.createComponent("remember-me-return-flow", { billingRequestId, }).mount("#gc-billing-return-flow"); gc.createComponent("remember-me-signup", { billingRequestId, email: customerEmail, // Optional: overrides the global appearance for this component only appearance: { buttonPrimaryColor: "#00a000" }, }).mount("#gc-billing-signup"); ``` You can modify colours, fonts, borders, padding etc. for a variety of different on-screen elements. We recommend playing around with `backgroundColor`, `textFontFamily`, `buttonPrimaryColor` and `buttonBorderRadius` to get started. You may notice that GoCardless Components come with some default styling even when no appearance variables are provided. Any appearance variables you add will be applied on top of the default styles. > **Info:** > Appearance variables are now passed as a flat object, without the `variables` wrapper used in > earlier versions of this page, and some have been renamed (for example `buttonColor` is now > `buttonPrimaryColor`). The appearance variables are shared with the Billing Request component. See [Customisation](/docs/collect-payments/integration-types/gocardless-components#4-customisation) for the full list of variables and their default values. ## What's next? #### [GoCardless Components](/docs/collect-payments/integration-types/gocardless-components) Learn about the core GoCardless Components library for setting up mandates. #### [Setting Up Mandates](/docs/collect-payments/setting-up-mandates) Learn how to collect bank account details and create mandates via the API. --- # Send Money ## Introduction to Outbound Payments URL: https://docs.gocardless.com/docs/send-money > Overview of sending money with GoCardless outbound payments. # Outbound Payments This guide provides an overview of how GoCardless handles outbound payments, covering key features, examples, and API usage to ensure you have everything you need to get started. ## What is an Outbound Payment? Outbound Payments enable merchants to send money using the GoCardless API. Why "Outbound Payments"? Unlike collection payments, where funds move from customers to merchants, the money flow for sending money is reversed — funds are transferred from the merchant's account to the recipient's account. To clearly reflect this reversed flow, we named the resource "Outbound Payment". ## Availability | Geo | Currency | Scheme | | ----- | -------- | ----------------- | | 🇬🇧 UK | GBP | `faster_payments` | ## What's next? #### [Payment Account](/docs/send-money/payment-account) Fund and manage the payment account used to send outbound payments. #### [API Request Signing](/docs/send-money/api-request-signing) Set up request signing to secure your API calls. #### [Send an Outbound Payment](/docs/send-money/send-an-outbound-payment) Add a recipient and initiate your first outbound payment. #### [Tracking Outbound Payments](/docs/send-money/tracking-outbound-payments) Monitor payment status and lifecycle events. ## API Request Signing URL: https://docs.gocardless.com/docs/send-money/api-request-signing > Sign API requests for outbound payments. # API request signing We require API Request Signing to secure your communication to the GoCardless API and to comply with the Strong Customer Authentication requirement. This section will walk you through how to: - Generate public and private keys and upload the public key to GoCardless - Build the signature base that will be used to generate the Gc-Signature header - Build and attach the Gc-Signature and Gc-Signature-Input headers and send them with your API request ## Sandbox developer bypass For ease of development (e.g. testing our endpoints with Postman or curl), it is possible to bypass request signing in the sandbox environment using the following header: ```http Gc-Signature: sig-1=:DEVELOPER: ``` ## Generate your key pair 1. We use ECDSA keys for API request signing. You must generate an ES512 key pair using the P-521 elliptic curve without a passphrase. Use the following commands in a terminal to generate your key pair: ```bash openssl ecparam -name secp521r1 -genkey -noout -out ec-secp521r1-priv-key.pem openssl ec -in ec-secp521r1-priv-key.pem -pubout > ec-secp521r1-pub-key.pem ``` 2. Securely save your private key. 3. Upload your public key to GoCardless via the dashboard. - Go to [Settings → Account settings](https://manage-sandbox.gocardless.com/company/settings). - Under "API request signing", add a new public key. ```bash cat ec-secp521r1-pub-key.pem # Copy this output and paste into the form. It should look something like: # -----BEGIN PUBLIC KEY----- # MIGbMBAGByqG..................... # ................................. # ................ # -----END PUBLIC KEY----- ``` When you've added a new public key, a corresponding request_signing_key ID (e.g. `RSK00123456789300123456789300`) is generated. You will need this for building the request signature. ## Signing the API request We follow the [RFC-9421](https://datatracker.ietf.org/doc/rfc9421/) specification for HTTP Message Signatures. 1. Create the signature base. This is a raw string containing all the components covered by the signature. It must be in the format shown in the example below. ```signature "@method": POST "@authority": api.gocardless.com "@request-target": /path?param=value "content-digest": sha256=:9AmU2hRsZnqEo2HiNTLacLN0fOs8YmDiuX4WYeYWvh0=: "content-type": application/json "content-length": 18 "@signature-params": ("@method" "@authority" "@request-target" "content-digest" "content-type" "content-length");keyid="your-public-key-identifier";created=1675688690;nonce="8IBTHwOdqNKAWeKl7plt8g==" ``` ```ruby signature_base = <<~SIGNATURE_BASE.chomp "@method": POST "@authority": api.gocardless.com "@request-target": /path?param=value "content-digest": sha256=:9AmU2hRsZnqEo2HiNTLacLN0fOs8YmDiuX4WYeYWvh0=: "content-type": application/json "content-length": 18 "@signature-params": ("@method" "@authority" "@request-target" "content-digest" "content-type" "content-length");keyid="your-public-key-identifier";created=1675688690;nonce="8IBTHwOdqNKAWeKl7plt8g==" SIGNATURE_BASE ``` ```c# var signatureBase = SignatureBase( httpMethod: "POST", host: "api.gocardless.com", requestPath: "/outbound_payments", contentDigest: "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae", contentType: "application/json", contentLength: 123, keyId: "RSK00123456789300123456789300", created: DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString(), nonce: Guid.NewGuid().ToString()); static string SignatureParams(string keyId, string created, string nonce, bool includeContentParams) { var components = includeContentParams ? "\"@method\" \"@authority\" \"@request-target\" \"content-digest\" \"content-type\" \"content-length\"" : "\"@method\" \"@authority\" \"@request-target\""; return $"({components});keyid=\"{keyId}\";created={created};nonce=\"{nonce}\""; } static string SignatureBase( string httpMethod, string host, string requestPath, string? contentDigest, string? contentType, int? contentLength, string keyId, string created, string nonce) { var includeContentParams = !string.IsNullOrWhiteSpace(contentDigest); var lines = new List