#surajpatidar

1 messages · Page 1 of 1 (latest)

drowsy raptorBOT
stiff radish
gaunt pumice
#
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

stiff radish
#

That code does not use the Stripe account header

#

You need to provide the stripe_account top-level parameter

gaunt pumice
#

like stripe api

#

right

stiff radish
#

So can you try using that parameter when creating the checkout session?

gaunt pumice
#

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

stiff radish
#

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

gaunt pumice
#

yes i read but i have some questions

stiff radish
#

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?

gaunt pumice
#

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

stiff radish
stiff radish
#

Your code is passing the string "{{CONNECTED_ACCOUNT_ID}}". You need to pass an actual Connected Account ID

gaunt pumice
#

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)```
stiff radish
#

What is this? This has nothing to do with the request you shared

gaunt pumice
#

this is my actual code and above one error show all time same like that

stiff radish
gaunt pumice
#

but i am not getting charge

#

djstripe getting

stiff radish
#

djstripe is a third party package and we can't offer any advice for it

gaunt pumice
#

and on connect account payment show on pending status

gaunt pumice
#

so it error not from stripe

stiff radish
#

The error is coming from stripe

#

but you are saying your code is not requesting the stripe object

gaunt pumice
#

why on connected account show payment pending

stiff radish
#

What do you mean?

gaunt pumice
#

all payment on express account show pending

stiff radish
#

That's a screen shot. It does not help me

gaunt pumice
#

on connect account all payment show pending status why ?

stiff radish