Here is my implementation
const paymentIntent = await stripe.paymentIntents.create({
amount: body.amount,
currency: 'gbp',
customer: customerId,
automatic_payment_methods: {
enabled: true,
},
application_fee_amount: applicationFeeData,
receipt_email: `${user.getDataValue('emailId')}`,
transfer_data: {
destination: merchant,
},
metadata: {
title: 'title',
startDate: 'startAt',
endDate: 'endAt',
actualAmount: body.actualAmount,
coupon: couponCode,
},
setup_future_usage: 'off_session',
});
I have passed "automatic_payment_methods" as I am not getting Payment Method Id as it is an instant payment, but it always fails and the dashboard shows me required_payment_method. But according to docs payment_method is an optional parameter. How to proceed without payment_method parameter in paymetnIntent?