#stripe_connect_platform - Invalid Checkout
1 messages ยท Page 1 of 1 (latest)
Hi
May I send you the acct_id of a connected account and the id of the CheckoutSession and can you tell me why the ID is invalid?
We are listening for events that were created by not-us. ๐ We used to only listen for events created by us but we are also listening for events on connected accounts created by non-us.
I am viewing as....in the connected account. Should that ID appear in search? I am looking at the actual received parameters logged and that is definitely the account and the id so now sure why it cannot be retrieved.
"id": "cs_live_a1TpNhxGOfiCvCB6Qsawif2J0D8nhnYHab4A9FrvtgeAF3BKgUiAyNpN90",
So we get that event and try to retrieve that and are getting an error. Lots of these errors suddenly
Stripe::InvalidRequestError: Invalid checkout.session id: cs_live_a10mTbn7a4o1dkE7bTyjbOutw6BbPsmZMKFvhLbqlc6sTdU53pmVHKgGzo
One of 112 errors in the last 24 hours. ๐ฆ
Another one 24 seconds ago:
Invalid checkout.session id: cs_live_a10mTbn7a4o1dkE7bTyjbOutw6BbPsmZMKFvhLbqlc6sTdU53pmVHKgGzo
Do you have the request ID for the request that failed?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
we pass in the account_id
I am always totally confused by this part
I do NOT see the error in Stripe
under Developer Logs
very few errors in there
I have this app on Heroku and we see these 100+ errors in Airbrake error monitoring
With the params received and the code that errored but no Stripe req id
Can you not just find the error from the logs with that ID?
I can see the creation request.
The issue is that we were sent params
But nope, not a failed retrieval
Then we make the API call to find the sesssion
And it fails
As if the ID does not exist
But it clearly exists
?
There is a session with that id no?
So why would an API call to find the session fail?
It exists on account acct_1LDWZiCYLnAHgGoG. I need to see your request to determine if you made the request as that account
Got it. Let me just make the request manually
checkout_session_params = Stripe::Checkout::Session.retrieve({ id: checkout_session_id, expand: ['line_items.data.price']}, :stripe_account => site.stripe_user_id)
so stripe_user_id would need to be the account above
right
hmmm
ok, so i made the API call in the CLI and get back the correct result
OK, i think i see the issue.
Is there an example of a rescue block that logs the Stripe request ID
a rescue block
I don't know what you are referring to here
begin
rescue Stripe::Error => e
#log request_id in case we have to talk with Stripe and they ask for it
end
e.request?
I have not seen any code like that documented.
?
Does e.message log the request id?
that
ruby
def example_function(params)
begin
Stripe::PaymentIntent.create(params)
rescue Stripe::CardError => e
puts "A payment error occurred: #{e.error.message}"
rescue Stripe::InvalidRequestError => e
puts "An invalid request occurred."
rescue Stripe::StripeError => e
puts "Another problem occurred, maybe unrelated to Stripe."
else
puts "No error."
end
end
For the request ID
So how can i possibly tell you the request id?
If it is not logged in your error handling nor in our account?
There is no Stripe error handling that logs the request id?
It is logged on the account on which the request occurs.
Given the errors you are encountering I suspect you are making the request on the incorrect account