From 1a5a5cc4982af1453da89aba8d3e0fe1586e596a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Perdig=C3=A3o?= Date: Thu, 5 Sep 2019 14:49:26 +0100 Subject: [PATCH] Fix incorrect method access. Add usage and code to example app --- .../src/main/java/com/gettipsi/stripe/StripeModule.java | 2 +- example/scripts/configure.sh | 1 + example/src/Root.js | 2 ++ website/docs-md/usage.md | 9 +++++++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/com/gettipsi/stripe/StripeModule.java b/android/src/main/java/com/gettipsi/stripe/StripeModule.java index 9605b7d64..a0cab0b28 100644 --- a/android/src/main/java/com/gettipsi/stripe/StripeModule.java +++ b/android/src/main/java/com/gettipsi/stripe/StripeModule.java @@ -145,7 +145,7 @@ public void canMakeAndroidPayPayments(final Promise promise) { @ReactMethod public void setStripeAccount(final String stripeAccount) { - getPayFlow().setStripeAccount(stripeAccount); + mStripe.setStripeAccount(stripeAccount); } @ReactMethod diff --git a/example/scripts/configure.sh b/example/scripts/configure.sh index 44068b9d8..ffd928ca2 100755 --- a/example/scripts/configure.sh +++ b/example/scripts/configure.sh @@ -2,4 +2,5 @@ sed -i.bak 's@@'"$PUBLISHABLE_KEY"'@' src/Root.js sed -i.bak 's@@'"$MERCHANT_ID"'@' src/Root.js +sed -i.bak 's@@'"$STRIPE_ACCOUNT"'@' src/Root.js rm -rf src/Root.js.bak diff --git a/example/src/Root.js b/example/src/Root.js index fc277e3a7..30f151240 100644 --- a/example/src/Root.js +++ b/example/src/Root.js @@ -19,6 +19,8 @@ stripe.setOptions({ androidPayMode: 'test', }) +stripe.setStripeAccount('') + export default class Root extends PureComponent { state = { index: 0, diff --git a/website/docs-md/usage.md b/website/docs-md/usage.md index 41d04a24c..5f65f516d 100644 --- a/website/docs-md/usage.md +++ b/website/docs-md/usage.md @@ -23,3 +23,12 @@ stripe.setOptions({ `androidPayMode` _String_ (Android only) - Corresponds to [WALLET_ENVIRONMENT](https://developers.google.com/android/reference/com/google/android/gms/wallet/WalletConstants ). Can be one of: `test|production`. + + +### Usage with Stripe Connect + +If you're using Connect and need to set a `stripeAccount` do the following: + +```js +stripe.setStripeAccount('') +```