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
- is `account.get()` safe to be used in th...
I want to user's `id` for authentication. However, a while ago I was told in this server not to use `account.get()` and instead add user preferences for that us...
- Appwrite console is too heavy
The Appwrite console is too heavy And all of my services broken Any support , please
- router_deployment_not_found
I updated my function a few times and now i am getting the error: router_deployment_not_found I even reverted back to my original code but i am still getting th...