I tried to integrate stripe checkout session in node.js and angular 14 project, all I want is to add google and apple pay as a payment method.
this is my code in node.js:
app.post('/create-checkout-session', async (req, res) => {
const session = await stripe.checkout.sessions.create({
payment_method_types: ['card'],
line_items: [
{
price_data: {
currency: 'usd',
product_data: {
name: 'My Product'
},
unit_amount: req.body.amount
},
quantity: 1
}
],
mode: 'payment',
success_url: 'http://localhost:4200/success',
cancel_url: 'http://localhost:4200/cancel'
});
res.json({ id: session.id });
});