#BrianC-testmode-connect

1 messages Β· Page 1 of 1 (latest)

shut oak
#

Hi there πŸ‘‹ What is the webhook endpoint failure error showing in your Dashboard?

modern jay
#

We're not even seeing that a webhook is being sent. I'll go to the transaction and check though'

#

Can you clarify the first question? Why do we need two variations of test modes?

#

The "error" is "pending webhook response" in the transaction of the "real"coneectd aop in test mode

shut oak
#

I can't really speak to the "why" of the problem. Mostly it comes from a product team that likely did user-outreach to figure out if there was a use-case for allowing both test and live transactions on a live-mode Connect account

shut oak
modern jay
#

OK. But what are the use-case scenarios? It used to work with Connect accounts being created in test mode and then webhooks to those apps would be thorugh the test master account. It looks like now you can also have a live master and connected account, use the live connected account butsend charges in test mode and it will show up in the live connect acocunt's transactions when the connect account is switched to test mode.

#

Veruy confusing as now we are getting webhooks sent to the ether.

#

Which is it? Which do we use/

#

?

modern jay
#

Where is the webhook for this session being sent? cs_test_a1DeaUjXpjZUQYICRn6ZCFlQqo2rdC4WjhYSVmWT6s3iywHUp829zTFO6a

spring leaf
#

Hello, the server is getting pretty busy so I am taking over for two-shoes here.

#

Checking in to that Checkout Session specifically. Is your other main question is about why your connect webhook is getting test events in live mode?

modern jay
#

No. Please read the question again. It's about why there are two "test modes" and why to use each scenario. It;'s wastning a lot of deve time on this end since we can't get webhook responses from our connected accounts to work in test mode. Which scenario shoud we be usiung?

spring leaf
#

I'm not sure what you mean by two test modes. Can you clarify where you are seeing each test mode here?

modern jay
#

There are two sceanrios for testing connecged accounts.

#

1: create a "test" connexted acount while in test mode of the master account

#

2: using a "real" connected account in a real master account, send transactiosn in test mode from checkout and they wil be listed in the "test mode" transactiuons of a real connected account

spring leaf
modern jay
#

OK. That helps.

spring leaf
#

You can create and connect an account either way to test in test mode. They are the same test mode, the difference is whether those accounts would also be connected in live mode

modern jay
#

If they are the same, why don't the connected accounts which were created attched tot he real master account show up in test mode while in test mode for the real master account? and why? What is the use case for each of these?

modern jay
spring leaf
#

Do you have an example ID of an account that is attached to your master account that is now showing up in test mode?

modern jay
#

do you mean "is not" showing up in test mode?

#

yes

spring leaf
#

Correct, "is not"

modern jay
#

acct_1KZQ32QSv5bgTx2G

spring leaf
#

Thank you for the account ID, checking in to it

#

And what is your master account ID?

modern jay
spring leaf
#

I actually don't know if there is a good way to look that up in the Dashboard. In your case it was easier to look at each webhook endpoint and see what events each was listening for

modern jay
#

You folks need to add that. We still are not receiving the webhooks we are expecting. Just tested it again. We have no easy way to now where the webhook request is being sent.

spring leaf
#

Can you send me the ID of this newest Checkout Session?

modern jay
#

cs_test_a1wuTl7zwOn5syWZnU1A64tq2A8OnOKAycr1NZcFnbvG1DKmAY52NCvyRK

spring leaf
#

Checking in to it...

modern jay
#

i just went thourgh all of the logs for all endpoints test and live and cannot find that transacation πŸ™‚

spring leaf
#

Okay, I see why you are not getting the event for this. Checkout-wise only the checkout.session.completed event is being sent out for these sessions and your webhook endpoint does not listen for them.

modern jay
#

