Brinamite
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
- user preferences for ios
when i check the docs for users and apple i get: No endpoint found for this version and platform Please switch to a newer version or different platform. i also...
- Wrong number of items (databases, docume...
On the project page in the Appwrite Console, the dashboard says I have 6 databases and 242k devices, while when I count the databases I have 5, and counting the...
- appwrite i mistakenly take me as develop...
appwrite i mistakenly tag me as developer how to tag back as owner. please help