Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move example app instructions to main readme #345

Merged
merged 3 commits into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,52 @@ Stripe Terminal enables you to build your own in-person checkout to accept payme
* [JS](#js)
* [Android](#android)
* [iOS](#ios)
- [Try the example app](#try-the-example-app)
- [Installation](#installation)
- [Example code](#example-code)
* [Initialization](#initialization)
* [Hooks and events](#hooks-and-events)
- [Additional docs](#additional-docs)
- [Contributing](#contributing)

# Getting started
## Getting started

> Note: The below docs are not yet available and will be released as we near open beta

Get started with our [📚 integration guides](https://stripe.com/docs/terminal/payments/setup-sdk?terminal-sdk-platform=react-native) and [example project](https://stripe.com/docs/terminal/example-applications?terminal-sdk-platform=react-native), or [📘 browse the SDK reference](https://stripe.dev/stripe-terminal-react-native).

Updating to a newer version of the SDK? See our [release notes](https://github.com/stripe/stripe-terminal-react-native/releases).

# Requirements
## Requirements

## JS
### JS

- The SDK uses TypeScript features available in Babel version `7.9.0` and above.
Alternatively use the `plugin-transform-typescript` plugin in your project.

## Android
### Android

- Android 5.0 (API level 21) and above
- compileSdkVersion = 31
- targetSdkVersion = 31

## iOS
### iOS

- Compatible with apps targeting iOS 10 or above.

# Installation
## Try the example app

The React Native SDK includes an open-source example app, which you can use to familiarize yourself with the SDK and reader before starting your own integration.

To build the example app from source, you'll need to:

1. Run `yarn boostrap` from the root directory to build the SDK.
2. Navigate to our [example backend](https://github.com/stripe/example-terminal-backend) and click the button to deploy it on Heroku.
3. Navigate to the `example-app` folder and run `yarn install` to install all example app dependencies.
4. Copy `.env.example` to `.env`, and set the URL of the Heroku app you just deployed.
5. Run either `yarn ios` or `yarn android` depending on which platform you would like to build.

## Installation

```sh
yarn add @stripe/stripe-terminal-react-native
Expand All @@ -48,9 +61,9 @@ or
```sh
npm install @stripe/stripe-terminal-react-native
```
# Example code
## Example code

## Initialization
### Initialization

To initialize Stripe Terminal SDK in your React Native app, use the `StripeTerminalProvider` component in the root component of your application.

Expand Down Expand Up @@ -102,7 +115,7 @@ function App() {
}
```

## Hooks and events
### Hooks and events

Stripe Terminal SDK provides dedicated hook which exposes bunch of methods and props to be used within your App.
Additionally, you have access to the internal state of SDK that contains information about the current connection, discovered readers and loading state.
Expand Down Expand Up @@ -171,11 +184,10 @@ class PaymentScreen extends React.Component {

export default withStripeTerminal(PaymentScreen);
```
# Additional docs
## Additional docs

- [Running the Example Application](/docs/example-applications.md)
- [Running e2e tests locally](/docs/e2e-tests.md)

# Contributing
## Contributing

See the [contributor guidelines](CONTRIBUTING.md) to learn how to contribute to the repository.
56 changes: 0 additions & 56 deletions docs/example-applications.md

This file was deleted.