"enabled_events": [ "checkout.session.async_payment_failed", "checkout.session.async_payment_succeeded", "checkout.session.completed", "checkout.session.expired", "payment_intent.canceled", "payment_intent.created", "payment_intent.succeeded", "payment_intent.payment_failed", "payment_intent.amount_capturable_updated", "payment_intent.partially_funded", "payment_intent.processing", "payment_intent.requires_action"

spring leaf
#

Trying to think of how you can check for these events as they are happening on Express accounts.

modern jay
#

This endpoint is configured to receive it

spring leaf
#

Is there a reason you are doing direct charges on express accounts? Typically we reccommend against direct charges with Express as they can make refunds and other flows difficult

modern jay
#

That doesn't have anything to do with what we are talking about though. There is a reason and it is trusted clients. which Express connect account are you referring to specifically?

#

I need to figure out this mess of test accounts and test our webhooks I';ve psnet days on this now.

spring leaf
#

Correct, not directly related to the webhook issue. Just thought it was worth bringing up to avoid you potential pain in the future.

#

Interesting, I do see that that endpoint was updated to include that event type shortly before the event was sent out

#

Checking in to what may have happened here

modern jay
#

Two endpoints are set up to receive checkout.session.complered

#

neither endpoint shows that transaction in the logs

#

wehre did it go?

spring leaf
#

Ah okay. So this is a place where you will want to connect the accounts in test mode as well. If the accounts are only connected in Live mode, then test events will only go to the Live mode Connect endpoints on the Platform. If you connect in Test mode, the test mode events will start going to the platforms Test Connect endpoints

modern jay
#

That is the question I started with. There are two scenarios. Extremely confusing and seeminglh not documented. Where did the request I last sent you go?

#

Whcih endpoiuunt?

spring leaf
#

That area of our documentation can definitely be clearer on how the connections affect the events

modern jay
#

(i'm not drinking BTW). just typing too fase

#

t

spring leaf
#

Lol me neither despite my typos

modern jay
#

There is no documentation on it.

#

That doesn;t matter now though

spring leaf
#

As far as I can tell, the event for that session did not go to any of your webhook endpoints

modern jay
#

where did the request go? whcih endpoint? I need to know that

#

Exactly. Where did it go then? and why?

spring leaf
#

The account you created the Session on is only connected to your platform in Live mode and the Platform only has Test mode endpoints that are subscribed to that event type

#

You either need a live mode endpoint on the platform account, that will receive live and test events from accounts connected to it in live mode

modern jay
#

Mak3s no sense whatsoever. What is the point of test mode for the connecte live endpoint?

spring leaf
#

Or you need to connect the platform and connected account in Test mode, thus enabling the test events to be received by the test mode endpoints

#

It is part of supporting legacy behavior in our system

modern jay
#

What are the scenarios? use cases?

spring leaf
modern jay
#

Ah!! legacy support. Not clear at all. I have been using this API for years and all of a sudden test mode showed up in connectd ive accounts.

#

Why on eath would one send a test event to a live endpoint?

#

Are you telling me that the test events we sent today (the one we sent you) went to a live endpoint?

spring leaf
#

When Connect was first released there were only live mode connections so this was part of allowing test mode connection for then.

modern jay
#

What are the use cases for each scenario?

spring leaf
#

These events did not go to any live mode endpoints. They would have if those live mode endpoints were subscribed to these event types though.

modern jay
#

We need to be this crystal clear.

modern jay
#

So test charges sent to the connect account (live connect account) are listed in test mode but the webhooks are sent to live endpoints, not test endpoints?

#

What is the purpose of that?

spring leaf
#

Basically, the scenarios are what endpoints you want to test these events on. In your scenario, you probably just want to connect in test mode, that way only test mode events are sent to the platform and they only go to the test mode endpoints

modern jay
#

Is this clearly laid out somehwere where we can study it? You guys bascially created a mine field. Sorry. Np other way to sayt it. So incredibley easy to corrupt a live DB and post test purchaes to reports as live purchases.

#

terrible

#

We need someplace to really study this and know what the consequences are for each scenario

#

in order to not create a disaster

#

Also. Silently failining endpoints with no way to trace it. really?

#

You guys styarted out so strong. turning into spaghetti :).

spring leaf
#

This behavior boils down to:

  • If you have a live mode connection, the test and live events will go to the live Connect endpoints on the platform account.
  • If there is a test mode connection, the test mode events go to the test Connect endpoints on the platform.
  • If there is a test mode connection and a live mode connection, both of the above apply. Test and live events go to the live Connect endpoints and Test events go to the test Connect endpoints.
modern jay
#

Where does Live master account/live connect acount sending purchases using test keys fall into? It seems to be a hybrid of master/test connect/live and test)?

spring leaf
#

In that case, because you have a live connection. We are in scenario one that I laid out

If you have a live mode connection, the test and live events will go to the live Connect endpoints on the platform account.

#

I'm trying to see how you can get greater visibility in to these events given your Express setup.

modern jay
#

it seems like using hte test api keys automatically recognizes test mode of the master account AND test mode of the connect account but the webhook goes to the live webhooks. Correct?

spring leaf
#

Correct, test API keys will generate objects/events in test mode. Because of your live mode connection, the test events will go to the live webhook endpoints.

modern jay
#

Can you clarify?

spring leaf
#

Also just as a warning, I have to step out soon but my colleague Snufkin will be taking over to help you out with this

#

Clarify what?

meager pulsar
#

Hi πŸ‘‹

modern jay
#

If we are using a test key aren't we in test mode for the master account?

modern jay
meager pulsar
#

If the platform is using Test API keys you will only receive test mode events from the connected accounts

modern jay
#

but the webhooks events are sent to live endpoints not test endpoints. That is what we discovered today

