This example app demonstrates how to build a payment flow using our pre-built UI components (STPPaymentContext
).
For a detailed guide, see https://stripe.com/docs/mobile/ios/standard
- If you haven't already, sign up for a Stripe account (it takes seconds). Then go to https://dashboard.stripe.com/account/apikeys.
- Execute
./setup.sh
from the root of the repository to build the necessary dependencies - Open
./Stripe.xcworkspace
(not./Stripe.xcodeproj
) with Xcode - Fill in the
stripePublishableKey
constant in./Example/Standard Integration (Swift)/CheckoutViewController.swift
with your test "Publishable key" from Stripe. This key should start withpk_test
. - Head to example-ios-backend and click "Deploy to Heroku". Provide your Stripe test "Secret key" as the
STRIPE_TEST_SECRET_KEY
environment variable. This key should start withpk_test
. - Fill in the
backendBaseURL
constant in./Example/Standard Integration (Swift)/CheckoutViewController.swift
with the app URL Heroku provides (e.g. "https://my-example-app.herokuapp.com")
After this is done, you can make test payments through the app and see them in your Stripe dashboard.
Head to https://stripe.com/docs/testing#cards for a list of test card numbers.