#youmin-checkout
1 messages ยท Page 1 of 1 (latest)
Hi! Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_TrtUqj88X3CqDt
Thanks! And can you share the code you are using for this request? I'm not sure to understand what you are doing.
Note that this Checkout Session doesn't exist cs_test_a1uyeu6USI3dmpZj5j5NwZbnP2vvc1oelepVuygopRGWSwIqLzVjQSjdHS
Hi I just copied the curl command from your dev page
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Same error when I use fresh checkout session id
Got it. In the request you shared (req_TrtUqj88X3CqDt) you are trying to access the ID cs_test_a1uyeu6USI3dmpZj5j5NwZbnP2vvc1oelepVuygopRGWSwIqLzVjQSjdHS. Where did you find this ID? It doesn't exist, so there might be a typo or an issue when you copy-pasted it.
How about this one? req_fflSw6a7ZxwaoA
I use this from the screenshot cs_test_a1GrTjf2UV4DV7DorEIbqTfUk7JbptcF7MC3zEasEyOU7eq8RDUWfrI4PK
that id is from your dev doc
this
How about this one? req_fflSw6a7ZxwaoA
This checkout session ID exists, but it doesn't belong to the account making the API call. Are you a platform account trying to retrieve an object from a connected account?
yes We use stripe connect
I assumed that platform's key should be available? It is same key when I created the session
If you are a platform account trying to access an object on a connected account, you need to use the Stripe-Account header as explained here: https://stripe.com/docs/connect/authentication
const stripe = require('stripe')('{{PLATFORM_SECRET_KEY}}');
const customer = await stripe.customers.create(
{email: 'person@example.edu'},
{stripeAccount: '{{CONNECTED_STRIPE_ACCOUNT_ID}}'}
);
// Fetching an account just needs the ID as a parameter
const account = await stripe.accounts.retrieve('{{CONNECTED_STRIPE_ACCOUNT_ID}}');
In this node example, where should I put the header?
I tried this code and it returned the same error
const stripe = require('stripe')('...');
const session = await stripe.checkout.sessions.retrieve('cs_test_a1HtJADib84Som3hlFhgGTkCeTe8fLJLLVAXDy3zzsoFtaQyc5beCbekNf'
);
Hi there ๐ jumping in for soma. You would pass it in a hash after the params for the request as shown in the example. So you're request would look like:
const session = await stripe.checkout.sessions.retrieve(
'cs_test_a1HtJADib84Som3hlFhgGTkCeTe8fLJLLVAXDy3zzsoFtaQyc5beCbekNf',
{stripeAccount: '{{CONNECTED_STRIPE_ACCOUNT_ID}}'}
);```
Thanks - let me try. it would be great you put this somewhere here https://stripe.com/docs/connect/creating-a-payments-page
Hm, I'm seeing that header in the code examples that are on that page. Did you toggle the doc to "Direct charges"?
Ah, just found it in the creation logic. I meant in fulfilment logic
Instead of using Webhook, I want to retrieve session status in success_url and show the payment status directly. Does this make sense?
Like the approach shown here?
https://stripe.com/docs/payments/checkout/custom-success-page
Yes
Awesome! Feel free to let us know if you run into problems implementing that.