Accéder directement au contenu
Créez un compte
ou
connectez-vous
Le logo de la documentation Stripe
/
Demander à l’IA
Créer un compte
Connectez-vous
Commencer
Paiements
Revenus
Plateformes et places de marché
Gestion des fonds
Ressources de développement
Aperçu
À propos des paiements Stripe
Mettre votre intégration à niveau
Analyses des paiements
Paiements en ligne
AperçuTrouver votre cas d'usageUse Managed Payments
Utiliser Payment Links
Utiliser une page de paiement préconfigurée
Build a custom integration with Elements
Développer une intégration dans l'application
Moyens de paiement
Ajout de moyens de paiement
    Aperçu
    Options d'intégration des moyens de paiement
    Gérer les moyens de paiement par défaut dans le Dashboard
    Types de moyens de paiement
    Cartes
    Payer avec le solde Stripe
    Cryptomonnaie
    Prélèvements bancaires
    Redirection vers l'institution financière
    Virements bancaires
    Virements (Sources)
    Achetez maintenant, payez plus tard
    Paiements en temps réel
    Coupons
    Portefeuilles numériques
      Alipay
      Amazon Pay
      Apple Pay
        Bonnes pratiques
        Cartes Bancaires avec Apple Pay
        Transactions récurrentes avec Apple Pay
        Jetons marchands d'Apple Pay
        Transfert de responsabilité, litiges et remboursements Apple Pay
      Cash App Pay
      Google Pay
      GrabPay
      Link
      MB WAY
      MobilePay
      PayPal
      PayerPayer
      Revolut Pay
      Satispay
      Secure Remote Commerce
      Vipps
      WeChat Pay
    Activer des moyens de paiement locaux par pays
    Moyens de paiement personnalisés
Gérer les moyens de paiement
Payer plus rapidement avec Link
Interfaces de paiement
Payment Links
Paiement
Web Elements
Paiements dans l’application
Scénarios de paiement
Gérez plusieurs devises
Flux de paiement personnalisés
Acquisition flexible
Orchestration
Paiements en personne
Terminal
Au-delà des paiements
Constituer son entreprise
Cryptomonnaie
Financial Connections
Climate
Comprendre la fraude
Radar pour la protection contre la fraude
Gérer les litiges
Vérifier l'identité
AccueilPaiementsAdd payment methodsWallets

Apple Pay

Allow customers to securely make payments using Apple Pay on their iPhone, iPad, or Apple Watch.

Supported devices

Refer to Apple’s compatibility documentation to learn which devices support Apple Pay.

Apple Pay is compatible with most Stripe products and features. Stripe users can accept Apple Pay in iOS applications in iOS 9 and above, and on the web in Safari starting with iOS 10 or macOS Sierra. There are no additional fees to process Apple Pay payments, and pricing is the same as for other card transactions.

Apple Pay is available to cardholders at participating banks in supported countries. For more information, refer to Apple’s participating banks documentation.

  • Customer locations

    Worldwide except India

  • Presentment currency

    See supported presentment currencies

  • Payment confirmation

    Customer-initiated

  • Payment method family

    Wallet

  • Recurring payments

    Yes

  • Payout timing

    Standard payout timing applies

  • Connect support

    Yes

  • Dispute support

    Yes

  • Manual capture support

    Yes

  • Refunds / Partial refunds

    Yes / Yes

Payment flow

Below is a demonstration of the Apple Pay payment flow from your checkout page:

Apple pay payment flow animation showing the Stripe checkout page, the Apple Pay button, and the confirmation dialog while testing.

Using Stripe and Apple Pay versus in-app purchases

For sales of physical goods, services, and certain other things, your app can accept Apple Pay or any other Stripe-supported payment method. Those payments are processed through Stripe, and you only need to pay Stripe’s processing fees. In some countries, you can link to an external website, such as Stripe Checkout, to accept payments on iOS for sales of digital products, content, and subscriptions.

Accept Apple Pay

Stripe offers a variety of methods to add Apple Pay as a payment method. For integration details, select the method you prefer:

You can use the Stripe React Native SDK, to accept both Apple Pay and traditional credit card payments. Before starting, you need to enroll in the Apple Developer Program and set up Stripe on your server and in your app. Next, follow these steps:

  1. Register for an Apple Merchant ID
  2. Create a new Apple Pay certificate
  3. Integrate with Xcode
  4. Set your Apple Merchant ID in StripeProvider
  5. Check if Apple Pay is supported
  6. Present the payment sheet
  7. Submit the payment to Stripe

Remarques

If you use React Native and Expo, Expo Go doesn’t support Apple Pay. To use Apple Pay with Expo, you must create a development build. If you already have an Expo Go project, you can migrate it to a development build.

