Go to file
Cameron 03ab0f2280
19 Card Digit Support Part 2 (#1631)
* * Adds API bindings for new, private card metadata endpoint
* Disables card number truncation in `STPPaymentCardTextField`
* Disables auto-advancing out of the number entry field in `STPPaymentCardTextField`
* Updates card number validation to wait for response from card metadata endpoint
* Updates tests with new card number behavior and asynchronicity

* Fixes UI test

* Enables auto-advancing when able and loading indicator to STPPaymentCardTextField

* Revert

* Comment updates from review

* Adds logging for entering full card number before getting a network response.

* Adds additional logging.

* Return

* Use configuration

* Fixes inifite loop; fixes KVO; fixes tests for updated behavior.

* Fixes memory leak/crash from retain cycle in OCMock code

* Fix test case

* Only enable service-based BIN lookups for CUP bins (#1642)

* Fixes validation tests and removes delay from card textfield tests.

* Updates README with correct simulator version for tests.

* Fixes snapshot tests

Co-authored-by: davidme-stripe <52758633+davidme-stripe@users.noreply.github.com>
2020-09-14 12:40:26 -07:00
.github Adjust issue / pull request template (#960) 2018-06-07 10:00:23 -07:00
Example Adds support for dynamic card metadata and >16 digit PANs (#1608) 2020-09-14 09:53:24 -07:00
FauxPasConfig Add support for Swift Package Manager 2020-09-11 16:29:53 -07:00
InternalFrameworks Add support for Swift Package Manager 2020-09-11 16:29:53 -07:00
LocalizationTester Card scanning 2020-08-19 12:05:09 -07:00
LocalizationTesterUITests Updates based on feedback, add UI Test 2019-08-30 16:30:09 -07:00
Stripe 19 Card Digit Support Part 2 (#1631) 2020-09-14 12:40:26 -07:00
Stripe.xcodeproj 19 Card Digit Support Part 2 (#1631) 2020-09-14 12:40:26 -07:00
Stripe.xcworkspace Update Examples w/ stripe-samples (#1437) 2019-11-07 12:47:59 -08:00
StripeiOSResources remove CFBundleExecutable from resources bundle 2016-08-24 22:51:20 -04:00
Tests 19 Card Digit Support Part 2 (#1631) 2020-09-14 12:40:26 -07:00
ci_scripts Change something small to notify travis 2020-09-11 16:54:13 -07:00
docs Fix spelling typos and a CSS warning (#1623) 2020-08-17 15:06:09 -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 Add support for Swift Package Manager 2020-09-11 16:29:53 -07:00
.jazzy.yaml Add support for Swift Package Manager 2020-09-11 16:29:53 -07:00
.phraseapp.yml Add phraseapp push/pull scripts 2016-08-25 16:51:06 -07:00
.travis.yml Add support for Swift Package Manager 2020-09-11 16:29:53 -07:00
CHANGELOG.md Fix spelling typos and a CSS warning (#1623) 2020-08-17 15:06:09 -07:00
CONTRIBUTING.md Move CONTRIBUTING.md to root directory 2017-08-03 11:28:46 -07:00
Cartfile.private Switch from facebook/ios-snapshot-test-case 2.1.4 to uber/ios-snapshot-test-case 6.0.3 2019-05-22 12:14:52 -07:00
Cartfile.resolved Adds support for dynamic card metadata and >16 digit PANs (#1608) 2020-09-14 09:53:24 -07:00
LICENSE Fix license 2020-09-11 16:24:10 -07:00
MIGRATING.md Add support for Swift Package Manager 2020-09-11 16:29:53 -07:00
Package.swift Add support for Swift Package Manager 2020-09-11 16:29:53 -07:00
README.md 19 Card Digit Support Part 2 (#1631) 2020-09-14 12:40:26 -07:00
STYLEGUIDE.md Add support for Swift Package Manager 2020-09-11 16:29:53 -07:00
Stripe.podspec Switch to semver 2020-09-11 18:36:23 -07:00
VERSION Bump version 19.3.0 -> 19.4.0 2020-08-13 17:08:52 -07:00
ui-examples.png Update Examples w/ stripe-samples (#1437) 2019-11-07 12:47:59 -08:00

README.md

Stripe iOS SDK

Travis CocoaPods Carthage compatible License Platform

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.

Get started with our 📚 integration guides and example projects, or 📘 browse the SDK reference.

Updating to a newer version of the SDK? See our migration guide and changelog.

Table of contents

Features

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

Apple Pay: We provide a seamless integration with Apple Pay.

SCA-Ready: The SDK automatically performs native 3D Secure authentication if needed to comply with Strong Customer Authentication regulation in Europe.

Stripe API: We provide low-level APIs that correspond to objects and methods in the Stripe API. You can build your own entirely custom UI on top of this layer, while still taking advantage of utilities like STPCardValidator to validate your users input.

Native UI: We provide native screens and elements to collect payment and shipping details. For example, STPPaymentCardTextField is a UIView that collects and validates card details:

STPPaymentCardTextField

You can use these individually, or take all of the prebuilt UI in one flow by following the Basic Integration guide.

STPAddCardViewControllerSTPPaymentOptionsViewControllerSTPShippingAddressViewController

From left to right: STPAddCardViewController, STPPaymentOptionsViewController, STPShippingAddressViewController

Card scanning: We support card scanning on iOS 13 and higher. See our Card scanning section.

Releases

We recommend installing the Stripe iOS SDK using Swift Package Manager. (File -> Swift Packages -> Add Package Dependency… in Xcode.) We also support Cocoapods and Carthage. If you link the library manually, use a version from our releases page.

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 requires Xcode 11.7 or later and is compatible with apps targeting iOS 11 or above. We support Catalyst on macOS 10.15 or later. Swift Package Manager support requires Xcode 12 or later.

For iOS 10 support, please use v19.4.0. If you need to support iOS 9, use v17.0.2.

Getting Started

Integration

Get started with our 📚 integration guides and example projects, or 📘 browse the SDK reference for fine-grained documentation of all the classes and methods in the SDK.

Examples

There are 3 example apps included in the repository:

  • UI Examples.
    • This example lets you quickly try out the SDK's prebuilt UI components using a mock backend—just build and run!
  • Basic Integration
    • This example demonstrates how to build a payment flow using our prebuilt UI component integration (STPPaymentContext).
  • Non-Card Payment Examples
    • This example demonstrates how to use STPAPIClient to accept various non-card payment methods.

Check out stripe-samples for more, including:

Card scanning (Beta)

To add card scanning capabilities to our prebuilt UI components, set the cardScanningEnabled option on your STPPaymentConfiguration. 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"). Card scanning is supported on devices with iOS 13 or higher.

Card Scanning Demo

Demo this in our Basic Integration example app. When you run the example app on a device, you'll see a "Scan Card" button when adding a new card.

This feature is currently in beta. Please file bugs on our GitHub issues page.

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

Migrating from Older Versions

See MIGRATING.md