stripe-ios/Example/Basic Integration
John Woo b5e349fa75
Remove generated project files for v23.9.1 (#2648)
2023-06-13 02:05:40 +01:00
..
Basic Integration Lint Examples and stragglers (#2220) 2023-01-13 09:48:37 -08:00
BasicIntegrationUITests Lint Examples and stragglers (#2220) 2023-01-13 09:48:37 -08:00
BuildConfigurations Use tuist to generate xcode projects (#2102) 2022-12-20 12:55:37 -08:00
Project.swift Lint Examples and stragglers (#2220) 2023-01-13 09:48:37 -08:00
README.md fix link to Payment Sheet example 2022-02-10 13:37:55 -05:00

README.md

Basic Integration

Note: This integration is not recommended. Instead, try PaymentSheet, an embeddable native UI component that lets you accept 10+ payment methods with a single integration.

This example app demonstrates how to build a payment flow using our pre-built UI component integration (STPPaymentContext).

To run the example app:

  1. If you haven't already, sign up for a Stripe account (it takes seconds).
  2. Open stripe-ios/Stripe.xcworkspace (not stripe-ios/Stripe.xcodeproj) with Xcode
  3. Fill in the stripePublishableKey constant in stripe-ios/Example/Basic Integration/Basic Integration/CheckoutViewController.swift with your Stripe test "Publishable key". This key should start with pk_test.
  4. Head to example-mobile-backend and click "Deploy to Heroku". Provide your Stripe test "Secret key" as the STRIPE_TEST_SECRET_KEY environment variable. This key should start with sk_test.
  5. Fill in the backendBaseURL constant in ./Example/Basic Integration/Basic Integration/CheckoutViewController.swift with the app URL Heroku provides (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.