
Hi, I am having this weird issue where the body passed to the function is not being parsed.
I am following the template example of Payments With Stripe, extending it to receive line items.
Relevant code is as follows:
TypeScript
const fallbackUrl = req.scheme + '://' + req.headers['host'] + '/';
log(req.body);
const successUrl = req.body?.successUrl ?? fallbackUrl;
const failureUrl = req.body?.failureUrl ?? fallbackUrl;
const currency = req.body?.currency ?? 'eur';
const product = req.body['product'];
const quantity = req.body?.quantity ?? 1;
log({ successUrl, failureUrl, currency, product, quantity });
log is as follows:
TypeScript
{"successUrl":"https://[[domain]]/credits/return",
"failureUrl":"https://[[domain]]/credits/return",
"product":"price_1PP*****************",
"quantity":1,
"currency":"eur"}
{"successUrl":"http://cloud.appwrite.io/",
"failureUrl":"http://cloud.appwrite.io/",
"currency":"eur",
"quantity":1}
I have no clue why nothing is being read at this point. Let me know if more context is needed
TL;DR
Developers are having issues parsing the body passed to the function when trying to extend a template example of Payments With Stripe to receive line items. The relevant code provided does not seem to be properly parsing the body to retrieve the necessary data. The issue might lie in how the data is being passed or read within the function. Double-check the data passing and retrieval process to ensure everything is being handled correctly.Recommended threads
- fix ip function for whitelisting
Hello, any recommendation how to make IP of Appwrite Function on cloud is fixed for whitelisting purpose?
- [BUG] Next.js 16 is broken on appwrite.
The latest version of Next.js fails to build on appwrite and shows the error: `Adapter mismatch. Detected: static does not match with the set adapter: ssr` whil...
- 500 Internal Server Error
This error shows 500 on live site, but it works perfectly on Localhost.
