Cant fetch Stripe checkout session line items with Stripe lib or fetch, not returning any errors

Request verification is working fine since I updated to use both webCrypto = Stripe.createSubtleCryptoProvider() and
httpClient: Stripe.createFetchHttpClient() (though latter is now obsolete/unnecessary and verification works without it) Stripe is posting to the worker webhook just fine, I get a session with valid id and customer info. I can validate the event okay with
event = await stripe.webhooks.constructEventAsync(
body,
sig,
endpointSecret,
undefined,
webCrypto
);
event = await stripe.webhooks.constructEventAsync(
body,
sig,
endpointSecret,
undefined,
webCrypto
);
but when I run await stripe.checkout.sessions.listLineItems(session.id) or
await fetch(`https://api.stripe.com/v1/checkout/sessions/${session.id}/line_items`, {
headers: {
Authorization: `Bearer ${STRIPEAPIKEY}`
}
})
await fetch(`https://api.stripe.com/v1/checkout/sessions/${session.id}/line_items`, {
headers: {
Authorization: `Bearer ${STRIPEAPIKEY}`
}
})
it works fine locally but never returns on workers. Even in a try/catch it doesn't throw errors or logs. Tried on miniflare and it has the same result as on workers. current preview code is here: https://github.com/spudunk/webboot.io/tree/stripe preview is here: https://stripe.webboot-io.pages.dev/ and https://cb821c96.webboot-io.pages.dev/ deployment ID cb821c96-c052-43ae-87bb-aa1d8b63b0e9 account ID b4ef1aa0fe0e6bff020837c47b6f41bf Worked on it yesterday for several hours then this morning for three more with @embd and can't get it working.
GitHub
GitHub - spudunk/webboot.io at stripe
Website code for webboot.io. Contribute to spudunk/webboot.io development by creating an account on GitHub.
2 Replies
addison
addison15mo ago
I do want to add on, this function does run, but never gets past the fetch request inside it. https://github.com/spudunk/webboot.io/blob/stripe/src/lib/server/stripe.js#L19-L29
GitHub
webboot.io/src/lib/server/stripe.js at stripe · spudunk/webboot.io
Website code for webboot.io. Contribute to spudunk/webboot.io development by creating an account on GitHub.
addison
addison15mo ago
and ive been able to reproduce the problem locally via vite build && wrangler pages dev ./.svelte-kit/cloudflare
Want results from more Discord servers?
Add your server