#stripe_connect_platform - Invalid Checkout

1 messages ยท Page 1 of 1 (latest)

loud garden
#

Hi ๐Ÿ‘‹

lucid forge
#

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.

loud garden
#

Sure, that'll help

#

You don't need to share all the rest.

#

The id is fine

lucid forge
#

"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

loud garden
#

Do you have the request ID for the request that failed?

lucid forge
#

So we are not logging request IDs

#

Can i find it in my Stripe account?

loud garden
lucid forge
#

Or in the account of the connected account?

#

It is on our platform account yes?

loud garden
#

Depends how you made the request.

#

Did you use a Stripe Account header?

lucid forge
#

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?

loud garden
#

I can see the creation request.

lucid forge
#

The issue is that we were sent params

loud garden
#

But nope, not a failed retrieval

lucid forge
#

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?

loud garden
#

It exists on account acct_1LDWZiCYLnAHgGoG. I need to see your request to determine if you made the request as that account

lucid forge
#

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)

loud garden
#

so stripe_user_id would need to be the account above

lucid forge
#

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

loud garden
#

a rescue block
I don't know what you are referring to here

lucid forge
#

begin
rescue Stripe::Error => e
#log request_id in case we have to talk with Stripe and they ask for it
end

#

e.request?

loud garden
#

I have not seen any code like that documented.

lucid forge
#

?

#

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

loud garden
#

For the request ID

lucid forge
#

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?

loud garden
#

It is logged on the account on which the request occurs.

lucid forge
#

that is strnage

#

not in any way that i can locate it

#

very strnage

loud garden
#

Given the errors you are encountering I suspect you are making the request on the incorrect account

lucid forge
#

i see 100+ errors in the last 24 hours but on;y a few in the account

#

ok, i need to take a break