Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Expose setStripeAccount to JS (Enable Stripe Connect accounts)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepcg committed Sep 5, 2019
1 parent 7f7a1f0 commit ee98528
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions android/src/main/java/com/gettipsi/stripe/StripeModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ public void canMakeAndroidPayPayments(final Promise promise) {
getPayFlow().deviceSupportsAndroidPay(true, promise);
}

@ReactMethod
public void setStripeAccount(final String stripeAccount) {
getPayFlow().setStripeAccount(stripeAccount);
}

@ReactMethod
public void createTokenWithCard(final ReadableMap cardData, final Promise promise) {
try {
Expand Down
4 changes: 4 additions & 0 deletions ios/TPSStripe/TPSStripeManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ - (NSDictionary *)constantsToExport
[Stripe setDefaultPublishableKey:publishableKey];
}

RCT_EXPORT_METHOD(setStripeAccount:(NSString *)stripeAccount) {
[[STPAPIClient sharedClient] setStripeAccount:stripeAccount];
}

RCT_EXPORT_METHOD(deviceSupportsApplePay:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject) {
resolve(@([PKPaymentAuthorizationViewController canMakePayments]));
Expand Down
4 changes: 4 additions & 0 deletions src/Stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ class Stripe {
return StripeModule.init(options, errorCodes)
}

setStripeAccount = (stripeAccount) => (
StripeModule.setStripeAccount(stripeAccount)
)

// @deprecated use deviceSupportsNativePay
deviceSupportsAndroidPay = () => (
StripeModule.deviceSupportsAndroidPay()
Expand Down

0 comments on commit ee98528

Please sign in to comment.