stripe / stripe-react-native Goto Github PK
View Code? Open in Web Editor NEWReact Native library for Stripe.
Home Page: https://stripe.dev/stripe-react-native
License: MIT License
React Native library for Stripe.
Home Page: https://stripe.dev/stripe-react-native
License: MIT License
Describe the bug
I've followed the instructions here: https://github.com/stripe/stripe-react-native/blob/master/CONTRIBUTING.md#install-library-as-local-repository but am running into some issues, would appreciate any pointers you have @arekkubaczkowski
To Reproduce
Steps to reproduce the behavior:
npx react-native init MyTestApp
yarn install
:MyTestApp git:(master) yalc add react-native-stripe-sdk
Package [email protected]+b5ef738e added ==> /Users/thorsten/Documents/Projects/oss/react-native/MyTestApp/node_modules/react-native-stripe-sdk.
β MyTestApp git:(master) β yarn
yarn install v1.22.10
[1/4] π Resolving packages...
[2/4] π Fetching packages...
[3/4] π Linking dependencies...
warning "@react-native-community/eslint-config > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
[4/4] π¨ Building fresh packages...
error /Users/thorsten/Documents/Projects/oss/react-native/MyTestApp/node_modules/react-native-stripe-sdk: Command failed.
Exit code: 1
Command: yarn example
Arguments:
Directory: /Users/thorsten/Documents/Projects/oss/react-native/MyTestApp/node_modules/react-native-stripe-sdk
Output:
yarn run v1.22.10
$ yarn --cwd example
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
$ yarn example
$ yarn --cwd example
[1/4] Resolving packages...
success Already up-to-date.
$ yarn example
$ yarn --cwd example
[1/4] Resolving packages...
success Already up-to-date.
....
β MyTestApp git:(master) β
React Native bindings & docs for https://stripe.com/docs/payments/ideal/save-during-payment
Bindings & docs for https://stripe.com/docs/payments/accept-a-payment-synchronously
Key features:
And the api reference needs to be updated: https://github.com/stripe/stripe-react-native/blob/master/docs/api-reference/stripe.md#createpaymentmethod
Bindings & docs for https://stripe.com/docs/payments/bancontact/accept-a-payment
Bindings & docs for https://stripe.com/docs/payments/p24/accept-a-payment
React native bindings & docs for https://stripe.com/docs/payments/ideal/set-up-payment
Is your feature request related to a problem? Please describe.
Expo is one of the most popular frameworks for developing React native applications. I'd expect we'll get a lot of requests about this.
Describe the solution you'd like
Is it possible to suppor expo without needing to eject? If so, how much work would that be?
Describe alternatives you've considered
If this isn't easily possible, can we add a "usage with Expo" guide?
Additional context
Currently, when I try to use CardField
within an expo project I get βInvariant Violation: requireNativeComponent: "CardField" was not found in the UIManager.β which is related to the webview usage I beleive.
@arekkubaczkowski I'm getting this error on master when running yarn bootstrap
. I think there might have gone something wrong in #50 that I didn't catch in the review, sorry! Can you have a look?
stripe-react-native-master git:(master) β yarn bootstrap
yarn run v1.22.10
$ yarn example && yarn && yarn pods
$ yarn --cwd example
[1/4] π Resolving packages...
success Already up-to-date.
[1/4] π Resolving packages...
success Already up-to-date.
$ bob build
βΉ Building target commonjs
βΉ Cleaning up previous build at lib/commonjs
βΉ Compiling 11 files in src with babel
β Wrote files to lib/commonjs
βΉ Building target module
βΉ Cleaning up previous build at lib/module
βΉ Compiling 11 files in src with babel
β Wrote files to lib/module
βΉ Building target typescript
βΉ Cleaning up previous build at lib/typescript
βΉ Generating type definitions with tsc
src/hooks/useStripe.tsx:5:17 - error TS4058: Return type of exported function has or is using name 'CreatePaymentMethodCardData' from external module "/Users/thorsten/Documents/Projects/stripe-react-native-master/src/types" but cannot be named.
5 export function useStripe() {
~~~~~~~~~
Found 1 error.
β Failed to build definition files.
bob build
build files for publishing
Options:
--help Show help [boolean]
--version Show version number [boolean]
Error: Failed to build definition files.
at build (/Users/thorsten/Documents/Projects/stripe-react-native-master/node_modules/@react-native-community/bob/lib/targets/typescript.js:112:11)
at processTicksAndRejections (node:internal/process/task_queues:93:5)
at async Object.handler (/Users/thorsten/Documents/Projects/stripe-react-native-master/node_modules/@react-native-community/bob/lib/cli.js:350:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Bindings & docs for https://stripe.com/docs/payments/au-becs-debit/accept-a-payment
Bindings & docs for https://stripe.com/docs/payments/sofort/accept-a-payment
Developers should not be able to easily inspect properties on the CardDetails
object returned from CardField
. We should hide all the properties:
export type CardDetails = {
};
Currently, developers can look at cardDetails.number
easily. Instead they should just be using the CardDetails
object directly.
Ideally, developers should not be able to inspect these properties from CardDetails
at all. If that is too difficult, we should do our best to hide them. (cc @thorsten-stripe )
Bindings & docs for https://stripe.com/docs/payments/sofort/save-during-payment
React Native bindings & docs for https://stripe.com/docs/payments/ideal/accept-a-payment
(This page is missing an Android tab, but the Android bindings exist).
SEPA Debit docs: https://stripe.com/docs/payments/sepa-debit/accept-a-payment
We don't have mobile docs for this page, so we will only build React Native bindings and add to the example app.
Android example: https://github.com/stripe/stripe-android/blob/master/example/src/main/java/com/stripe/example/activity/ConfirmSepaDebitActivity.kt
Describe the bug
createPaymentMethod
should require a type
in its arguments to stay in sync with Stripe.js.
The disconnect is likely due to the fact that Android and iOS don't require a type, probably because they automatically infer it.
However react-stripe-js does via Stripe.js
Expected behavior
Require a type
on PaymentMethod creation:
const paymentMethod = await createPaymentMethod({
type: 'card',
card,
});
createPaymentMethod
's argument type should mimic what we do in Stripe.js.
I noticed that we're not consistent with parameter names,
e.g. livemode
vs isLiveMode
And things like customerId
or paymentMethodId
is something we don't do outside of the mobile world, e.g. normally it would just be customer
and paymentMethod
.
I would prefer if we were consistent with parameter names by not adding the Id
suffix and using livemode
instead of isLiveMode
across the board, but I'm not sure if that complicates things in terms of mapping from mobile.
Would appreciate you thoughts on this @auchenberg-stripe @bg-stripe @arekkubaczkowski
React Native bindings & docs for https://stripe.com/docs/payments/sepa-debit/set-up-payment
Currently blocked by missing mobile docs on this page. (cc @aliriaz-stripe β something we can consider working on in Q1, not sure what the state of SEPA mobile support is / why we don't have docs).
Describe the bug
The documentation provided in https://github.com/stripe/stripe-react-native/blob/master/docs/set-up-future-payments.md is missing some React Native code snippets.
Instead, we need full documentation, equivalent to what we have in the iOS and Android tabs on this page:
https://stripe.com/docs/payments/save-and-reuse
Bindings & docs for https://stripe.com/docs/payments/eps/accept-a-payment
Bindings & docs for https://stripe.com/docs/payments/save-during-payment
Key features:
Bindings & docs for https://stripe.com/docs/payments/grabpay/accept-a-payment
Stripe Issuing lets users provision cards from apps to their Apple Pay / Google Pay wallets.
We'd like to add React Native bindings for the functionality in this integration guide:
https://stripe.com/docs/issuing/cards/digital-wallets
The iOS & Android integrations are slightly different, so it's possible the end result will need to start with shared content on setting up your EphemeralKeyProvider, and then split into two sections documenting how to set this up for Apple Pay vs. Google Pay.
We'll want to verify that this works end-to-end in a sample app before we release it. We can give your Stripe account access to push provisioning (email bg [at] stripe.com and we can coordinate).
Describe the bug
When running yarn bootstrap
, pod install
errors.
To Reproduce
Steps to reproduce the behavior:
yarn bootstrap
Desktop (please complete the following information):
Additional context
stripe-react-native-master yarn bootstrap
yarn run v1.22.10
$ yarn example && yarn && yarn pods
$ yarn --cwd example
[1/4] π Resolving packages...
[2/4] π Fetching packages...
[3/4] π Linking dependencies...
[4/4] π¨ Building fresh packages...
[1/4] π Resolving packages...
success Already up-to-date.
$ bob build
βΉ Building target commonjs
βΉ Cleaning up previous build at lib/commonjs
βΉ Compiling 11 files in src with babel
β Wrote files to lib/commonjs
βΉ Building target module
βΉ Cleaning up previous build at lib/module
βΉ Compiling 11 files in src with babel
β Wrote files to lib/module
βΉ Building target typescript
βΉ Cleaning up previous build at lib/typescript
βΉ Generating type definitions with tsc
β Wrote definition files to lib/typescript
$ cd example && pod-install --quiet
1.10.0
> pod install
Auto-linking React Native modules for target `StripeSdkExample`: RNCMaskedView, RNGestureHandler, RNReanimated, RNScreens, and react-native-safe-area-context
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Downloading dependencies
Installing CocoaAsyncSocket (7.6.4)
Installing CocoaLibEvent (1.0.0)
Installing DoubleConversion (1.1.6)
Installing FBLazyVector (0.62.2)
Installing FBReactNativeSpec (0.62.2)
Installing Flipper (0.33.1)
Installing Flipper-DoubleConversion (1.1.7)
Installing Flipper-Folly (2.3.0)
Installing Flipper-Glog (0.3.6)
[!] /bin/bash -c
set -e
#!/bin/bash
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
set -e
PLATFORM_NAME="${PLATFORM_NAME:-iphoneos}"
CURRENT_ARCH="${CURRENT_ARCH}"
if [ -z "$CURRENT_ARCH" ] || [ "$CURRENT_ARCH" == "undefined_arch" ]; then
# Xcode 10 beta sets CURRENT_ARCH to "undefined_arch", this leads to incorrect linker arg.
# it's better to rely on platform name as fallback because architecture differs between simulator and device
if [[ "$PLATFORM_NAME" == *"simulator"* ]]; then
CURRENT_ARCH="x86_64"
else
CURRENT_ARCH="armv7"
fi
fi
export CC="$(xcrun -find -sdk $PLATFORM_NAME cc) -arch $CURRENT_ARCH -isysroot $(xcrun -sdk $PLATFORM_NAME --show-sdk-path)"
export CXX="$CC"
# Remove automake symlink if it exists
if [ -h "test-driver" ]; then
rm test-driver
fi
./configure --host arm-apple-darwin
# Fix build for tvOS
cat << EOF >> src/config.h
/* Add in so we have Apple Target Conditionals */
#ifdef __APPLE__
#include <TargetConditionals.h>
#include <Availability.h>
#endif
/* Special configuration for AppleTVOS */
#if TARGET_OS_TV
#undef HAVE_SYSCALL_H
#undef HAVE_SYS_SYSCALL_H
#undef OS_MACOSX
#endif
/* Special configuration for ucontext */
#undef HAVE_UCONTEXT_H
#undef PC_FROM_UCONTEXT
#if defined(__x86_64__)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip
#elif defined(__i386__)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__eip
#endif
EOF
# Prepare exported header include
EXPORTED_INCLUDE_DIR="exported/glog"
mkdir -p exported/glog
cp -f src/glog/log_severity.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/raw_logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/stl_logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/vlog_is_on.h "$EXPORTED_INCLUDE_DIR/"
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for arm-apple-darwin-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for arm-apple-darwin-gcc... /Library/Developer/CommandLineTools/usr/bin/cc -arch armv7 -isysroot
checking whether the C compiler works... no
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'
/Users/thorsten/Library/Caches/CocoaPods/Pods/Release/Flipper-Glog/0.3.6-1dfd6/missing: Unknown `--is-lightweight' option
Try `/Users/thorsten/Library/Caches/CocoaPods/Pods/Release/Flipper-Glog/0.3.6-1dfd6/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: in `/Users/thorsten/Library/Caches/CocoaPods/Pods/Release/Flipper-Glog/0.3.6-1dfd6':
configure: error: C compiler cannot create executables
See `config.log' for more details
Aborting run
An unexpected error was encountered. Please report it as a bug:
Error
at CocoaPodsPackageManager._installAsync (/Users/thorsten/Documents/Projects/stripe-react-native-master/node_modules/pod-install/build/index.js:2:85721)
at processTicksAndRejections (node:internal/process/task_queues:93:5)
at async CocoaPodsPackageManager.installAsync (/Users/thorsten/Documents/Projects/stripe-react-native-master/node_modules/pod-install/build/index.js:2:85121)
at async runAsync (/Users/thorsten/Documents/Projects/stripe-react-native-master/node_modules/pod-install/build/index.js:2:12925)
at async /Users/thorsten/Documents/Projects/stripe-react-native-master/node_modules/pod-install/build/index.js:2:13011
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
WeChatPay is currently on private beta. Should be available for implementation by early March. Will update here with docs once ready.
The PaymentMethod
type currently returns stripeId
as the key, however I think we should map this to id to be closer to the React web experience.
Bindings & docs for https://stripe.com/docs/payments/sofort/set-up-payment
Bindings & docs for https://stripe.com/docs/payments/bancontact/save-during-payment
Describe the bug
Filing this feedback on behalf of @richardg-stripe - feel free to add additional context.
Difficulty installing the project and not having a working build process. Richard (extensive RN experience) was asked to use the library without reading the steps. The feedback is shared below π
I created a new react native project following the instructions here: https://reactnative.dev/docs/environment-setup
Project has both .circleci and Github actions couldn't find Circle build, github actions is failing.
added: "react-native-stripe-sdk": "stripe/stripe-react-native"
to package.json. Ran: yarn install
this generated errors relating to example directory.
git clone https://github.com/stripe/stripe-react-native && cd stripe-react-native && yarn install
fails with the same error. cd examples && yarn install
fixes it.
Examples obviously should be built when building the package.
(cd ios && pod install)
failsAuto-linking React Native module for target `StripeReactNativeTesting`: react-native-stripe-sdk
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "react-native-stripe-sdk":
In Podfile:
react-native-stripe-sdk (from `../node_modules/react-native-stripe-sdk`)
Specs satisfying the `react-native-stripe-sdk (from `../node_modules/react-native-stripe-sdk`)` dependency were found, but they required a higher minimum deployment target.
I had modify ./ios/Podfile
platform :ios, '1{0,1}.0'
to make this work.
Error:
/Build/Products/Debug-iphonesimulator/StripeReactNativeTesting.app/StripeReactNativeTesting
ld: warning: Could not find or use auto-linked library 'swiftCoreMIDI'
ld: warning: Could not find or use auto-linked library 'swiftUniformTypeIdentifiers'
ld: warning: Could not find or use auto-linked library 'swiftCoreML'
Undefined symbols for architecture x86_64:
"(extension in Foundation):__C.NSScanner.scanUpToString(Swift.String) -> Swift.String?", referenced from:
static Stripe.STPPhoneNumberValidator.formattedRedactedPhoneNumber(for: Swift.String, forCountryCode: Swift.String?) -> Swift.String in libStripe.a(STPPhoneNumberValidator.o)
"__swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers", referenced from:
__swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_Stripe in libStripe.a(PKPaymentAuthorizationViewController+Stripe_Blocks.o)
I got stuck here
To cater for the greatest number of developers it should be a javascript example not a typescript one. typescript developers understand javascript, but the reverse isn't true.
The usage example is pseudo code - it doesn't actually work.
I'm not super-familar with ios / android SDK - but is fetching publishable key from your server a best-practice we recommend?
https://github.com/stripe/stripe-react-native/blob/master/example/src/App.tsx#L21-L29
It complicates their examples considerably and makes integration more difficult.
import {StripeProvider} from 'react-native-stripe-sdk';
breaks the projectRN isn't giving me an error anymore, I just get a white screen as soon as I add that line.
But at one point it said:
Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.
This error is located at:
in StripeProvider (at example.js:36)
in _default (at App.js:36)
in RCTView (at View.js:34)
in View (at SafeAreaView.js:41)
in ForwardRef(SafeAreaView) (at App.js:31)
in App (at renderApplication.js:45)
in RCTView (at View.js:34)
in View (at AppContainer.js:106)
in RCTView (at View.js:34)
in View (at AppContainer.js:132)
in AppContainer (at renderApplication.js:39)
But this might be a red herring.
Had to update: android/build.gradle
minSdkVersion = {16,21}
Bindings & docs for https://stripe.com/docs/payments/save-card-without-authentication
I think this is mostly a docs task. Recommend doing this after #22
The internal SetupIntent
type (https://github.com/stripe/stripe-react-native/blob/master/src/types.ts#L92) is missing a bunch of params: https://stripe.com/docs/api/setup_intents/object.
Can you add them, or is there a reason why you trimmed them down?
There is a broader question about naming. e.g. currently
useConfirmPayment
& confirmPayment
vs in Stripe.js we use confirmCardPayment
(https://stripe.com/docs/js/payment_intents/confirm_card_payment)useConfirmSetupIntent
& confirmSetupIntent
vs in Stripe.js we use confirmCardSetup
(https://stripe.com/docs/js/setup_intents/confirm_card_setup)@auchenberg-stripe I'd appreciate your input on this
We'd like to add bindings for our new native mobile payments UI (currently in an early beta). Please also include docs.
We'd like to review the integration (docs) in detail before we merge this one.
Bindings & docs for https://stripe.com/docs/payments/giropay/accept-a-payment
I think we should rename the Apple Pay methods to be more on line with the iOS SDK:
payWithApplePay
-> presentApplePay
(https://stripe.com/docs/apple-pay#present-payment-sheet)
completePaymentWithApplePay
-> confirmPayment
(in line with the overall Stripe PI experience)
@csabol-stripe @bg-stripe would appreciate your thoughts on this.
Describe the bug
The NoWebhookPayment example is working fine on iOS but on Android after the 3D Secure keeps spinning endlessly.
This is due to handleNextPaymentAction
having different return values on iOS vs Android.
const response = await handleNextPaymentAction(clientSecret);
// Response on Android
{
"amount":1400,
"created":1610534695,
"currency":"usd",
"description":null,
"id":"pi_1I96qRG7gfqYEkPOElpsrC0F",
"receiptEmail":null,
"status":"RequiresConfirmation"
}
// Response on iOS
{
"currency":"usd",
"description":"...",
"id":"pm_1I96wnG7gfqYEkPOFrjhO6SK",
"receiptEmail":"",
"status":"RequiresConfirmation",
"stripeId":"pi_1I96woG7gfqYEkPO3r9MhHII"
}
Also, stripeId
is not a good name for the PaymentIntent ID. As per https://stripe.com/docs/js/payment_intents/handle_card_action it would be better to return
{ error: Error; paymentIntent: Stripe.PaymentIntent }
To Reproduce
Steps to reproduce the behavior:
yarn example start
yarn example android
Expected behavior
Same response shape across platforms.
The library should call setAppInfo
upon initialization to identify itself.
You only need to pass name: "stripe-react-native"
, version: "<library version>"
, and url: "https://github.com/stripe/stripe-react-native"
(the partner ID parameter is optional).
Add Google Pay support for Android similar to how Apple Pay is supported for iOS.
https://stripe.com/docs/google-pay
And add a guide similar to https://github.com/stripe/stripe-react-native/blob/master/docs/apple-pay.md
Bindings & docs for https://stripe.com/docs/payments/au-becs-debit/set-up-payment
Is your feature request related to a problem? Please describe.
When creating a PaymentMethod via createPaymentMethod
:
try {
const paymentMethod = await createPaymentMethod(card);
console.log('pm: ', paymentMethod);
} catch (error) {
console.log('error', error);
}
The result on success is:
pm: {"stripeId": "pm_1IBafVAasA93llSpCBoFpbZ1"}
The expected result for the equivalent method in Stripe.js is a PaymentMethod object which you can use to for instance check the card's issuer and country before making a payment. Since there's no getPaymentMethod
method available in stripe-react-native you can only get that information by passing the ID to the server to retrieve the PaymentMethod there, which seems like an unnecessary extra step.
Describe the solution you'd like
Return the full PaymentMethod object instead of an object only containing the ID when calling createPaymentMethod
.
Describe alternatives you've considered
Adding a getPaymentMethod
method is possible, but we shouldn't do that as it would deviate from the API in Stripe.jsgetPaymentMethod
would actually be a security risk, since you could then grab potentially sensitive info like the expiry date and last 4 digits of a card with just a publishable key.
Additional context
See also #46
We'll need a standalone API reference page for the React Native library. We'd like the API reference to be autogenerated using a tool like https://typedoc.org/. Delivery should include a script that generates html (so that we can host it on stripe.dev, similar to http://stripe.dev/stripe-ios )
We'll link to this content from our integration guides. As an example, let's look at the 3DS integration guide you put together. This content should be split between the integration guide and the API reference.
Add support for FPX. We only want to support the Custom integration documented on https://stripe.com/docs/payments/fpx/accept-a-payment#ios-custom-integration . We don't want the React Native library to support Basic Integration, as we are replacing it with a new pre-built UI integration (see #1 )
React Native documentation should not include the content in the red boxes:
Bindings & docs for https://stripe.com/docs/payments/without-card-authentication
This is mostly a docs task, I think. Recommend doing this after #23 .
Bindings & docs for https://stripe.com/docs/payments/bancontact/set-up-payment
Create React Native content for this docs page: https://stripe.com/docs/payments/payment-intents/upgrade-to-handle-actions
We'd like to align the exception/error handling pattern of this SDK to the pattern followed by the fetch
API and https://github.com/stripe/stripe-js.
The pattern is as following:
{objectName?: objectType; error?: StripeError};
Promise<{objectName?: objectType; error?: StripeError}>;
Pseudo code example:
try {
let result = await stripe.confirmPayment('{argument}')
if(result.error) {
// Handle error
} else {
// Handle logic
}
} catch(err) {
// Something fatal happened
}
Prior art:
React Native bindings & docs for this guide: https://stripe.com/docs/payments/alipay/accept-a-payment
Add a guide for Alipay payments handling, including outlining how to handle the deep-linking redirect back to the app. Example: https://stripe.com/docs/payments/alipay/accept-a-payment#ios-redirect
Bindings & docs for this page: https://stripe.com/docs/payments/oxxo/accept-a-payment
Is your feature request related to a problem? Please describe.
As we named library differently a bit than you, we have mismatching names in several places so we should unify them.
Describe the solution you'd like
Adjust every place naming to stripe-react-native
Describe alternatives you've considered
We can stay with react-native-stripe-sdk
, is up to you.
@thorsten-stripe let me know if you either agree with me or not.
Describe the bug
Example app will fail to run due to missing dependencies.
To Reproduce
Following the instructions on a fresh clone of the repo, when you get to the final yarn ios
/yarn android
step you are given the following error:
error: Error: Unable to resolve module `@babel/runtime/helpers/interopRequireDefault` from `../src/hooks/useStripe.tsx`: @babel/runtime/helpers/interopRequireDefault could not be found within the project.
The problem is that the example app gets its copy of stripe-react-native from the parent directory rather than NPM, presumably because the package isn't on NPM yet. You need to run yarn
or npm install
in the root directory to ensure that stripe-react-native has the required dependencies.
Proposed solution
Either add "Run yarn
or npm install
in the root directory" as a step in the instructions or add a check in the yarn ios
/yarn android
build commands that checks to see if node_modules
exists in the parent directory and automatically installs dependencies if needed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.