capacitor-community / stripe

Stripe Mobile SDK wrapper for Capacitor
MIT License
185 stars 74 forks source link

Allow a Stripe Connect account id to be passed #70

Closed madmacc closed 2 years ago

madmacc commented 3 years ago

Currently when creating initiating the plugin I pass the Stripe public key.

import { Plugins } from '@capacitor/core';
const { Stripe } = Plugins;
...
await Stripe.setPublishableKey('pk_test_....');

This works fine.

However I have many customer Stripe accounts connected to my platform Stripe account using Stripe connect. I have the connectedAccountId for these accounts but not the public Stripe key stored. Is it possible to initialize the Stripe plugin with my account public key and a stripe connectedAccountId e.g. 'acct_...'? The same as the Stripe JS SDK does:

 this.stripe = Stripe(environment.stripeMyPublicKey, {
          stripeAccount: connectedStripeAccountId,
        });

Alternatively I guess I could store the public stripe keys for each of the connected accounts but I believe this means I would be placing the charge directly to the connected account and I want to take an application_fee which goes to my platform stripe account. I am already doing this with the Stripe API without apple pay.

Thanks for the awesome work on this Plugin!

rdlabo commented 2 years ago

Thanks for issue! Today this plugin of v3 is released. This not compatible with v1. All APIs have been revamped. So I will close this issue. If you still have the same problem, please create a new Issue. Thank you.

madmacc commented 2 years ago

@rdlabo It looks like you have added this in v3 to support a Stripe Connect account. But unfortunately v3 does not support Apple Pay yet.
Any timeline for Apple Pay support in V3?

export interface StripeInitializationOptions {
    publishableKey: string;
    stripeAccount?: string;
}