stripe / stripe-terminal-react-native

React Native SDK for Stripe Terminal
https://stripe.com/docs/terminal/payments/setup-integration?terminal-sdk-platform=react-native
MIT License
105 stars 50 forks source link

Support `Stripe-Account` (connect account) #647

Closed ALiangLiang closed 5 months ago

ALiangLiang commented 5 months ago

Is your feature request related to a problem? Please describe.

I want my terminal and payment to be set up under the customer's connect accounts. But this SDK doesn't seem to support it.

Describe the solution you'd like

Add a param stripeAccountId on every functions.

Describe alternatives you've considered

Or add a setStripeAccountId function to set it globally

Additional context

We use Stripe Reader M2

erick-repo commented 5 months ago

I was able to achieve this by using the onBehalfOf field while creating the payment intent.

    const { paymentIntent, error } = await createPaymentIntent({
          amount: invoice_total_milicents,
          currency: "usd",
          onBehalfOf: stripe_account_id,
          transferDataDestination: stripe_account_id,
          applicationFeeAmount: platform_fee_milicents,
        });
ALiangLiang commented 5 months ago

I was able to achieve this by using the onBehalfOf field while creating the payment intent.

    const { paymentIntent, error } = await createPaymentIntent({
          amount: invoice_total_milicents,
          currency: "usd",
          onBehalfOf: stripe_account_id,
          transferDataDestination: stripe_account_id,
          applicationFeeAmount: platform_fee_milicents,
        });

Is it used for direct charges? I only find this in destination charges and separate charges

billfinn-stripe commented 5 months ago

Please see https://docs.stripe.com/terminal/features/connect#direct-payment-intents-client-side.

ALiangLiang commented 5 months ago

Please see https://docs.stripe.com/terminal/features/connect#direct-payment-intents-client-side.

Thanks for your reminder. We solved the issue.

The iOS, Android, and React Native SDKs create the PaymentIntent on the same connected account the ConnectionToken belongs to.