Add external payment methods
Add external payment methods to the Mobile Payment Element.
Note
We created a custom payment methods feature that allows you to extend your payment integration with payment methods processed outside Stripe. We recommend using it for your integration instead of external payment methods.
In-app Payments can display external payment methods that you support in addition to the payment methods processed through Stripe. Integrating external payment methods requires additional integration work, because external payment method transactions are processed and finalised outside of Stripe.
External payment methods responsibility
When customers choose an external payment method, your app handles the payment instead of Stripe processing it. To learn about your responsibilities and the ongoing availability of external payment methods, see the external payment methods disclaimer.
This guide adds an external payment method, Fawry, using the Payment Sheet Accept In-app payments guide. See the list of all available external payment methods.
Before you begin
- Create a Stripe account or sign in .
- Follow the Payment Sheet example to complete a payments integration.
- For each external payment method you want to add, complete its integration and confirm that it’s working in the region where you want to enable it.
Add external payment method types
When you create your PaymentSheet.Configuration object and initialise PaymentSheet, specify the external payment methods that you want to add to the Payment Element and a handler to complete the payment. This example adds Fawry:
import StripePaymentSheet
class MyCheckoutVC: UIViewController {
func setUpPaymentSheet() {
// ...
var configuration = PaymentSheet.Configuration()
configuration.externalPaymentMethodConfiguration = .init(
externalPaymentMethods: ["external_fawry"]
) { externalPaymentMethodType, billingDetails in
return await self.handleExternalPaymentMethod(type: externalPaymentMethodType, billingDetails: billingDetails)
}
// ...
}
func handleExternalPaymentMethod(type: String, billingDetails: STPPaymentMethodBillingDetails) async -> PaymentSheetResult {
// ...explained in the next step
}
}
Complete the payment
When the customer taps the Buy button in PaymentSheet using an external payment method, it calls the handler with the type (for example, “external_fawry”) and any billing details that were collected.
Your implementation completes the payment (for example, by using your external payment method provider’s SDK) and returns the result of the payment: completed, canceled, or failure(error:).
If you pass .failure(error:), PaymentSheet displays the error using errorDescription for Swift errors and localizedDescription for NSErrors.
import StripePaymentSheet
class MyCheckoutVC: UIViewController {
func setUpPaymentSheet() {
// ...
var configuration = PaymentSheet.Configuration()
configuration.externalPaymentMethods = .init(
externalPaymentMethods: ["external_fawry"]
) { [weak self] externalPaymentMethodType, billingDetails in
return await self?.handleExternalPaymentMethod(type: externalPaymentMethodType, billingDetails: billingDetails)
}
// ...
}
func handleExternalPaymentMethod(type: String, billingDetails: STPPaymentMethodBillingDetails) async -> PaymentSheetResult {
// Your implementation should complete the payment with the payment method provider
// When the payment completes, cancels, or fails, return the result
// Note you can present on top of PaymentSheet by using the `self.presentedViewController`.
// This example code just immediately fails:
let exampleError = NSError(domain: "MyErrorDomain", code: 0, userInfo: [NSLocalizedDescriptionKey: "Failed to complete payment!"])
return .failed(error: exampleError)
}
}
Optional Position external payment methods
Test your integration
- Go through your checkout flow and verify that the Payment Element displays Fawry. This example configures Fawry in the second position after cards.
- Choose the Fawry payment method.
- Click Pay now to test your existing Fawry integration. Verify that your integration completes the transaction and that any post-payment actions (for example, displays a confirmation page, success message, or failure message) still work with your Fawry integration.
Dashboard considerations
PaymentIntents for transactions processed with an external payment method provider have an incomplete status in the Stripe Dashboard. Stripe isn’t involved in external payment method transactions and can’t determine the status of these transactions.
If you collect payment details before creating an Intent, you won’t see any incomplete transactions in the Stripe Dashboard for transactions that were processed with an external payment method provider.
External payment methods disclaimer
You can use the Stripe Mobile Payment Element to show some external payment methods that aren’t supported by Stripe but that you directly integrate with. When customers choose an external payment method, your app completes the transaction instead of the Stripe Mobile Payment Element. You acknowledge that:
- External payment methods aren’t offered nor supported by Stripe. The operation and support of external payment methods is provided by the external payment method provider.
- You’re responsible for maintaining a direct integration with the external payment method provider.
- You need to maintain an agreement with the external payment method provider and are responsible for complying with your agreements with each external payment method provider.
- You’re responsible for obtaining all necessary rights to use the external payment method provider’s marks and logos within your checkout as described in these docs.
- Stripe isn’t responsible for the processing of any transactions with any external payment method provider including, for example, any charges, refunds, disputes, settlements or funds flows.
- You or the external payment method provider are responsible for the completion of the purchase flow after a customer has selected an external payment method, including, for example, the order confirmation and reconciliation of orders.
- You’re responsible for properly configuring the redirect URL for the external payment method.
- You must immediately remove any external payment methods in the event your agreements with any external payment method provider terminate or Stripe removes the availability of an external payment method.
- You’re only permitted to integrate with and present in the Payment Element the external payment methods listed in this guide.
- You’re solely responsible for making sure that customers are redirected correctly to their chosen external payment method.
Ongoing availability of external payment methods
Stripe might at any time decide to remove the availability of any payment method as an external payment method. Stripe will notify you of any removal of an external payment method that you’re using, and you must immediately remove the external payment method in your code. Failure to do so will result in the external payment method not rendering to your customers.
Available external payment methods
You can display the following external payment methods. You must use the corresponding external payment method type in your code.
| Region | Payment method | External payment method type |
|---|---|---|
| the related setting | Interac | external_interac |
| the related setting | au PAY | external_au_pay |
| the related setting | atone | external_atone |
| the related setting | Touch’n Go | external_tng_ewallet |
| the related setting | ソフトバンクまとめて支払い (Softbank carrier payments) | external_softbank_carrier_payment |
| the related setting | Toss Pay | external_toss_pay |
| the related setting | Laybuy | external_laybuy |
| the related setting | Bank Pay | external_bank_pay |
| the related setting | auかんたん決済 (au easy payments) | external_au_easy_payment |
| the related setting | BitCash | external_bitcash |
| the related setting | Azupay | external_azupay |
| the related setting | d払い (d-barai) | external_dbarai |
| the related setting | FamiPay | external_famipay |
| the related setting | GCash | external_gcash |
| the related setting | GrabPay Later | external_grabpay_later |
| the related setting | MoMo | external_momo |
| the related setting | NET the related setting | external_net_cash |
| the related setting | Octopus | external_octopus |
| the related setting | Paidy | external_paidy |
| the related setting | PayPay | external_paypay |
| the related setting | PlanPay | external_planpay |
| the related setting | ペイジー (Pay-easy) | external_pay_easy |
| the related setting | 楽天ペイ (Rakuten Pay) | external_rakuten_pay |
| the related setting | メルペイ (Merpay) | external_merpay |
| the related setting | WebMoney | external_webmoney |
| the related setting, Europe | Shopback Pay | external_shopback_pay |
| Europe | Aplazame | external_aplazame |
| Europe | Bizum | external_bizum |
| Europe | Divido | external_divido |
| Europe | Fonix | external_fonix |
| Europe | Iwocapay | external_iwocapay |
| Europe | KBC | external_kbc |
| Europe | Nexi Pay | external_nexi_pay |
| Europe | Oney | external_oney |
| Europe | Payconiq | external_payconiq |
| Europe | PayPo | external_paypo |
| Europe | Sofinco | external_sofinco |
| Europe | Postepay | external_postepay |
| Europe | PostFinance | external_postfinance |
| Europe | Scalapay | external_scalapay |
| Europe | TrueLayer | external_truelayer |
| Europe | Walley | external_walley |
| Europe | YounitedPay | external_younited_pay |
| Global | the related setting Pay | external_line_pay |
| Global | paysafecard | external_paysafecard |
| Global | Samsung Pay | external_samsung_pay |
| Global | Sezzle | external_sezzle |
| the related setting | Dapp | external_dapp |
| the related setting | PicPay | external_picpay |
| MEA | Tabby | external_tabby |
| MEA | Benefit | external_benefit |
| MEA | Fawry | external_fawry |