#rmoura_js-pi&si
1 messages · Page 1 of 1 (latest)
Nope. you'd need to create the setup intent instead, you can convert them. You can use a payment intent to save the details for future though, during a payment, if that's what you want.
But to collect details without a payment, you need to create a setup intent
No, there is a minimum charge amount. WHat are you trying to do?
Is there a faster way to do this
retrieved_intent = Stripe::SetupIntent.retrieve(intent_id)
payment_method = Stripe::PaymentMethod.retrieve(retrieved_intent.payment_method)
in one request i mean
yes
so depends, where are you making those retrieve calls? in a webhook endpoint? some other way?
not on a webhook
not on a webhook
where then? a client-side request to your server?
asking for more detail so I can give you the right answer
gotcha, and what are you making that request based on? like confirmCardSetup() completing on your webpage, right?
confirmSetup
gotcha, so at that point you have both a SetupIntent ID and a PaymentMethod ID
You can retrieve the SetupIntent ID server-side (like you are doing) but pass expand: ['payment_method'] to also fetch the PM as well in one request
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.
how to add billing adress information on a Stripe::PaymentIntent.create({
Complete reference documentation for the Stripe JavaScript SDK.
this shows you how you pass billing details
thank you
How to disable elements inputs?
but when i do this elements.update({disabled: true}); nothing happends
Hello! To clarify, is elements a specific Stripe Element?
I think I did it
but I have another question
I have this and if the user choose "Every 2 years" its free we just save the card (setupintent) but if its 3 years the user have to pay (payment intent). What do you suggest I do?
Start the payment element with 0 $ gives me an error ... so what am i supposed to do?
You would need to conditionally create a Setup Intent or a Payment Intent, and once the choice is made and you have the Intent then create and display the Payment Element.
but the user can change .... its choice after the payment element is presented
You would need to remove the Payment Element and create it again if it's all on the same page. I recommend you have them make a selection and then present the Payment Element on another page after that though.
hmm ok