Git Product home page Git Product logo

stripe-ios's Introduction

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 and run the example apps, 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.

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.1 simulator (required for snapshot tests to pass)
  5. Run Product -> Test

Migrating from older versions

See MIGRATING.md

stripe-ios's People

Contributors

jack-stripe avatar bg-stripe avatar bdorfman-stripe avatar vprtwn avatar jamesreggio avatar alex-stripe avatar michaelvillar avatar scalessec avatar ray-stripe avatar bradfol avatar klaaspieter avatar angelogiurano avatar watsonbox avatar phillco avatar zwick-stripe avatar raycmorgan avatar jgiola avatar bkrausz avatar maccman avatar zachwick avatar lfarah avatar laiso avatar jonyzfu avatar vytk avatar toddheasley avatar schayes04 avatar sebyddd avatar sebavenditti avatar readmecritic avatar theill avatar

Stargazers

MohsinAli avatar

Watchers

MohsinAli avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.