•  


Stripe - Expo Documentation
Home Guides Reference Learn

Reference version

Archive Expo Snack Discord and Forums Newsletter

Stripe

GitHub

npm

A library that provides access to native APIs for integrating Stripe payments.

Android
iOS

Expo includes support for @stripe/stripe-react-native , which allows you to build delightful payment experiences in your native Android and iOS apps using React Native and Expo. This library provides powerful and customizable UI screens and elements that can be used out-of-the-box to collect your users' payment details.

Migrating from Expo's expo-payments-stripe module? Learn more about how to transition to the new @stripe/stripe-react-native library .

Installation

Each Expo SDK version requires a specific @stripe/stripe-react-native version. See the Stripe CHANGELOG for a mapping of versions. To automatically install the correct version for your Expo SDK version, run:

Terminal
-? npx expo install @stripe/stripe-react-native

If you're installing this in a bare React Native app , you should also follow these additional installation instructions .

Config plugin setup (optional)

If you're using EAS Build, you can do most of your Stripe setup using the @stripe/stripe-react-native config plugin . To set up, just add the config plugin to the plugins array of your app.json or app.config.js as shown below, then rebuild the app.

app.json
{

  "expo"
:
 {

    %%placeholder-start%%
... 
%%placeholder-end%%

    "plugins"
:
 [

      [

        "@stripe/stripe-react-native"
,

        {

          "merchantIdentifier"
:
 string | string 
[
]
,

          "enableGooglePay"
:
 boolean
        
}

      ]

    ]
,

  }

}

  • merchantIdentifier : iOS only. This is the Apple merchant ID obtained here . Otherwise, Apple Pay will not work as expected. If you have multiple merchantIdentifiers, you can set them in an array.
  • enableGooglePay : Android only. Boolean indicating whether or not Google Pay is enabled. Defaults to false .

Example

Trying out Stripe takes just a few seconds. Connect to this Snack on your device.

Under the hood, that example connects to this Glitch server code , so you'll need to open that page to spin up the server. Feel free to run your own Glitch server and copy that code!

Usage

For usage information and detailed documentation, please refer to:

  • Stripe's React Native SDK reference
  • Stripe's React Native GitHub repo
  • Stripe's example React Native app

Common issues

Browser pop-ups are not redirecting back to my app

If you're relying on redirects, you'll need to pass in a urlScheme to initStripe . To make sure you always use the proper urlScheme , pass in:

import
 *
 as
 Linking
 from
 'expo-linking'
;

import
 Constants
 from
 'expo-constants'
;


urlScheme
:

  Constants
.
appOwnership
 ===
 'expo'

    ?
 Linking
.
createURL
(
'/--/'
)

    :
 Linking
.
createURL
(
''
)
,

Linking.createURL() will ensure you're using the proper scheme, whether you're running in Expo Go or your production app. '/--/' is necessary in Expo Go because it indicates that the substring after it corresponds to the deep link path, and is not part of the path to the app itself.

Limitations

Google Pay

Google Pay is not supported in Expo Go . To use Google Pay, you must create a development build . This can be done with EAS Build , or locally by running npx expo run:android .

Apple Pay

Apple Pay is not supported in Expo Go . To use Apple Pay, you must create a development build . This can be done with EAS Build , or locally by running npx expo run:ios .

- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본