#BilalSaeedAlam

1 messages · Page 1 of 1 (latest)

median sluiceBOT
sleek canyon
#

Hi
Can you share more details please ?

stone egret
#

Yes

#

Basically i am using ACH future payment method so i am storing setup intent id into database.

Now when i need to charge customer i am using these steps:

1- Retrieve setup intent
const setupIntent = await stripe.setupIntents.retrieve(
merchant[0].stripe_setup_intent
);

2- Get payment type
const paymentMethods = await stripe.paymentMethods.list({
customer: setupIntent.customer,
type: "us_bank_account", // us_bank_account
});

3- Charging customer like this with payment intetn
ry {
const paymentIntent = await stripe.paymentIntents.create({
amount: 100,
currency: "usd",
// automatic_payment_methods: { enabled: true },
customer: data[0].customer,
payment_method: data[0].id,
off_session: true,
confirm: true,
receipt_email: customer ? customer.email : "",
description:
"3% of your purchase goes toward our ocean cleanup effort!",
});

#

Ath the end having this error
The PaymentMethod provided (us_bank_account) is not allowed for this PaymentIntent.

#

requestId: 'req_zCxepm5fdPZfSE',

sleek canyon
stone egret
#

I am adding this parameter
payment_method: data[0].id,

#

In this data[0].id there is payment method id

sleek canyon
#

yes I saw that... add payment_method_types:['us_bank_account']too

stone egret
#

Okay lemme add this

#

Yep its working now, so can you tell me how to check like with webhooks when payment is successeded or failed

sleek canyon
stone egret
#

But how to setup all this into my applicaiont, can you please guide me

sleek canyon
stone egret
#

Thank you man