#bennyg_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1293321827078246420
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- bennyg_error, 6 days ago, 13 messages
Hello! If you create a Checkout Session and go through it manually is the expected Event sent to the expected Webhook Endpoint?
No that is the main problem, the Connect webhook is not being hit when I create the event with the following CLI command:
stripe trigger checkout.session.completed --stripe-account acct_1PnPOn2KdJGJ2meV
The regular "account" version of the webhook is what is hit.
Both webhooks are listening to the same event (checkout.session.completed), but only one is actually receiving traffic
Right, what I'm asking is for you to not use the CLI at all, just as a test.
Create a Checkout Session with code/curl/whatever, visit the URL yourself, use a test card to pay, see if the Event fires and is sent to your Webhook Endpoint.
If it is sent, that means we should focus on the CLI as the issue. If it's not sent, that means something else is going on.
Got it - will try shortly
Okay I have triggered the Checkout Session creation through CURL and then completed the test transaction manually.
Still no events to the Connect type webhook, but the Account type webhook is receiving the event.
Would appear to not be a CLI issue and be something else.
Okay, so it sounds like you're not creating the Checkout Session where you expect. You want to create it on your connected account, not your platform account, correct?
Yep. I want to simulate a connected account that has installed the app completing the checkout session
Can you give me the ID of the test Checkout Session you just created?
"cs_test_a1efwfETvSmnlSYXZRqnuU2rA9k9xaPiGB8qRRSHorTBFYqv4DLuHX1yVH" looks to be the id
Looking...
Okay, yeah, looks like this was created on your platform account, not one of your connected accounts. Try creating another Checkout Session, but make sure you use the Stripe-Account header approach documented here and specify the connected account ID you want to use: https://docs.stripe.com/connect/authentication#stripe-account-header
We don't have any official connected-accounts yet because we are still testing the application before publishing to the marketplace. I can put my own account-id within that header or will that also not work?
No, that won't work.
You need to have a connected account.
You can create a test one.
Okay so the plan for testing correctly will be then: 1) Create a test account using the API as linked above, 2) Add test secret values to that account as part of configuring that test environment, 3) Run the Checkout session flow with the new account-id associated in the header or in the CLI via the --stripe-account flag.
Is this an accurate summary of the needed steps?
Its a little unclear how to make 2) happen given the API docs for Secrets https://docs.stripe.com/api/apps/secret_store/set
Would I need to add the Stripe-account header to the request as well?
I'm also unclear on #2... I don't think you would need to do that at all.
But, wait, let's back up a bit. What are you building exactly?
We are building an application that Stripe users configure to syncs conversion data with our platform (we are an advertising network).
As part of the conversion data being forwarded to our platform, they save as Stripe secrets values that are used to authenticate with our platform.
When we recieve a webhook event from them, we can pull the values needed to authenticate with our platform and forward the conversion event to where it needs to go within our internal systems
How do the Checkout Sessions fit in?
That event signifies a purchase has been completed (e.g. an end consumer has bought something from an advertiser of ours)
We then downstream attribute that purchase to our ad displays
So with a Stripe App the "connected" account would be the account that installs the app, so installing it in test mode in a test account that's not your platform should do the trick.
Okay I will try to do so, have created the connected account by running this request: https://docs.stripe.com/api/accounts/create
I seem to be unable to trigger a checkout.session.completed, getting the following response:
Setting up fixture for: product
Running fixture for: product
Setting up fixture for: price
Running fixture for: price
Setting up fixture for: checkout_session
Running fixture for: checkout_session
Trigger failed: Request failed, status=400, body={
"error": {
"message": "In order to use Checkout, you must set an account or business name at https://dashboard.stripe.com/account.",
"request_log_url": "https://dashboard.stripe.com/acct_1Q7la0Rr6SW1q7O6/test/logs/req_QDiENgiybzfbbh?t=1728425363",
"type": "invalid_request_error"
}
}
In order to fully test the flow you want with a Stripe App I think you'd need to follow this approach: https://docs.stripe.com/stripe-apps/test-app
But I'm still a bit confused, to be honest. You want your app to create Checkout Sessions on the accounts they're installed on, right?
Not quite. I want the app to store in its settings values needed for our customers to authenticate with our API.
We will then, with our own webhooks listen for checkout.session.completed events that come in from any connected account with our app installed
Yeah, I think there's some kind of disconnect here, sorry. If that's what you want to do why are you trying to create a Checkout Session on a connected account?
Oh, so you want to listen for Checkout Sessions created by other things, not your app?
Like I would install your app on my Stripe account, then I would create a Checkout Session on my own account using my own code or whatever, and you want to get that Event?
And that's what you're trying to test?
Yes that is pretty much the flow. They install the app, and configure settings. When a checkout session event occurs on their account, that hits our Connect webhook. When we get that event, because they have installed our application, we read their App-specific configuration values to forward the request into our downstream internal systems (outside of Stripe)
Ah, okay. So yeah, you'd need to do this to get your app installed on a different account: https://docs.stripe.com/stripe-apps/test-app
Then you'd need to create a Checkout Session on that account regularly (no Stripe-Account header or anything) and that should trigger the Event because your app is installed.
Ahh that makes a lot of sense. So to summarize 1) No direct testing is possible solely within our account. 2) I will get a completely external account to install the application and have them create test Checkout Sessions, which our application will then receive.
For #1, correct, not for this scenario. For #2, that sounds like the right approach!
Okay thank you for the help and pointing me to the right documentation! Much appreciated!