Go to file
Joey Dong a9dfefcd0d Improve feature list, contribution note 2017-08-28 10:39:21 -07:00
.github Move CONTRIBUTING.md to root directory 2017-08-03 11:28:46 -07:00
Example Fix deprecation warning in ui examples 2017-08-07 14:24:00 -07:00
FauxPasConfig ignore border punctuation rule 2016-12-15 15:30:12 -05:00
Stripe Fix spelling of `verification` in documentation (#769) 2017-08-15 13:10:55 -07:00
Stripe.xcodeproj Fix public header + PR feedback 2017-08-07 13:48:34 -07:00
Stripe.xcworkspace fix workspace reference 2017-07-19 17:53:21 -04:00
StripeiOSResources remove CFBundleExecutable from resources bundle 2016-08-24 22:51:20 -04:00
Tests Fix spellcheck lint for helper functions info / die, Set default GitHub url in .jazzy.yaml 2017-08-15 15:55:57 -07:00
ci_scripts Fix spellcheck lint for helper functions info / die, Set default GitHub url in .jazzy.yaml 2017-08-15 15:55:57 -07:00
docs Git ignore undocumented.json 2017-08-07 14:09:54 -07:00
.clang-format introduce style defaults with clang-format 2014-10-22 15:20:32 -04:00
.cocoapods.yml update pod try to open UI Examples 2017-07-19 17:34:25 -04:00
.gitignore Git ignore undocumented.json 2017-08-07 14:09:54 -07:00
.jazzy.yaml Fix spellcheck lint for helper functions info / die, Set default GitHub url in .jazzy.yaml 2017-08-15 15:55:57 -07:00
.phraseapp.yml Add phraseapp push/pull scripts 2016-08-25 16:51:06 -07:00
.travis.yml CI script to check documentation coverage 2017-08-07 11:38:41 -07:00
CHANGELOG.md Update changelog 2017-08-03 17:00:04 -07:00
CONTRIBUTING.md Move CONTRIBUTING.md to root directory 2017-08-03 11:28:46 -07: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 Add LICENSE 2012-11-12 11:54:52 -05:00
MIGRATING.md Update changelog 2017-08-03 17:00:04 -07:00
README.md Improve feature list, contribution note 2017-08-28 10:39:21 -07:00
STYLEGUIDE.md Rename StyleGuide.md to STYLEGUIDE.md 2017-08-03 11:28:46 -07:00
Stripe.podspec bump version to v11.2.0 2017-07-27 14:51:10 -07:00
VERSION bump version to v11.2.0 2017-07-27 14:51:10 -07:00
install_cardio.rb fix rename error in install_cardio.rb 2017-07-19 15:31:25 -04:00
setup.sh fix references to old example names 2017-07-19 11:27:34 -04:00

README.md

Stripe iOS SDK

Travis CocoaPods Carthage compatible CocoaPods CocoaPods

The Stripe iOS SDK makes it quick and easy to build an excellent payment experience in your iOS app. We provide powerful and customizable UI screens and elements that can be used out-of-the-box to collect your users' payment details. We also expose the low-level APIs that power those UIs so that you can build fully custom experiences. See our iOS Integration Guide to get started!

Note: We've greatly simplified the integration for STPPaymentContext in v11.0.0. If you integrated STPPaymentContext prior to this and you're interested in migrating, please see our migration guide.

Features

Simplified Security: We make it simple for you to collect sensitive data such as credit card numbers by tokenizing payment information. This means the sensitive data is sent directly to Stripe instead of passing through your server. For more information, please see our Integration Security Guide.

Apple Pay: We have seamless integration with Apple Pay that will allow your customers to pay using their saved payment information. For more information, please see our Apple Pay page. We also have a tutorial for our Apple Pay Utilities.

Native UI: We provide out-of-the-box native screens and elements so that you can get started quickly without having to think about designing the right interfaces. See our Standard Integration Guide for the most hands off approach. Please see our Custom Integration Guide if you want a little more control.

Card Scanning: We support card scanning capabilities using card.io. See our card.io section.

Releases

We recommend that you install the Stripe iOS SDK using a package manager such as Cocoapods or Carthage. If you prefer to link the library manually, please use a version from our releases page because we consider the master branch to be unstable.

If you're reading this on GitHub.com, please make sure you are looking at the tagged version that corresponds to the release you have installed. Otherwise, the instructions and example code may be mismatched with your copy. You can read the latest tagged version of this README and browse the associated code on GitHub using this link.

Requirements

The Stripe iOS SDK is compatible with apps supporting iOS 8 and above and requires Xcode 8 to build from source.

Getting Started

Integration

Please see our iOS Integration Guide which explains everything from SDK installation, to tokenizing payment information, to Apple Pay integration, and more. For more fine-grained documentation for all of the classes and methods, please see our full Stripe iOS SDK Reference.

Examples

There are 3 example apps included in the repository:

  • UI Examples: Shows off the various premade UI components the SDK includes, but is not a functional app and makes no network calls.
  • Standard Integration (Swift): shows an integration using our prebuilt UI components.
  • Custom Integration (ObjC): shows how to use our low-level methods to accept payments using several different payment methods.

To try out any of these examples, clone this repository, open Stripe.xcworkspace with Xcode, and run the appropriate scheme. The UI Examples app can be run without any extra work necessary. In order to run the Standard Integration (Swift) or Custom Integration (ObjC) example, you must perform these setup steps:

  1. Execute ./setup.sh from the root of the repository to build the necessary dependencies.
  2. If you haven't already, sign up for a Stripe account (it takes seconds). Then go to https://dashboard.stripe.com/account/apikeys.
  3. Replace the stripePublishableKey constant in CheckoutViewController.swift (for the Standard Integration app) or Constants.m (for the Custom Integration app) with your Test Publishable Key.
  4. Head to https://github.com/stripe/example-ios-backend/tree/v11.0.0 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".
  5. 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 Standard Integration (Swift). Now, when you run the example app on a device, you'll see a "Scan Card" button when adding a new card.

Contributing

We welcome contributions of any kind including new features, bug fixes, and documentation improvements. Please first open an issue describing what you want to build if it is a major change so that we can discuss how to move forward. Otherwise, go ahead and open a pull request for minor changes such as typo fixes and one liners.

Running 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