#suraj kumar
1 messages · Page 1 of 1 (latest)
Sorry it's confusing when you say Retrieving PaymentIntent, but your method is setupIntents.retrieve
Could you provide the errored request id? It's on https://dashboard.stripe.com/test/logs
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
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.
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)
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
Why do you think it doesn't belong to your account?
The expected payment_method in response was pm_1NBA*****RCLC but it returned pm_1NBA******JyQO
i can see it in dashboard .
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
It's JyQO indeed
but in dashboard its showing different payment id.
what i'm trying to do
Steps:
- create setup intent
- Confirm setup intent
- retrieve payment method using client_secret
- create subscription using above payment method
now in step 4 its saying wrong payment method.
Let's go back to check the Payment method Id first
Which payment method id you see on https://dashboard.stripe.com/test/setup_intents/seti_1NBAeGC15gn2KO2gLctoVJy7?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
pm_1NB***JyQO
Yes, so it's expected
No.
You mentioned it here
Why do you think it should be RCLC?
Do you have access of my dashboard ?
https://dashboard.stripe.com/test/logs/iar_NpmI5hoOHKylUL is the request when you confirmed SetupIntent
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Yes I can see
there are two payment methods attached with my account
none of them match with this payment method
But the request to confirm this SetupIntent created this PaymentMethod indeed. Please see the request link above
so is there anything which i'm doing wrong ?
yes i can see and you are absolutely right
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.
In my dashboard two payment methods are attached and ids are as following
- pm_1NBAefC***YA4RCLC
2.pm_1NBAXnVwda7
please check from your end as well once.
But they aren't related to seti_1NBAeGC15gn2KO2gLctoVJy7 right?
its cresated by seti_1NBAeGC15gn2KO2gLctoVJy7 only
Could you paste the full Id? IDs are safe to share
Those 2 payment method id. You wrote *** inside so I can't search
tks
waiting
Yeah looking. Will get back as soon as I can
okay
Okie qq how did you get the Id of pm_1NBAefC15gn2KO2gdYA4RCLC?
yes
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
Okie and how did you collect this SetupIntent? Is it the confirmSepaDebitSetup js method?
Oh PaymentElement?
yes
And which payment method has you chosen?
i guess its banconnect
Okie gimme a few more minutes
okay
Let's try this. When you retrieve the SetupIntent, can you expand the latest_attempt field?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
It should give you a full SetupAttempt object, which has this payment_method https://stripe.com/docs/api/setup_attempts/object#setup_attempt_object-payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Would you see the expected CLC there?
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.
Yes so by default it's an ID, but you can expand it to be an object https://stripe.com/docs/api/expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
passing an extra parameter expand: ['latest_attempt']
"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.
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
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.
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
no no its a big confusing for me now, since my customers can have multiple payment methods at a time so can’t list them and use one of them.
I see, then it's only to write a conditional checking, if ideal or bancontact to look at here instead
okay but are you sure its only for these two payment method.
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
but how would i know which payment element is selected by the customer.
its a secret so will never know that.
What do you mean by "which payment element"?
BanContact is available via the payment_method_details here
ah
You mean when retrieving programatically
yes
Sure, then let's expand also payment_method from here and grab its type https://stripe.com/docs/api/payment_methods/object?lang=ruby#payment_method_object-type
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
yes i can do it but testing would be an task in this case because lots of payment methods are there
You don't need to iterate the list,
- Grab the SetupIntent.SetupAttempt.PaymentMethod.Type into a variable
- Go retrieve SetupIntent.SetupAttempt.${variable}.generated_sepa_debit
2.1 If this is != SetupIntent.SetupAttempt.PaymentMethod.Id, then take it
2.2 If this is not existed, take the SetupIntent.SetupAttempt.PaymentMethod.Id
okay thanks a lot.
Steps :
- create setup intent
- Confirm setup intent
- retrieve payment method using client_secret
- 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.😇
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
that i will do
Just drop by and say hi xD
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
If your direct message was unable to be sent, you will receive an error message from Clyde that states the following:
Your message could not be delivered. This is usually because you don't share a ...
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