#mairakanwal

1 messages · Page 1 of 1 (latest)

mortal rootBOT
verbal hinge
#

Can you share the request id where you got that error?

gentle ice
#

sure just a sec

#

the id is pm_1NcopWDfOEYgmHLmUWQ1sf4u

verbal hinge
#

No

#

I need the request id

gentle ice
#

I see. Request id is: req_jqqgMrJl5ehEKq

verbal hinge
#

That's not how incremental auth works

#

They never update the payment intent amount in that doc

#

They make an incremental authroization api call

gentle ice
#

this is test id request. Maybe if you can recheck what might be the issue

verbal hinge
#

The issue is you can't update a payment intent once it requires capture

#

The error message is correct

gentle ice
#

So I don't have to update the payment intent?
But I have to add more payment from customer whose payment is already authorized. I want to increase the authorized amount on a payment of the customer. How will that be done?

verbal hinge
#

Look at the doc

#

It shows you how

gentle ice
#

I have fully followed the documentation, but still this issue is not resolved. Is there a way I can get one-on-one help regarding this issue?

verbal hinge
#

You're making a call to update the payment intent

#

Can you share your code?

gentle ice
#

Yes sure, I can share my code:

For payment intent:

const paymentIntent = await stripe.paymentIntents.create({
amount: amount,
currency: 'sek',
customer:customerId,
//confirm:true,
automatic_payment_methods: {
enabled: true,
},
payment_method_options: {
card: {
capture_method: 'manual',
},
card_present: {
request_incremental_authorization_support: true,
},
},
});

For Update:

app.post('/add-more-payment', async (req, res) => {
try {
const { paymentIntentId, amountToAdd } = req.body;
// paymentIntentId = "pi_3NalhvDfOEYgmHLm3yhLnNc6";
const paymentIntent = await stripe.paymentIntents.retrieve(paymentIntentId);
await stripe.paymentIntents.update(paymentIntentId, {
amount: paymentIntent.amount + amountToAdd,
});
res.status(200).json({ message: 'Additional payment added successfully.' });
} catch (error) {
res.status(500).json({ error: error.message });
}
});

verbal hinge
#

Yeah you're not following that doc at all

#

Why are you calling await stripe.paymentIntents.update(paymentIntentId, { amount: paymentIntent.amount + amountToAdd, });