#

correct?

#

the test mode events are sent to the live endpoints in that scenario

meager pulsar
#

Live mode endpoints receive only live mode events from your account but both live and test from Connect Accounts

modern jay
#

not ture

#

true

meager pulsar
#

Do you have an event ID that was delivered where you did not expect?

modern jay
#

Please read the thread.

spring leaf
#

About to step out but basically they have only have a live mode connection to the account they are creating Checkout Sessions on but only have test mode endpoints on their platform. So they have Checkout events like this one evt_1L355oQSv5bgTx2Gi8A8QVVq but they aren't going to any endpoints.

modern jay
meager pulsar
#

It wasn't sent to any

modern jay
#

The error is "waiting for webhook to respond" and no way to know what endpoint (or non-endpont). So no way to know it wasn't sent to any.

#

That's not the issue though. It's the confusing test modes and the possbility of test transactiosn being postd to live endpoints/ We are getting cklarity now on how this is set up and how the legacy testing is interferring with our dev

meager pulsar
#

Just to close that loop

modern jay
#

I don't know what that event is. not showing up in a search on our DB

meager pulsar
#

It's associated with this Express account: acct_1KZQ32QSv5bgTx2G

modern jay
#

Either way, the takeawy from that is that test charges using the test API key - prebuilt checkout in test mode- show up on test mode of the connected acocunt but the webhook events are sent to the live endpoints. We do not have any live endpoints that receive those events currently (luckily) so it silently failed, Is this correct?

meager pulsar
#

The event @spring leaf provided was a live event. However, both Live & Test events from Connect Accounts will hit your Live mode Connect Endpoint. For that reason we recommend applying a filter to only take action on events where event.livemode = true

modern jay
#

When you say Live Event, what exactluy does that mean? We used test API keys and the checklout clearly said testmode

#

Where can we see a clear breakdown of the differences between the legacy test mode and the currecnt one that seems to send test (or all ) events to live endpoints? This is what is potentially disastrous for us.

#

Have been developing with this API for manhy years.

#

Totalluy confusing now.

#

usse cases for each or at least a place where we can see the potential caveats

#

Starting with

#

Either way, the takeawy from that is that test charges using the test API key - prebuilt checkout in test mode- show up on test mode of the connected acocunt but the webhook events are sent to the live endpoints. We do not have any live endpoints that receive those events currently (luckily) so it silently failed, Is this correct?

#

Is this correct?

meager pulsar
#

If the Checkout Session occurs on a Connect Account and you are using Test API keys, that event will still hit the live webhook endpoint for the platform

#

If you are listening for them

modern jay
#

Where is the cdocumentation for this

#

?

#

Also, do you happen to know when this changed or was implemented?

#

Which API version

#

?

meager pulsar
#

For Connect webhooks, it’s important to note that while only test webhooks will be sent to your development webhook URLs, both live and test webhooks will be sent to your production webhook URLs.

modern jay
#

Yes, I see that. Thanks.

#

Can you answer the live mode question? Why are charges send using test api key and listed as test mode with pre-built chekout sent as live mode?

meager pulsar
#

I was searching our API upgrade docs but didn't see anything webhook related

#

Can you share a charge made with the test api key? The only event I saw was made with a live key

modern jay
#

cs_test_a1wuTl7zwOn5syWZnU1A64tq2A8OnOKAycr1NZcFnbvG1DKmAY52NCvyRK

meager pulsar
#

Okay so the checkout session you shared above is made with the test API key clearly and generates this payment intent(pi_3L35eiQSv5bgTx2G1ulkWxoi). livemode: false. So far so good

modern jay
#

Whch endpoint did this go to?

meager pulsar
#

Which in turn generates a charge (ch_3L35eiQSv5bgTx2G1KQUQWGJ) which also has livemode: false

#

These are API requests to Stripe. Are you looking for any events in particular?

modern jay
#

Where was the webhook sent for thie session? which endpoint?

#

It's not showing up anywhere in our logs that I can see.

#

It should be going to a test url endpint according to the docs

meager pulsar
#

Yup I'm looking for it

#

I'm seeing failed webhook deliveries to https://027c-97-90-153-248.ngrok.io on the Express Account

#

That endpoint is returning http_service_unavailable

modern jay
#

But that error is not showing up . in the dashboard it says A Checkout Session was completed. no error

#

are you sure about that?

#

Where are you seeing that error?

meager pulsar
#

The session was completed just fine. It's only the delivery of the event that is failing

#

It's on the Express Account (acct_1KZQ32QSv5bgTx2G)

#

Here's the full request body:

<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="author" content="ngrok">
    <meta name="description" content="ngrok is the fastest way to put anything on the internet with a single command.">
    <meta name="robots" content="noindex, nofollow">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link id="style" rel="stylesheet" href="https://cdn.ngrok.com/static/css/error.css">
    <noscript>ngrok gateway error
