customer.retrieve from stripe don't work in vercel #4803
Locked
dagdevelop
started this conversation in
Show & Tell
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone. In my application, I use Stripe to allow customers to create subscriptions via payment links. On the backend (nodejs), I have a webhook that listens for all subscription changes. When the webhook is called, I retrieve the customer associated with the subscription, get their email, and update their subscription in my MongoDB database. Everything works perfectly in development mode, but in production mode (Vercel), the code gets stuck at this point: const customer = await stripe.customers.retrieve(customerId), without giving an error (without entering the catch block). The environment variables in Vercel are well configured because despite the fact that it gets stuck when retrieving the customer, the webhook signature is done without any issues. I really need help or an explanation please.
my code :
``
const stripe = require("stripe")(process.env.PRIVATE_KEY_STRIPE);
const getCustomer = async ({ customerId }) => {
try {
console.log("customer ID dans le getCustomer : ", customerId);
} catch (error) {
console.error(
"Une erreur s'est produite lors de la récupération du client Stripe :",
error
);
return null;
}
};``
the log in vercel : customer ID dans le getCustomer : <CUSTOMER_ID>
Beta Was this translation helpful? Give feedback.
All reactions