Learn how to collect one-time Payments using Stripe's iOS SDK
Follow these instructions to spin-up a copy of this demo project up on your local machine for development and testing purposes. This is meant to be a guide to show you how to go about building an example iOS app with a payment flow for one time payments.
- Install Pods
From the directory where the Podfile is, install the Stripe iOS SDK and Alamofire pods with
pod install
- Start the server
Deploy the example iOS backend to Heroku: https://github.com/stripe/example-ios-backend#example-app-backend
- Configure your keys in your project
After opening the project in Xcode, set your Stripe publishable key and Heroku backend URL in Constants.swift
static let herokuBackendUrl : String = "https://yourserverurl.herokuapp.com/"
static let stripePublishableKey : String = "pk_test_123"
- Run the demo
Run the project in Xcode on a simulator. Enter a test card token (e.g. 4242) and press "Submit Payment" button
For test cards see https://stripe.com/docs/testing#cards.