Show
Set up your payment method.Make sure you're running the latest version of iOS. Step 1In iPhone, go to Settings. Tap on your Apple ID and select Payment & Shipping. You might be asked to sign in.1 Step 2Tap Add Payment Method. Step 3Select your preferred payment method. Easily add, update, reorder or remove it at any time. Discover ways to get more from your device.App Store. Transform the
way you do anything with apps that help you create, learn, play games or just Learn more Apple Music. Discover new tracks and curated playlists, listen to your existing music library and follow along to lyrics while you listen. All ad‑free. Online or off. Learn more Apple TV+. Watch critically acclaimed Apple Original shows and movies from the most creative minds in TV and film. Learn more Apple Arcade. Get unlimited access to ad‑free games from all your favorite genres, with no in‑app purchases. Learn more iCloud+. Get plenty of space for the things that matter. Store your photos, videos, files and more across all your devices. Learn more Apple One. The easiest way to get all your favorite Apple services at one incredible price. Learn more 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 the pricing is the same as other card transactions. Apple Pay is compatible with most Stripe products and features (for example, subscriptions). Use it to accept payments for physical or digital goods, donations, subscriptions, and more (you can’t use Apple Pay instead of in-app purchases though). Apple Pay is available to cardholders at participating banks in supported countries. Refer to Apple’s participating banks documentation to learn which banks and countries are supported. Apple Pay doesn’t replace Apple’s In-App Purchase API. You can use any of Stripe’s supported payment methods and Apple Pay in your iOS app to sell physical goods (for example, groceries and clothing) or for services your business provides (for example, club memberships and hotel reservations). These payments are processed through Stripe and you only need to pay Stripe’s processing fee. Apple’s developer terms require their In-App Purchase API be used for digital “content, functionality, or services,” such as premium content for your app or subscriptions for digital content. Payments made using the In-App Purchase API are processed by Apple and subject to their transaction fees. Stripe offers a variety of methods to add Apple Pay as a payment method. For integration details, select the method you prefer: With the Stripe iOS SDK, you can accept both Apple Pay and traditional credit card payments. Before starting, you need to be enrolled in the Apple Developer Program. Next, follow these steps:
First, you need a Stripe account. Register now. Server-sideThis integration requires endpoints on your server that talk to the Stripe API. Use the official libraries for access to the Stripe API from your server: Client-sideThe Stripe iOS SDK is open source, fully documented, and compatible with apps supporting iOS 11 or above. To install the SDK, follow these steps:
When your app starts, configure the SDK with your Stripe publishable key so that it can make requests to the Stripe API.
Use your test mode keys while you test and develop, and your live mode keys when you publish your app. 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, Create a certificate for your app to encrypt payment data. In the Dashboard’s Apple Pay Settings, click Add new application and follow the guide there. 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. 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: CheckoutViewController.swift
When the user taps the Apple Pay button, call StripeAPI paymentRequestWithMerchantIdentifier:country:currency: to create a PKPaymentRequest. Then, configure the See Apple’s documentation for full guidance on how to customize the payment request. CheckoutViewController.swift
Create an
STPApplePayContext instance with the CheckoutViewController.swift
Submit the payment to StripeServer-sideMake 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.
Client-sideImplement After you call the
completion block, CheckoutViewController.swift
Finally, handle post-payment events to do things like sending an order confirmation email to your customer, logging the sale in a database, or starting a shipping workflow. TroubleshootingIf 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:
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. App ClipsThe The Migrating from STPApplePayContextIf you’re an existing user of
Recurring paymentsIn iOS 16 or later, you can adopt merchant tokens by setting the CheckoutViewController.swift
To learn more about how to use recurring payments with Apple Pay, see Apple’s PassKit documentation. Order trackingTo adopt order tracking in iOS 16 or later, implement the
In your implementation:
To learn more about order tracking, see Apple’s Wallet Orders documentation. CheckoutViewController.swift
Stripe test card information can’t be saved to Wallet in iOS. Instead, Stripe recognizes when you’re using your test API keys and returns a successful test card token for you to use. This allows you to make test payments using a live card without it being charged. How do I reset Apple Pay?iPhone: Go to Settings > Wallet & Apple Pay > scroll down to Transaction Defaults and update your shipping address, email, and phone number. Apple Watch: In the Apple Watch app on your iPhone, tap Wallet & Apple Pay > scroll down to Transaction Defaults and update your shipping address, email, and phone number.
How do I add new Apple Pay?Set up. iPhone. Open the Wallet app. and tap to add a card.. iPad. Go to Settings. Wallet & Apple Pay. and tap Add Card.. Mac. On models with Touch ID, go to System Preferences. Wallet & Apple Pay and. tap Add Card.. Can I have 2 Apple Pay cards?Yes, up to eight cards can be added to Apple Pay on a single device. The first card added to the device will become the default card, but you can change the default card.
|