Register for an Apple Merchant ID

Obtain an Apple Merchant ID by registering for a new identifier on the Apple Developer website.

Fill out the form with a description and identifier. Your description is for your own records and you can modify it in the future. Stripe recommends using the name of your app as the identifier (for example, merchant.com.{{YOUR_APP_NAME}}).

Create a new Apple Pay certificate

Create a certificate for your app to encrypt payment data.

Go to the iOS Certificate Settings in the Dashboard, click Add new application, and follow the guide.

Download a Certificate Signing Request (CSR) file to get a secure certificate from Apple that allows you to use Apple Pay.

One CSR file must be used to issue exactly one certificate. If you switch your Apple Merchant ID, you must go to the iOS Certificate Settings in the Dashboard to obtain a new CSR and certificate.

Integrate with Xcode

Add the Apple Pay capability to your app. In Xcode, open your project settings, click the Signing & Capabilities tab, and add the Apple Pay capability. You might be prompted to log in to your developer account at this point. Select the merchant ID you created earlier, and your app is ready to accept Apple Pay.

Enable the Apple Pay capability in Xcode

Set your Apple Merchant ID in StripeProvider

In the StripeProvider component, specify the Apple Merchant ID that you successfully registered for:

import { StripeProvider } from '@stripe/stripe-react-native'; function App() { return ( <StripeProvider publishableKey="
pk_test_TYooMQauvdEDq54NiTphI7jx
" merchantIdentifier="merchant.com.{{YOUR_APP_NAME}}" > // Your app code here </StripeProvider> ); }

Check if Apple Pay is supported

Before displaying Apple Pay as a payment option in your app, determine if the user’s device supports Apple Pay and that they have a card added to their wallet:

import { PlatformPayButton, isPlatformPaySupported } from '@stripe/stripe-react-native'; function PaymentScreen() { const [isApplePaySupported, setIsApplePaySupported] = useState(false); useEffect(() => { (async function () { setIsApplePaySupported(await isPlatformPaySupported()); })(); }, [isPlatformPaySupported]); // ... const pay = async () => { // ... }; // ... return ( <View> {isApplePaySupported && ( <PlatformPayButton onPress={pay} type={PlatformPay.ButtonType.Order} appearance={PlatformPay.ButtonStyle.Black} borderRadius={4} style={{ width: '100%', height: 50, }} /> )} </View> ); }

Create the Payment Intent

Server-side

Make an endpoint that creates a PaymentIntent with an amount and currency. Always decide how much to charge on the server side, a trusted environment, as opposed to the client side. This prevents malicious customers from choosing their own prices.

Command Line
curl
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/payment_intents \ -u
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:
\ -d "amount"=1099 \ -d "currency"="usd"

Client-side

Create a method that requests a PaymentIntent from your server:

function PaymentScreen() { // ... const fetchPaymentIntentClientSecret = async () => { const response = await fetch(`${API_URL}/create-payment-intent`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ some: 'value', }), }); const { clientSecret } = await response.json(); return clientSecret; }; // ... }

Troubleshooting

If you’re seeing errors from the Stripe API when attempting to create tokens, you most likely have a problem with your Apple Pay Certificate. You’ll need to generate a new certificate and upload it to Stripe, as described on this page. Make sure you use a CSR obtained from your Dashboard and not one you generated yourself. Xcode often incorrectly caches old certificates, so in addition to generating a new certificate, Stripe recommends creating a new Apple Merchant ID as well.

If you receive the error:

You haven’t added your Apple merchant account to Stripe

it’s likely your app is sending data encrypted with a previous (non-Stripe) CSR/Certificate. Make sure any certificates generated by non-Stripe CSRs are revoked under your Apple Merchant ID. If this doesn’t resolve the issue, delete the merchant ID in your Apple account and re-create it. Then, create a new certificate based on the same (Stripe-provided) CSR that was previously used. You don’t need to upload this new certificate to Stripe. When finished, toggle the Apple Pay Credentials off and on in your app to ensure they refresh properly.

Present the payment sheet

In your PlatformPayButton’s onPress prop, call confirmPlatformPayPayment to open an Apple Pay sheet. To display the customer’s cart items on the payment sheet, pass the items as an argument. The final item must represent your company and the total; it appears in the sheet with the word “Pay” prepended (for example, “Pay iHats, Inc. $50”).

Remarques

In your code that handles the customer action, don’t include any complex or asynchronous actions before displaying the payment sheet. If the user action doesn’t directly invoke the payment sheet, Apple Pay returns an error.

import { confirmPlatformPayPayment } from '@stripe/stripe-react-native'; function PaymentScreen() { // ... see above const pay = async () => { const clientSecret = await fetchPaymentIntentClientSecret() const { error, paymentIntent } = await confirmPlatformPayPayment( clientSecret, { applePay: { cartItems: [ { label: 'Example item name', amount: '14.00', paymentType: PlatformPay.PaymentType.Immediate, }, { label: 'Tax', amount: '1.60', paymentType: PlatformPay.PaymentType.Immediate, }, { label: 'iHats, Inc.', amount: '15.60', paymentType: PlatformPay.PaymentType.Immediate, }, ], merchantCountryCode: 'US', currencyCode: 'USD', requiredShippingAddressFields: [ PlatformPay.ContactField.PostalAddress, ], requiredBillingContactFields: [PlatformPay.ContactField.PhoneNumber], }, } ); if (error) { // handle error } else { Alert.alert('Success', 'Check the logs for payment intent details.'); console.log(JSON.stringify(paymentIntent, null, 2)); } }; // ... see above }

FacultatifCreate a Payment Method
Client-side

If you confirm your payment on your server, you can use Apple Pay to only collect a PaymentMethod instead of confirm a payment. To do so, call the createPlatformPayPaymentMethod method:

import {PlatformPayButton, isPlatformPaySupported, createPlatformPayPaymentMethod} from '@stripe/stripe-react-native'; function PaymentScreen() { const [isApplePaySupported, setIsApplePaySupported] = useState(false); useEffect(() => { (async function () { setIsApplePaySupported(await isPlatformPaySupported()); })(); }, [isPlatformPaySupported]); const createPaymentMethod = async () => { const { error, paymentMethod } = await createPlatformPayPaymentMethod({ applePay: { cartItems: [ { label: 'Example item name', amount: '14.00', paymentType: PlatformPay.PaymentType.Immediate, }, { label: 'Total', amount: '12.75', paymentType: PlatformPay.PaymentType.Immediate, }, ], merchantCountryCode: 'US', currencyCode: 'USD', }, }); if (error) { Alert.alert(error.code, error.message); return; } else if (paymentMethod) { Alert.alert( 'Success', `The payment method was created successfully. paymentMethodId: ${paymentMethod.id}` ); } }; return ( <View > {isApplePaySupported && ( <PlatformPayButton onPress={createPaymentMethod} type={PlatformPay.ButtonType.SetUp} appearance={PlatformPay.ButtonStyle.WhiteOutline} style={{ width: '65%', height: 50, }} /> )} </View> ); }

FacultatifRecurring payments
Client-side

In iOS 16 or later, you can adopt merchant tokens by setting the request field in confirmPlatformPayPayment()'s and confirmPlatformPaySetupIntent’s applePay params object.

await confirmPlatformPayPayment( clientSecret, { applePay: { // Make sure to include the rest of the necessary fields request: { type: PlatformPay.PaymentRequestType.Recurring, description: 'String describing my payment', managementUrl: 'www.<a URL where the user can update the payment method for the recurring payment>.com', billing: { paymentType: PlatformPay.PaymentType.Recurring, intervalUnit: PlatformPay.IntervalUnit.Month, intervalCount: 3, label: 'My label', amount: '39.00', }, }, }, } );

To learn more about how to use recurring payments with Apple Pay, see Apple’s PassKit documentation.

FacultatifOrder tracking
Client-side

To adopt order tracking in iOS 16 or later, use the setOrderTracking callback for the PlatformPayButton component.

In your implementation:

  1. Fetch the order details from your server for the completed order.
  2. Call the provided completion handler in setOrderTracking with the results from your server.
<PlatformPayButton // Make sure to include the rest of the necessary props setOrderTracking={(completion) => { const { orderIdentifier, orderType, authToken, webServiceUrl } = fetchOrderDetailsFromMyBackend(); completion(orderIdentifier, orderType, authToken, webServiceUrl); }} />

To learn more about order tracking, see Apple’s Wallet Orders documentation.

Test Apple Pay

To test Apple Pay, you must use a real credit card number and your test API keys. Stripe recognizes that you’re testing and returns a successful test card token for you to use, so you can make test payments on a live card without charging it.

You can’t save Stripe test cards or Apple Pay test cards to Apple Pay wallets to test Apple Pay.

Voir aussi

  • iOS Integration
  • Apple Pay on the Web
  • Apple Pay Best Practices
Cette page vous a-t-elle été utile?
OuiNon
  • Besoin d'aide? Contactez le service d'assistance.
  • Rejoignez notre programme d'accès anticipé.
  • Consultez notre journal des modifications.
  • Des questions? Contactez l'équipe commerciale.
  • GML? Lire llms.txt.
  • Optimisé par Markdoc