Add custom payment methods
Learn how to add custom payment methods to the Payment Element.
Use the Payment Element with the Payment Intents API to display over 50 preset payment methods, as well as your custom payment methods, through a single integration. After creating your custom payment method in the Dashboard, configure the Payment Element to make sure these transactions process and finalize correctly outside of Stripe. You can record these transactions to your Stripe account for reporting purposes.
Note
When integrating with a third-party payment processor, you’re responsible for complying with applicable legal requirements, including your agreement with your PSP, applicable laws, and so on.
Before you begin
- Create a Stripe account or sign in with your existing account.
- Follow this guide to complete a payments integration.
Create your custom payment methodDashboard
You can create a custom payment method in the Dashboard by going to Settings > Payments > Custom Payment Methods. Provide the name and logo for the Payment Element to display.
Choose the right logo
- For logos with a transparent background, consider the background color of the Payment Element on your page and make sure that it stands out.
- For logos with a background fill, include rounded corners in your file, if needed.
- Choose a logo variant that can scale down to 16x16 pixels. This is often the standalone logo mark for a brand.
After creating the custom payment method, the Dashboard displays the custom payment method ID (beginning with cpmt_) that you need for the next step.
Add the custom payment method typeClient-side
Next, add the custom payment method type to your Stripe Elements configuration. In your checkout. file where you initialize Stripe Elements, specify the customPaymentMethods to add to the Payment Element. Provide the custom payment method ID from the previous step, the options., and an optional subtitle.
const elements = stripe.elements({ // ... customPaymentMethods: [ { id:, options: { type: 'static', subtitle: Optional subtitle, } } ] });'{{CUSTOM_PAYMENT_METHOD_TYPE_ID}}'
After loading, the Payment Element shows your custom payment method.

Handle payment method submissionClient-side
To process custom payment method transactions outside of Stripe, update the handleSubmit function that’s called when users click the pay button on your website.
The elements.submit() function retrieves the selected payment method type. For example, you might show a modal, and then either process the payment on your own server or redirect your customer to an external payment page.
async function handleSubmit(e) { const { submitError, selectedPaymentMethod } = await elements.submit(); if (selectedPaymentMethod ===) { // Process CPM payment on merchant server and handle redirect const res = await fetch("/process-cpm-payment", { method: 'post' }); ... } else { // Process Stripe payment methods ... } }'{{CUSTOM_PAYMENT_METHOD_TYPE_ID}}'