#stripe_dev-connect

1 messages · Page 1 of 1 (latest)

quaint elm
craggy drum
#

I am already looking at this article, but am still not sure how to complete the last step.

quaint elm
#

Hi, in above guide we are using the PaymentIntent API. What do you mean by PaymentMethod API?

craggy drum
#

This is the header on top of that section

#

So in the past I have used the customer id to create a charge on the connected account. Can I do it the same way if I have a cloned token?

#

I don't have a Payment Method Id, like it shows in the code

#

Any ideas @quaint elm ?

quaint elm
#

Sure, looking into this

craggy drum
#

Thanks

quaint elm
#

So in the past I have used the customer id to create a charge on the connected account. Can I do it the same way if I have a cloned token?
When you have a cloned token, you would need to create a Customer on your Connected Account first (according to the 3rd step in the guide), after that you can you that Customer Id as you have used before

#

The doc mentioned that you should have a PaymentMethod ID returned

Then, use the customer ID (e.g., cus_xxx) and the payment method ID (e.g., card_yyy) returned by the customers.create call to charge the customer.

craggy drum
#

Ok, yes I attach the token to the customer on the connected account and get a new customer. I then use the id of the new customer to create a charge

quaint elm
#

yes that should work

#

How are you creating Charge btw?

craggy drum
#

Good question, I am still using the payment intent. I should probably using something else

#

May be a ChargeService()?

quaint elm
#

You are using the PaymentIntentAPI?

craggy drum
#

Well I copied the code from the doc. But now that I am NOT using payment method id. I am thinking it will not work, so is there something else that I can use to create a charge?

#

This is what it looks like, would this work?

#

I added comments so you can follow it better

#

@quaint elm you think this would work?

quaint elm
#

Sorry, I am a bit swamped by other asks by now, will get back later!

craggy drum
#

ok, thanks. Let me know what you think after you have looked at the code

quaint elm
#

Okie, after you created a Customer you should have the Customer Id, alongside with a default_source. You then will need to use that Customer Id and Source Id to create a Charge like you are doing