Add custom payment methodsPublic preview
Add custom payment methods to the Mobile Payment Element.
The Mobile Payment Element lets your users pay with many payment methods through a single integration. Use custom payment methods if you need to display additional payment methods that aren’t processed through Stripe. If you use custom payment methods, you can optionally record purchases processed outside of Stripe to your Stripe account for reporting purposes.
To configure a custom payment method, create it in your Stripe Dashboard, and provide a display name and icon that the Mobile Payment Element also displays. The Stripe Dashboard also provides access to over 50 preset custom payment methods. After you create the payment method, follow the guide below to configure the Mobile Payment Element. Setting up the Mobile Payment Element requires some additional configuration work because custom payment method transactions process and finalize outside of Stripe.
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.
- Follow the Payment Sheet example to complete a payments integration.
Create your custom payment method in the DashboardDashboard
Go to Settings > Payments > Custom Payment Methods to get to the custom payment methods page. Create a new custom payment method and provide the display name and logo that the Payment Element displays.
Choose the right logo 
- If you provide a logo with a transparent background, consider the background color of the Payment Element on your page and make sure that it displays clearly.
- If you provide a logo with a background fill, provide rounded corners in your file because we won’t provide them.
- Choose a logo variant that can scale down to 16 pixels × 16 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_
) needed in step 2.
Add custom payment method types
When you create your PaymentSheet.
object and initialize the PaymentSheet
, specify the custom payment methods that you want to add to the Mobile Payment Element and a handler to complete the payment.
import StripePaymentSheet class MyCheckoutVC: UIViewController { func setUpPaymentSheet() { // ... var configuration = PaymentSheet.Configuration() let customPaymentMethod = PaymentSheet.CustomPaymentMethodConfiguration.CustomPaymentMethod(id: "cpmt_...", subtitle: "Optional subtitle") configuration.customPaymentMethodConfiguration = .init(customPaymentMethods: [customPaymentMethod], customPaymentMethodConfirmHandler: handleCustomPaymentMethod(_:_:)) // ... } func handleCustomPaymentMethod( _ customPaymentMethodType: PaymentSheet.CustomPaymentMethodConfiguration.CustomPaymentMethod, _ billingDetails: STPPaymentMethodBillingDetails ) async -> PaymentSheetResult { // ...explained in the next step } }
Collect billing details
You can collect billing details using billingDetailsCollectionConfiguration on the Payment Sheet configuration. However, custom payment methods don’t collect billing details by default. To enable billing detail collection, set disableBillingDetailCollection
to false
on your CustomPaymentMethod
.
var customPaymentMethod = PaymentSheet.CustomPaymentMethodConfiguration.CustomPaymentMethod(id: "cpmt_...", subtitle: "Optional subtitle") customPaymentMethod.disableBillingDetailCollection = false
Test your integration
- Go through your checkout flow and verify that the Mobile Payment Element displays your custom payment method. This example configures your custom payment method in the second position after cards.
- Choose your custom payment method.
- Click Pay now to test your custom payment method integration. Verify that your integration completes the transaction and that any post-payment actions (for example, displaying a confirmation page, success message, or failure message) still work with your custom payment method integration.