#surajpatidar
1 messages · Page 1 of 1 (latest)
HI 👋
You would use the Stripe Account header. We document this here: https://stripe.com/docs/api/connected_accounts
stripe.checkout.Session.create(
mode="payment",
line_items=[{"price": '{{PRICE_ID}}', "quantity": 1}],
payment_intent_data={
"application_fee_amount": 123,
"transfer_data": {"destination": '{{CONNECTED_ACCOUNT_ID}}'},
},
success_url="https://example.com/success",
cancel_url="https://example.com/cancel",
)```
like that i use stripe account header
i see doc but it payment_intent and i want in stripe checkout page
That code does not use the Stripe account header
You need to provide the stripe_account top-level parameter
So can you try using that parameter when creating the checkout session?
but in top level how it possible to give stripe account id
i have one more question
in this parameter which id i will pass platform or connected accounts ids
but in top level how it possible to give stripe account id
You have the account ID. It is what you are passing in as the CONNECTED_ACCOUNT_ID
If you are making a request as the Connected Account you pass in the Connected Account ID
Did you read the documentation I provided? It explains this very clearly
yes i read but i have some questions
The text for the first example covers the questions you have shared so far
Here’s an example that shows how to Create a PaymentIntent with your platform’s API secret key and your user’s Account identifier.
What is unclear at this point?
okay i did this after that in checkout session what i pass in tranfer_data destination paramaters
i wnat to implement this things
Collect payments from customers and pay them out to sellers or service providers.```
but it give me error about charge dose not exist error
Can you share the request ID for the AP request that returns the error?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_wu16JOiUJw4HVB
Your code is passing the string "{{CONNECTED_ACCOUNT_ID}}". You need to pass an actual Connected Account ID
stripe.error.InvalidRequestError: Request req_4peND6ys3En5fG: No such charge: 'py_1NONMkE9YLYsLUB7fxHOYYXL'
stripe_price = stripe.Price.create(product=stripe_product.id, unit_amount=int(total * 100), currency="usd",)
session = stripe.checkout.Session.create(
expires_at=int(time.time()) + 1860,
payment_method_types=["card"],
customer=stripe_customer.id,
line_items=[{"price": stripe_price.id, "quantity": 1}],
invoice_creation={
"enabled": True,
},
metadata={
"order_id": order.id,
},
mode="payment",
payment_intent_data={
"application_fee_amount": int(platform_fee)*100,
"transfer_data": {"destination": order.provider.stripe_account.id},
},
success_url=f"{prefix}{settings.HOST_NAME}/order/checkout/success",
cancel_url=f"{prefix}{settings.HOST_NAME}/order/checkout/cancel/",
api_key=settings.STRIPE_TEST_SECRET_KEY,
)
Session.sync_from_stripe_data(session)
# Redirect the user to the Stripe Checkout page
return redirect(session.url)```
What is this? This has nothing to do with the request you shared
this is my actual code and above one error show all time same like that
You are making a request to get a Charge. The Charge does not exist on the Platform account: https://dashboard.stripe.com/test/logs/req_4peND6ys3En5fG
djstripe is a third party package and we can't offer any advice for it
i write this code only for stripe checkout and payment send in connect account but after response it getting error
and on connect account payment show on pending status
okay no problem
so it error not from stripe
The error is coming from stripe
but you are saying your code is not requesting the stripe object
why on connected account show payment pending
What do you mean?
all payment on express account show pending
That's a screen shot. It does not help me
on connect account all payment show pending status why ?
For those questions you will need to talk to Support https://support.stripe.com/?contact=true