This example app demonstrates how to use STPAPIClient to accept various non-card payment methods. This may be a useful reference if you're building your own payment flow and not using STPPaymentContext. For examples of accepting cards, check out stripe-samples.
To run this app:
- If you haven't already, sign up for a Stripe account (it takes seconds).
- Open
./Stripe.xcworkspace(not./Stripe.xcodeproj) with Xcode - Fill in the
stripePublishableKeyconstant in./Example/Non-Card Payment Examples/Constants.mwith your Stripe test "Publishable key". 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_KEYenvironment variable. This key should start withsk_test. - Fill in the
backendBaseURLconstant inConstants.mwith 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.