#Erik Magnusson

1 messages · Page 1 of 1 (latest)

oak deltaBOT
dusk pagoda
#

You need your platform's publishable key in addition to the stripe-account for this

dry scroll
#

Ok. Did not know that.

For the react native tab it says that I need to use the stripeAccountId when I initiate the StripeProvider. I have a for a lot of different connected accounts. Is it possible to change this programatically at runtime?

#

So no I've tried to:

  1. initiate the StripeProvider using a connected account id, and my platforms publishable key. (the react native example of your link)
  2. setting up a a payment intent on the server to initiate the payment sheet in the app.Using this setup:

`
const stripe = require('stripe')('sk_test_4QHS9UR02FMGKPqdjElznDRI');

const paymentIntent = await stripe.paymentIntents.create(
{amount: 1000, currency: 'usd', automatic_payment_methods: {enabled: true}},
{stripeAccount: '{{CONNECTED_ACCOUNT_ID}}'}
);
`

#

Still getting:
"message": "Ingen sådan customer: 'cus_NX2aWK2qer2PzU'", "stripeErrorCode": "resource_missing"

#

Oh wait.

#

Now it says customer 🙂

dusk pagoda
#

^^ yeah that probably means you're using a customer that's on the platform instead of the connected account

dry scroll
#

Some questions.
For each time I want to make a direct charge.
Do i have first have to create a user and a payment method on the connected account?
The payment sheet seems to handle the creating of the payment method if it does not exists.

And if that's the case. I the same customer wants to but something from the same connected account again. Do I have to store the user that exists on the connected account to use it for the next charge?

#

Or can I reference the customer in my platform to that of the connected account? Otherwise it's a lot of logic just to keep track of user that should exist on connected accounts

oak deltaBOT
thin eagle
#

hey there, just reading all of the above, give me a few minutes

dry scroll
#

Hey, just to fill in.
I'm now created a customer on the connected platform

#

But when i try to create the intent I get:
Error: No such customer: 'cus_NX3agXUQPWcUzu'

thin eagle
#

Yes, if you're using direct charges, the payment method needs to be on the connected account, an the customer if used

dry scroll
#

Yes I've tried this. But there's multiple questions going on now:

  1. Is there a reason to creata a user on my platform I all I'm gonna do this use direct charges and then take platform cut?
  2. If I have to create customers on the connected account, do I have to store them indivudially myself so that I can reference them in following direct charges between the same user and connected platform. Or can I just opt to create a new user everytime I create an intent, even if the user already exists on the connected account.
  3. When creating an intent for a direct charge, I've now initiated the StripeProvider as instructed by the docs(using the connect account id and my platforms pk), on the server i initiate the stripe sdk with my pk. I create a user on the connected platform and then try to create the intent for a direct charge. In the dashboard I can see that the user is created, but when tyring to create the intent it says that there are no such customers
thin eagle
#

1/ if this is destined for single connected account usage, no. you can create it directly on the connected account if you like.
2/ either works. You can attach the cloned PM to a customer on the connected account then re-use it, or you can re-clone it each time. If you expect re-use, customer attachment is probably tidier.
3/ Do you have an example of this? There's likely a mismatch in account contexts.

dry scroll
#

I have a req id: req_WslQX4A89wgVGw

thin eagle
#

Yes, that customer exists on one of your connected accounts, not your platform

#

You can only use it with direct charges on that account

#

acct_1..yAW

dry scroll
#

I'm creating a direct charge payment intent for the same connected account I create the user on

#

Or, I'm trying to

#

Ok, I got it to work. Had it initiate both the react native sdk and the server sdk with the connected account accounts id

thin eagle
#

Yep, that's right

#

The example request was on your platform, not using a connected account context

dry scroll
#

Another question.

How do i go about using direct charge for subscriptions?

#

And, is there an easy way to fetch all payment made to all connected accounts it has made direct payments to by an email ref?

thin eagle
#

You create the subscription using the account header, then confirm the invoice payment intent using Stripe.js with your publishable key & the connected account just as with a non-invoice payment intent

thin eagle
dry scroll
#

Great. Thanks for your help!

thin eagle
#

NP!