#BilalSaeedAlam

1 messages · Page 1 of 1 (latest)

floral fulcrumBOT
calm helm
#

Hi there!

#

How can I help?

tidal lion
#

At step 4 ia m retriving setup intent object as well
const setupIntent = await stripe.setupIntents.retrieve('seti_1EzVO3HssDVaQm2PJjXHmLlM');

#

So now i want to charge customer so whcih will be paramaters to pass like customer id etc in which api, can you help please

#

?

calm helm
tidal lion
#

i have a lot of test payment ids how i can select which will be the payment id like
By using this i have an object and in this object there is list of data

  • Code which i did used
    const paymentMethods = await stripe.paymentMethods.list({
    customer: '{{CUSTOMER_ID}}',
    type: 'card',
    });

In return list of objects in data
{
id: 'pm_1KILIk7JIXd7TyawpLetOKUTC',
object: 'payment_method',
billing_details: [Object],
card: [Object],
created: 1686130407,
customer: 'cus_O08vi5vdgirVPd',
livemode: false,
metadata: {},
type: 'card'
},

So should i pick up on the zero postion object or is there other way

calm helm
#

If you want the customer to choose, then show all payment method to the customer, and let them select the one they want.
If you want to chose, then it's completely up to you which one you chose.

tidal lion
#

Alright i have to use it myself i think latest one will be fine

#

And further i have ACH future too so what will the machnisim to charge that like you gave me link to charge card, can you please help in this too?

calm helm
#

ACH is a payment method, so it's exactly the same process.

tidal lion
#

so here at the position of card what i should paste
const paymentMethods = await stripe.paymentMethods.list({
customer: setupIntent.customer,
type: "card",
});

#

In the type variable

calm helm
#

us_bank_account I think.

tidal lion
#

alright

#

i will check it

calm helm
#

Happy to help 🙂

tidal lion
#

Soma it didn't work

#

can you help in it

#

us_bank_account

calm helm
#

What didn't work? Can you share a request ID (req_xxx)?

tidal lion
#

How to get this please guide me

hearty ember
#

Hi! I'm taking over from my colleague. Please, give me a moment to catch up.

tidal lion
#

No worries and thaks

hearty ember
#

Please share the request ID and I will take a look.

tidal lion
#

Yes i am getting that as you shared link

#

req_xyJmPEwuBfkCZm

hearty ember
#

This one is successful

tidal lion
#

Okay should i sgive you that where i get an error

#

Check this one please
req_mGfyJFL6Okydhz

hearty ember
#

There's an extra space in the name: type: "us_bank_account ",

tidal lion
#

oh okay lemme check

#

Perfect found no entry

#

And working well

#

Thanks man

#

Just last question

#

When i charge with card success and failure of payment will be get on the spot. And for ACH payment will charge like 2 to 4 days and how i can get response can you please tell me about all this

hearty ember
tidal lion
#

This will be for both or only for ACH

#

??

hearty ember
#

Sorry for delay, it is busy today.

hearty ember
tidal lion
#

No worries

#

All right, but i was curious like if after 4rth day payment ger declined then how i will know so this link will help me in this way

hearty ember
#

Is your app listening to any other webhook events?

tidal lion
#

Nope

hearty ember
#

Please read this guide: https://stripe.com/docs/webhooks
You should only perform post-purchase business logic (fulfill orders) using webhooks, otherwise you might loose some payments (if the customer closes the browser before the page loads)

tidal lion
#

No i am charging customer through future payments like customer only enter ACH or CARD details through Stripe elements and then i will store stripe_intent and after a monthe or 7 days i will charge hime according to orders payment, so thats why i am using CARD and ACH future payment methods.

#

So will it be easy for me to write logic for handling like payment is made or not so that i can update database according to that.

hearty ember
#

Exactly because ACH takes long to succeed (or fail) you need to listen to webhook notifications from Stripe. It will notify your app that the status have changed.

tidal lion
#

Alright man, it was really great to understand all the things and thanks for your time and kind response.