
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:
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:
{"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
Recommended threads
- Functions fail to deploy after switching...
Hi <@1087889306208718959> , after switching my self-hosted Appwrite instance to use AWS S3 as the storage backend, my Cloud Functions stopped working. I’m runni...
- Subject: Function req.body Empty Despite...
Hi Appwrite Support Team, I'm encountering a persistent issue where my Appwrite function is receiving an empty req.body, even though my cURL requests successfu...
- Error setting postman body
Good evening, anyone has an idea on how to pass body to appwrite function using postman? this is how I've passed it : { "providerName": "adamu" } and I ke...
