#suraj kumar

1 messages · Page 1 of 1 (latest)

rapid nimbusBOT
obtuse needle
#

Sorry it's confusing when you say Retrieving PaymentIntent, but your method is setupIntents.retrieve

analog finch
#

req_Oq0j300Vw56ozF

#

sorry req_aI2QLpRk66MU9y this one

#

Basically it returned me payment_method pm_1NBA******JyQO but it should be pm_1NBA*****RCLC

#

thats why my subscription failed.

#

Request id for stripe.setupIntents.retrieve is. req_NpmI5hoOHKylUL.

obtuse needle
#

Sorry you provided 3 requests and each of them are different. I am not quite sure which issue you want to resolve.

ie. req_NpmI5hoOHKylUL is a succeeded request, while req_Oq0j300Vw56ozF is a failed one on SetupIntent Retrieve.

Then req_aI2QLpRk66MU9y is a completely different API (Create Subscription)

analog finch
#

I'm talking about below request

Request id for stripe.setupIntents.retrieve is. req_NpmI5hoOHKylUL.

#

This request is succeeded but i'm getting wrong payment_method which does not belongs to my account

obtuse needle
#

Why do you think it doesn't belong to your account?

analog finch
#

The expected payment_method in response was pm_1NBA*****RCLC but it returned pm_1NBA******JyQO

#

i can see it in dashboard .

obtuse needle
#

It's JyQO indeed

analog finch
#

but in dashboard its showing different payment id.

#

what i'm trying to do
Steps:

  1. create setup intent
  2. Confirm setup intent
  3. retrieve payment method using client_secret
  4. create subscription using above payment method

now in step 4 its saying wrong payment method.

obtuse needle
#

Let's go back to check the Payment method Id first

analog finch
#

pm_1NB***JyQO

obtuse needle
#

Yes, so it's expected

analog finch
#

No.

obtuse needle
#

Why do you think it should be RCLC?

analog finch
#

Do you have access of my dashboard ?

obtuse needle
#

Yes I can see

analog finch
#

there are two payment methods attached with my account

#

none of them match with this payment method

obtuse needle
#

But the request to confirm this SetupIntent created this PaymentMethod indeed. Please see the request link above

analog finch
#

so is there anything which i'm doing wrong ?

analog finch
obtuse needle
#

So I am not sure what is RCLC and why it should be related to this SetupIntent. This SetupIntent is created and confirmed and generated JyQO, and that's it.

analog finch
#

In my dashboard two payment methods are attached and ids are as following

  1. pm_1NBAefC***YA4RCLC
    2.pm_1NBAXn
    Vwda7
#

please check from your end as well once.

obtuse needle
#

But they aren't related to seti_1NBAeGC15gn2KO2gLctoVJy7 right?

analog finch
#

its cresated by seti_1NBAeGC15gn2KO2gLctoVJy7 only

obtuse needle
analog finch
#

id of what ?

#

payment id ?

obtuse needle
#

Those 2 payment method id. You wrote *** inside so I can't search

analog finch
#

pm_1NBAefC15gn2KO2gdYA4RCLC

#

pm_1NBAXnC15gn2KO2gILvVwda7

obtuse needle
#

tks

analog finch
#

waiting

obtuse needle
#

Yeah looking. Will get back as soon as I can

analog finch
#

okay

obtuse needle
#

Okie qq how did you get the Id of pm_1NBAefC15gn2KO2gdYA4RCLC?

analog finch
#

Its showing in my dashboard.

obtuse needle
#

Ah this is the Customer page?

#

I see what you mean

analog finch
#

yes

obtuse needle
#

So pm_1NBAefC15gn2KO2gdYA4RCLC is the correct PM which is attached to the Customer, and you expect to receive it when Retrieving the SetupIntent, instead of pm_1NBAeYC15gn2KO2gpvbEJyQO

analog finch
#

right

obtuse needle
#

Okie and how did you collect this SetupIntent? Is it the confirmSepaDebitSetup js method?

analog finch
#

yes

#

sorry

#

stripe.confirmSetup

#

i'm using this method on client side

obtuse needle
#

Oh PaymentElement?

analog finch
#

yes

obtuse needle
#

And which payment method has you chosen?

