#paly

1 messages · Page 1 of 1 (latest)

tall hollyBOT
daring ferry
scarlet oriole
#

req_N3zxWALLX2xNXo?t=1692620440

daring ferry
#

Your Price exists on the Connected account, but the PaymentIntent is created on the Platform. You need to use a Price that exists on the Platform too.

scarlet oriole
#

platform too? didn't understand I have created a product for connect account

daring ferry
#

Yes, if you do only Destination Charges, you only need Prices on your Platform.

scarlet oriole
#

what about the direct charges?

#

I gound this

curl https://api.stripe.com/v1/payment_intents
-u "sk_test_51LWfCbEKi7TmDGM93Jsvjz7H1VrtmZl95zJQm9xmyxpOAywbp1eek5Erl5Ml2fHIvcGP5jL05KesSxWmpmuMNvnl00yXMyNgdW:"
-H "Stripe-Account: {{CONNECTED_ACCOUNT_ID}}"
-d amount=1000
-d currency=usd
-d "automatic_payment_methods[enabled]"=true
-d application_fee_amount=123

idea is to create a checkout session

daring ferry
#

Then you need a Price on the Connected Account.

The principle is:

  1. Direct charge is created directly on the Connected account, so all objects exist on the Connected account: Prices, Subscriptions, Customers, Charges, etc.
  2. Destination charge is created on the Platform account, and then it transfers just the funds to the Connected account. All objects exist on the Platform account: Prices, Subscriptions, Customers, Charges, Transfers etc.
scarlet oriole
#

Oh I would like to go with the 1st option..want to do everything on connected account. So what should I do here?

daring ferry
#

Use the -H "Stripe-Account: {{CONNECTED_ACCOUNT_ID}}"

#

It allows your Platform to directly control your Connected account, create the Checkout Session, etc.

scarlet oriole
#

just wondering while using "stripe-account" in header I won't be need of -d "payment_intent_data[transferdata][destination]=acct" \

daring ferry
#

Yes, you don't need this. The payment is already on the Connected Account, you don't need to transfer it anywhere.

scarlet oriole
#

strange, When I ran this

curl https://api.stripe.com/v1/checkout/sessions \ -u sk_test_51LWfCbEKi7TmDGM93Jsvjz7H1VrtmZl95zJQm9xmyxpOAywbp1eek5Erl5Ml2fHIvcGP5jL05KesSxWmpmuMNvnl00yXMyNgdW: \
-H
"Stripe-Account: acct_1NdvZzBzcSw7JdYb" \ -d "payment_method_types[0]=ideal" \ -d "payment_method_types[1]=card" \ -d "line_items[0][price][currency]=eur" \ -d "line_items[0][price]"=price_1NhWtZBzcSw7JdYbEdfd69QK \ -d "line_items[0][quantity]=1" \ -d "payment_intent_data[application_fee_amount]=100" \ -d "mode=payment" \ -d "success_url=https://example.com/success" \ -d "cancel_url=https://example.com/cancel"

I am getting multiple checkout session link

daring ferry
#

What do you mean by this?

scarlet oriole
#

I ran the above CURL and I got a big response which has list of data onject and each object has one checkout session url .

"data": [{
"id": "cs_test_a1t3S2YVeLy2CESm79hanF7kdY7C9mNC05XjbBfnKCCBtVrscRwT6Go4pG"
}.{
"id": "cs_test_a1umjW3sBFMml3DVD4cvqQB0aayVuyH6MJ20Bgg2LsxTKd1TEhN6vgVNh6"}]

daring ferry
#

Oh, you ran a GET method, not POST. You basically listed the existing Sessions

scarlet oriole
#

but this is a post request?

curl https://api.stripe.com/v1/checkout/sessions \ -u sk_test_51LWfCbEKi7TmDGM93Jsvjz7H1VrtmZl95zJQm9xmyxpOAywbp1eek5Erl5Ml2fHIvcGP5jL05KesSxWmpmuMNvnl00yXMyNgdW:
-H
"Stripe-Account: acct_1NdvZzBzcSw7JdYb" \ -d "payment_method_types[0]=ideal" \ -d "payment_method_types[1]=card" \ -d "line_items[0][price][currency]=eur" \ -d "line_items[0][price]"=price_1NhWtZBzcSw7JdYbEdfd69QK \ -d "line_items[0][quantity]=1" \ -d "payment_intent_data[application_fee_amount]=100" \ -d "mode=payment" \ -d "success_url=https://example.com/success" \ -d "cancel_url=https://example.com/cancel"

daring ferry
#

Try specifying the -X POST

tall hollyBOT