#Gautam
1 messages · Page 1 of 1 (latest)
Hi! Let me help you with this.
You can create a PaymentIntent with payment_method parameter set.
could you please send me the docs link for this
👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
we don't have the saved payment method for customer ..
currently , we are creating customer and attaching the subscription .. want to understand how we can do this for one time payment
app.post("/create-payment-intent", async (req, res) => {
const { items } = req.body;
// Create a PaymentIntent with the order amount and currency
const paymentIntent = await stripe.paymentIntents.create({
amount: calculateOrderAmount(items),
currency: "usd",
automatic_payment_methods: {
enabled: true,
},
});
res.send({
clientSecret: paymentIntent.client_secret,
});
});
here we are handling which customer we are going to charge
not really, because you're not passing the customer ID to the create PaymentIntent