analog finch
#

i guess its banconnect

obtuse needle
#

Okie gimme a few more minutes

analog finch
#

okay

obtuse needle
#

Let's try this. When you retrieve the SetupIntent, can you expand the latest_attempt field?

#

Would you see the expected CLC there?

analog finch
#

let me try, give me 1 min

#

"latest_attempt": "setatt_1NBAeYC15gn2KO2ggpP8OyoI",

#

its an id not object.

#

i didn’t get your point, could you please explain it.

obtuse needle
#

passing an extra parameter expand: ['latest_attempt']

analog finch
#

"latest_attempt": { "id": "setatt_1NBAeYC15gn2KO2ggpP8OyoI", "object": "setup_attempt", "application": null, "created": 1684907670, "customer": "cus_Nx4aDkJ4VtXFmK", "flow_directions": null, "livemode": false, "on_behalf_of": null, "payment_method": "pm_1NBAeYC15gn2KO2gpvbEJyQO", "payment_method_details": { "bancontact": { "bank_code": "VAPE", "bank_name": "VAN DE PUT & CO", "bic": "VAPEBE22", "generated_sepa_debit": "pm_1NBAefC15gn2KO2gdYA4RCLC", "generated_sepa_debit_mandate": "mandate_1NBAefC15gn2KO2gnrOhhykR", "iban_last4": "7061", "preferred_language": null, "verified_name": "Jenny Rosen" }, "type": "bancontact" }, "setup_error": null, "setup_intent": "seti_1NBAeGC15gn2KO2gLctoVJy7", "status": "succeeded", "usage": "off_session" },

#

"payment_method": "pm_1NBAeYC15gn2KO2gpvbEJyQO", is still same but "generated_sepa_debit": "pm_1NBAefC15gn2KO2gdYA4RCLC", is pointed here.

obtuse needle
#

Yes!

#

So here is what happened: When a customer confirmed with a BanContact PaymentMethod, we generated a SEPA Direct Debit Payment method too, and this Payment Method is the correct one to reuse in the future

#

Apologize for the confusion, I agree that we should improve our Doc

#

The way to retrieve the correct PaymentMethod would be looking at this generated_sepa_debit field

analog finch
#

But here its a big challenge for me to retrieve the payment method.

#

Because see its working different for other methods and different for this.

obtuse needle
#

To reuse the PaymentMethod, you should List the PaymentMethod based on the customer, instead of retrieving directly this SetupIntent.

#

If you still want to retrieve directly from the SetupIntent, then specially for BanContact and Ideal you would want to look at this generated_sepa_debit field

analog finch
obtuse needle
#

I see, then it's only to write a conditional checking, if ideal or bancontact to look at here instead

analog finch
#

okay but are you sure its only for these two payment method.

obtuse needle
#

How about always checking latest_attempt? When you see a generated_sepa_debit there then priotize it, otherwise use its payment_method

#

That way you won't depend on which Payment Method specifically

analog finch
#

but how would i know which payment element is selected by the customer.

#

its a secret so will never know that.

obtuse needle
#

What do you mean by "which payment element"?

obtuse needle
#

ah

#

You mean when retrieving programatically

analog finch
#

yes

obtuse needle
analog finch
#

yes i can do it but testing would be an task in this case because lots of payment methods are there

obtuse needle
analog finch
#

okay thanks a lot.

#

Steps :

  1. create setup intent
  2. Confirm setup intent
  3. retrieve payment method using client_secret
  4. create subscription using above payment method
#

above process is correct or not ?

#

Can you please add me add your friend in stripe, i really loved talking to you.😇

obtuse needle
#

Yep steps are correct, except in step 3 you would need the custom logic above for BanContact / Ideal or alike

#

Thanks! We are happy to help here any time

analog finch
#

that i will do

obtuse needle
#

Just drop by and say hi xD

analog finch
#

Your message could not be delivered. This is usually because you don't share a server with the recipient or the recipient is only accepting direct messages from friends. You can see the full list of reasons here: https://support.discord.com/hc/en-gb/articles/360060145013

obtuse needle
#

It's because I don't have DM opened, sorry 🙂 It's depends but most of us using this Discord account only when we are online, meaning we are available on this channel already