Skip to content

Latest commit

 

History

History
 
 

2019-12-04-ios

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

One-time Payments on iOS 2019-12-04

Learn how to collect one-time Payments using Stripe's iOS SDK

🎬 Watch on YouTube

Getting Started

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.

Prerequisites

Step by step

  1. Install Pods

From the directory where the Podfile is, install the Stripe iOS SDK and Alamofire pods with

pod install
  1. Start the server

Deploy the example iOS backend to Heroku: https://github.com/stripe/example-ios-backend#example-app-backend

  1. 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"
  1. 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.

More Resources

Demo