The server returned an invalid or incomplete HTTP response. (ERR_NGROK_3004)</noscript>
    <script id="script" src="https://cdn.ngrok.com/static/js/error.js" type="text/javascript"></script>
  </head>
  <body id="ngrok">
    <div id="root" data-payload="eyJjZG5CYXNlIjoiaHR0cHM6Ly9jZG4ubmdyb2suY29tLyIsImNvZGUiOiIzMDA0IiwibWVzc2FnZSI6Im5ncm9rIGdhdGV3YXkgZXJyb3JcblRoZSBzZXJ2ZXIgcmV0dXJuZWQgYW4gaW52YWxpZCBvciBpbmNvbXBsZXRlIEhUVFAgcmVzcG9uc2UuIiwidGl0bGUiOiJTZXJ2aWNlIFVuYXZhaWxhYmxlIn0="></div>
  </body>
</html>
modern jay
#

In the dashboard it shows it was competed with a 200 OK response

#

look at the transaction

meager pulsar
#

That is what I said. The transaction was fine. This is for delivery of the webhook event

modern jay
#

I am getting this for that link 'No such notification: 'evt_1L350GQSv5bgTx2G0RYpPigJ'

#

Where is the event?

meager pulsar
#

That is probably because it only exists on the Connect Account

modern jay
#

So where would I be able to see it? Or even know about it?

meager pulsar
modern jay
#

List of events but when search it says could not load the connected account. Which connected account exacatly are we dealing with here?

#

acct_1KZQ32QSv5bgTx2G ?

meager pulsar
#

Yup. Unfortunately I'm not seeing a great way to filter by ID in the Connect page

#

Your best option is to change the list display to show the account ID instead of the name and use your browser's search to find the account

modern jay
#

I'm logged into that express aacount . are you viewing test mode or ;ive mode events?

meager pulsar
#

Test mode since that's how the checkout session was created

modern jay
#

I have no way to see that error or to even know about it that I can see.

#

This is a problem.

#

I cna filter by failed. What is the date/time stempl on it?

#

I don't see any events for today using the filter pending/failed

meager pulsar
#

None of the events failed

#

A delivery failure is not an event failure

modern jay
#

HJmm Ok. There has to be a better way. How will we be able to know when the webhook response fails?

#

How will we know about these errors when we go to production?

#

Or even for testing. We've hit a wall here

meager pulsar
#

Hmmm.... it should show up on the Developers pane if the webhook is hosted (not simply forwarded using 'stripe listen')

#

which, I presume, is what the ngrok tunnel is for

#

What you should see is similar to what you currently see for your golaunchmusic.com/webhooks/stripeaccept endpoint. Where the delivery errors are clearly logged

#

Except

#

What I am seeing isn't recorded as a failure

modern jay
#

Right. but its not working that way

#

and it's realy hard to debug

#

impossible to actually

#

Still can't find that event

meager pulsar
#

I'm seeing 503 errors from ngrok which is telling Stripe this endpoint is disabled.

#

Those should still be logged since anything other than a 200 is a failure

modern jay
#

Ok. but I'm not seeng that. that is te problem

meager pulsar
#

I'm legitimately confused so I'm asking a colleague

#

Okay so the error isn't showing on your end because the endpoint was deleted and re-created after this event fired

#

In order to see this event and the failed webhook deliveries you would need to Login As the account in question

modern jay
#

I ma logged in as the account in question and it is not there

#

The endpoint was updated (I 'm gussing that is the same as deleted) but the event I sent you was sent after the update

#

I'll look into that thoguh

meager pulsar
#

You didn't send me an event

modern jay
#

I sent you the session

#

Maybe the last person sent you the event

#

?

meager pulsar
#

That checkout session triggers many events

modern jay
#

OK. Whatever happened πŸ™‚

meager pulsar
#

Try this link

modern jay
#

We are tlaking about hte same event\

#

that worked. I can see that now.

#

But how would I be aware that the webhook request failed in the first place without having to dig for an event. Plus, how would I get there from the dashboard?

#

It

#

It's taken a few hours on a chat with you folks just ot get to this point πŸ™‚

#

I'm still at a loss on how to debug this process. Would it be possible to set up an email notification for these specific to this express account?

lucid kraken
#

πŸ‘‹ im hopping in since snufkin has to head out - just give me a minute to catch up

#

Juts to confirm - the issue here is just that you deleted the webhook endpoint, which (as expected) caused all the events that were previously deleted to not be retried and you're wondering how to recover from that?

modern jay
#

no. sorry. it's alot more than that. been at this now for a few hours. can;t really start over again. thanks for your help though.