Go to file
Brian Dorfman f86c7fa767 Remove remember me 2017-06-28 17:05:59 -07:00
.github more github stuffs 2016-07-20 22:22:39 +01:00
Example Retrieve and update customer.shipping info via ephemeral key 2017-06-22 16:49:00 -04:00
FauxPasConfig ignore border punctuation rule 2016-12-15 15:30:12 -05:00
Stripe Remove remember me 2017-06-28 17:05:59 -07:00
Stripe.xcodeproj Remove remember me 2017-06-28 17:05:59 -07:00
Stripe.xcworkspace
StripeiOSResources remove CFBundleExecutable from resources bundle 2016-08-24 22:51:20 -04:00
Tests Remove remember me 2017-06-28 17:05:59 -07:00
ci_scripts Merge pull request #695 from stripe/bg-temp-pull-translations 2017-06-26 14:52:49 -04:00
docs update docs for 10.2.0 2017-06-16 18:58:39 -04:00
.clang-format
.cocoapods.yml
.gitignore use Alamofire in example app 2017-05-18 14:03:01 -04:00
.jazzy.yaml
.phraseapp.yml Add phraseapp push/pull scripts 2016-08-25 16:51:06 -07:00
.travis.yml use xcode8.3 on travis 2017-05-24 13:44:21 -04:00
CHANGELOG remove STPCustomerContext singleton 2017-06-22 15:19:39 -04:00
Cartfile.private Move cartfile -> cartfile.private 2016-11-04 11:57:32 -07:00
Cartfile.resolved add OCMock 2017-03-28 15:17:42 -07:00
LICENSE
MIGRATING.md update MIGRATING 2017-06-22 16:59:03 -04:00
README.md add install_cardio script 2017-06-08 17:56:19 -04:00
Stripe.podspec bump version to 10.2.0 2017-06-16 18:56:39 -04:00
VERSION bump version to 10.2.0 2017-06-16 18:56:39 -04:00
install_cardio.rb update install_cardio 2017-06-09 11:29:13 -04:00
setup.sh Silence cleanup step if `Cartfile.resolved` doesn't exist in `setup.sh` 2017-06-12 14:19:19 -07:00

README.md

Stripe iOS SDK

Travis CocoaPods Carthage compatible CocoaPods CocoaPods

The Stripe iOS SDK make it easy to collect your users' credit card details inside your iOS app. By creating tokens, Stripe handles the bulk of PCI compliance by preventing sensitive card data from hitting your server (for more, see our article about PCI compliance).

We also offer seamless integration with Apple Pay that will allow you to securely collect payments from your customers in a way that prevents them from having to re-enter their credit card information.

Requirements

Our SDK is compatible with iOS apps supporting iOS 8.0 and above. It requires Xcode 8.0+ to build the source.

If you need iOS 7 or Xcode 7 compatibility, the last supported SDK release is version 8.0.7.

Integration

We've written a guide that explains everything from installation, to creating payment tokens, to Apple Pay integration and more.

For more fine-grained information on all of the classes and methods in our SDK, consult our full SDK reference.

Example apps

There are 2 example apps included in the repository:

  • Stripe iOS Example (Simple) shows an integration using our prebuilt UI components [Swift]
  • Stripe iOS Example (Custom) shows how to use our low-level methods to accept payments using several different payment methods [Objective-C].

To build the example apps, you'll need to first run ./setup.sh. Then, open Stripe.xcworkspace and choose the appropriate scheme.

Getting started with the iOS example apps

Note: all the example apps require Xcode 8.0 to build and run.

Before you can run the apps, you need to provide them with your Stripe publishable key.

  1. If you haven't already, sign up for a Stripe account (it takes seconds). Then go to https://dashboard.stripe.com/account/apikeys.
  2. Replace the stripePublishableKey constant in CheckoutViewController.swift (for the Simple app) or Constants.m (for the Custom app) with your Test Publishable Key.
  3. Head to https://github.com/stripe/example-ios-backend and click "Deploy to Heroku" (you may have to sign up for a Heroku account as part of this process). Provide your Stripe test secret key for the STRIPE_TEST_SECRET_KEY field under 'Env'. Click "Deploy for Free".
  4. Replace the backendBaseURL variable in the example iOS app with the app URL Heroku provides you with (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.

card.io

To add card scanning capabilities to our prebuilt UI components, you can simply install card.io alongside our SDK. You'll also need to set NSCameraUsageDescription in your application's plist, and provide a reason for accessing the camera (e.g. "To scan cards").

To try this out, you can run ./install_cardio.rb, which will download and install card.io in Stripe iOS Example (Simple). Now, when you run the example app on a device, you'll see a "Scan Card" button when adding a new card.

Running the tests

  1. Install Carthage (if you have homebrew installed, brew install carthage)
  2. From the root of the repo, install test dependencies by running carthage bootstrap --platform ios --configuration Release --no-use-binaries
  3. Open Stripe.xcworkspace
  4. Choose the "StripeiOS" scheme with the iPhone 6, iOS 10.3 simulator (required for snapshot tests to pass)
  5. Run Product -> Test

Migrating from older versions

See MIGRATING.md