Prerequisites
- An existing checkout that mounts Stripe’s Payment Element.
- Stripe Dashboard access, with permission to create a custom payment method.
- Gale Merchant Dashboard access, and a Gale API key (
glm_test_…/glm_live_…).
Step 1: Create your custom payment method
A custom payment method type is what makes Gale appear in your Payment Element. Create one per Stripe account, in each mode.Open Custom payment methods

Settings → Payments → Custom payment methods

Custom payment methods → Create
Set the name and logo

Create custom payment method → Provide a custom name and icon

Display name, logo, and the terms checkbox
Copy the cpmt_ id
cpmt_. Copy it. Your
frontend passes it to Stripe.js. Stripe displays it only once.
Custom payment method created — note the cpmt_ id
Step 2: Save the restricted key in Gale
Open Integrations → Gale on Stripe and paste therk_… key. Gale uses it to write the payment record, and the page will not save unless Payment Records read and write are both granted. Paste the cpmt_… id from Step 1. Leave the signing secret blank. The Checkout Session path is the one that uses that secret.
The walkthrough is on Gale on Stripe.
Step 3: Add Gale to your checkout
Two changes in your frontend, and one new endpoint on your backend. Your backend is what calls Gale, so it authenticates with your API key (glm_test_… / glm_live_…). Generate one in the Gale Merchant Dashboard under
Developer Tools → API Keys — see Getting your API
key. Keep it server-side;
it must never reach the browser.
Test and live are the key prefix. glm_test_… uses your Adyen test gateway. glm_live_… is a real charge. A test_mode field on the body is ignored.
Frontend — register the CPM
customPaymentMethods,
documented for the Payment Element
here.paymentMethodOrder: ['cpmt_...', 'card'] when
you create the Payment Element.Frontend — branch on submit
stripe.confirmPayment.
Gale adds a branch before the intent is created, and leaves the card path
untouched.Backend — create the Gale checkout
checkout_id looks like cs_…. That is Gale’s checkout id, not a Stripe Checkout Session.Step 4: Set your Gale webhook URL
Gale sends the outcome to your application. In the Gale dashboard, open Developer Tools → Webhooks, add your endpoint, and subscribe to the events you fulfill on.X-Gale-Signature on every delivery. Gale still sends Authorization: Bearer with the endpoint secret. That header will be removed, so use the signature as your check. See Webhooks.
Test vs live
Sandbox and live each need their owncpmt_ id. The Gale key carries the environment: glm_test_… or glm_live_….
Scope of this page
This checkout charges once. Leavemode and plan_id off the request. For a subscription, use Subscriptions. For a Stripe Checkout Session, use Stripe Checkout.
Refunds
Refund the Gale order withPOST /api/v2/refunds. order_id is required. amount is optional and is in cents.
Gale then sends refund.created, refund.succeeded, or refund.failed. Stripe does not send charge.refunded for this payment. Do not refund it from the Stripe Dashboard.
Failure modes
- Wrong or missing API key, or a key from the other environment →
401/422from/api/v2/checkout. - Line item missing
product_id→422. It’s required on every line item. Aproduct_idthat Gale doesn’t recognise as HSA/FSA-eligible is accepted — that item just charges on the non-eligible leg. success_url/failure_urlnot HTTPS → checkout creation is rejected. Use a tunnel or a local certificate in development.- Payments are not configured for this environment →
CHECKOUT_001. No checkout is created.
Test your integration
Use test credentials
glm_test_… Gale key and your test-mode cpmt_… id. Environment
is encoded in the key prefix — nothing else about the request changes.Confirm the option renders
cpmt_ id that does not belong to the publishable key mounting the Element.
Also check that Adaptive Pricing is not active. No Gale setting changes this.Confirm the branch skips stripe.confirmPayment
Create a checkout
POST /api/v2/checkout and answers
{ data: { checkout_url, checkout_id } }, and the shopper lands on the
Gale-hosted card page.Run a mixed cart
product_id Gale does not recognise as eligible. It
should still charge, on the non-eligible leg, rather than being rejected.Confirm the outcome server-side
order.completed on your own backend before fulfilling. The order
appears in your Gale dashboard under Orders with the reference_id you
sent. Gale reports a payment record to Stripe with the restricted key from
Step 2. There is no Stripe Charge.Test cancel and decline
failure_url
and can pay another way, with the order left unfulfilled.Go-live checklist
- Live Gale key (
glm_live_…) on the live code path, and the livecpmt_id in the Element - Restricted key saved on Gale on Stripe, with Payment Records read and write
- Endpoint URL on the custom payment method left empty
product_idpresent on every line itemsuccess_urlandfailure_urlare HTTPSorder.completedverified before fulfilment, withX-Gale-Signaturechecked- One real live transaction in the Gale dashboard, and the payment record in Stripe
- Refunds go through
POST /api/v2/refunds, not the Stripe Dashboard
Related resources
Create Checkout
Webhooks
Create a refund
POST /api/v2/refunds.