#mrelliot69
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- mrelliot-setupintents, 16 hours ago, 8 messages
👋 how may I help?
heyy
so regarding my last topic i was told that i could use setup_future_session with offsession but from what your colleage told me yeasterday that is not possible with setupintents
also another question when i was using sources insted of pm i attached the paramter source to the customer when i was creating a custommer, how i can do that now with pm? or can i continue to use the source paramter?
it's setup_future_usage not setup_future_session
exacly i spelled wrong
when you're creating a SetupIntent the param is just called usage https://stripe.com/docs/api/setup_intents/create#create_setup_intent-usage
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
you just pass in the customer ID to the SetupIntent and we will take care of the rest
i was refereing to the parameter on the confirmCardSetup on js, or do i need to add to both in order to work?
i create first the setup intent and then the custommer so that approach would not work
thats why we used the source
you can use the deferred flow https://stripe.com/docs/payments/accept-a-payment-deferred?platform=web&type=setup
im not implementing payment intents
where you collect the PaymentMethod and then create the Customer and then the SetupIntent
this is not PaymentIntents
only setup intents to use payment methods
let me check
i dont have the customer id at the moment that i create the setup intent
thats why i explainnned before we used sources
i know i can use the attach method to attach to the custommer, but i think if i do that the default source will not be set
yes I agree, that's why in my approach I suggested create the Customer and then the SetupIntent
so there's an extra step that is not documented in the docs I shared but I did mention it just after
wym sorry? which step
creating the customer
before creating the SetupIntent and passing in the customer ID
i think i'm reppeating myself over and oer, i cannot do that approach since i only have the custommer after, thats our flow and that will not change
what i need to know is how i define a default payment method for a custommer
and how i can check what is the default payment method
you collected the Payment Method
I'm still not sure why creating the Customer at that step is so problematic for you
because we have multiple payment methods on our system and we only create the custommer if the custommer uses stripe meaning that that are 2 different instances on the code
that i already know, i need to know the 2 questions that i asked
- what i need to know is how i define a default payment method for a custommer
- and how i can check what is the default payment method
I need to understand you use-case in order to be able to help you
i already explainned that on my messages
would you mind walking me through the whole use-case without implementation details?
what you've explained is how you want things to work with Stripe rather than I want to achieve this and this
our implementation generates the setup intent when the pages loads,
then if a custommer clicks add new card, if a custommer on stripe is already stored we use that custommer to create the pm if not we create the custommer and attach the pm
thats basically it
then the flow I described will do that
you don't have to generate the SetupIntent when the page loads
you can just present the PaymentElement
i do because the confirmCardPayment requires that do init
then you haven't read the doc I sent you
I urge you to go back
and forget what you already know
just read the doc
and see whether this fits your needs or not
i see you mean do a ajax request to get the secret
that way when the elements is submited i do a retrive to get the secret with the custommer generated
is that it?
yes
but if i pass the custommer to the setup intent what that will do?
attach a default source to the custommer?
it will attach the Payment Method to the Customer
you need to forget about the sources since this is something that we're in the midst of deprecating
i already forget what it but i need a way to replace that , otherwise my system will break
but the attach i already do on the step of adding the card,
thats why im asking how i define the default payment method
if what you're looking for is a way to define a default payment method to pay the billing invoices automatically
then what you need to do, is basically listen to the setup_intent.succeeded event and then you would update the customer's https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_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.
with the payment method that was generated
i have custom recurring payments on my system not stripe invoices
Subscriptions use the invoices as an underlying way to collect the payments
i not use subs from stripe
so basically this would work either for one-off or recurring invoices
i have my own system
thats from the beginning im asking how i can define the default payment method, therefore i can used after to charge my clients
so basically you're just using the PaymentIntents afterwards to pay the recurring price?
im migrating the manage of cards to setup intents;
to charge im using charges;
and then i have recurring payments on my system that when renews i need to access the default payment method
you should also move away from Charges
to PaymetnIntents
this is a guide to migrate https://stripe.com/docs/payments/payment-intents/migration
why? from what i see on docs charges are still supported
and stripe only advised us to migrate that managment of sources
also then please help me with my initial question
The Charges API doesn’t support the following features, many of which are required for credit card compliance:
Merchants in India
Bank requests for card authentication
Strong Customer Authentication
these are the reasons why you should move away from the Charges API
right we know that charges dont support authentication of cards, but they work with setup intents so i don't see problems with that rn since stripe only advised us to migrate the sources
the question is exacly the one that i tagged
i dont know which clarification you need more than the questions that i tagged
anyone there?
please be patient, Discord is busy.
so you want to collect a payment method for a customer, and set it as the default payment method?
have you read this guide that was shared earlier? https://stripe.com/docs/payments/accept-a-payment-deferred?platform=web&type=setup
ok no worries, was only make sure that someone was checking
exacly
yes and theres no mention for the default payment method
are you creating Invoices or Subscriptions? if not, then setting a default payment method in Stripe would be useless.
i have my own recurring subs system, not using stripe subs or invoices
before we used the source parameter to set the default but rn with payment methods i dont know and the docs dosent mention that
in this case you don't need to use default payment method at all. when a customer needs to make a payment:
- list their exisitng payment method with https://stripe.com/docs/api/payment_methods/customer_list
- then create a PaymentIntent and set the
payment_methodproperty to one you retrieved in the previous step
i saw that on the docs, but that will not give me the default payment method, will give all the payment methods and i will select the last or the first, meaning that i will never charge the card that the custommer selected from the list on their profile
we use charges to charge the pm but its yeah then is just use the pm retrived
if you want to use a default payment method:
- on the customer, set
invoice_settings.default_payment_methodhttps://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method - then create a PaymentIntent and set the
payment_methodproperty to one set ininvoice_settings.default_payment_method
alright, because i was not using the invoices/subs i didnt wanted to use that parameter but if that is the only way to do it, i guess we will that route
im using charges but i think that will work with charges to
im using charges but i think that will work with charges to
wait, the Charge API doesn't work with PaymentMethod.
so you have to use PaymentIntent
what you mean dont work
i already tried and the charges are suceceffuly
stripe only asks us to migrate the payment methods from sources
there's no payment_method property when creating a Charge
so you can't use PaymentMethod and Charge together.
right but you use the source to pass the token of pm
Source and PaymentMethod are two completely different things. If you want to use PaymentMethod, you have to use PaymentIntents.
why is that? since the charge is processed
and stripe didnt told our platform to migrate to payment intents
here's the guide to migrate from Charge to PaymentIntent: https://stripe.com/docs/payments/payment-intents/migration
right, but can you explain why i need to migrate from charges to py if the charges work with payment methods? the only thing that is not supported is the authentication of cards
why i need to migrate from charges to py
I have no idea why you are doing this migration. but yes in general we recommend using PaymentIntent since they support more payment methods and 3DS.
im doing this migration because the royal bank of canada is blocking payment from our custommer clients because the platform is from us, so strip told us that in order to solve this we could use setup intents with on_behalf_of, that way we could specify the connected account of canada and the bank will not complain
ok, but that means that also work with charges
what works with Charge? can you try to be more precise in your questions?
payment methods are charged with charges api
that was what i was reffering to
one thing is advise because of 3ds other thing is charges dont work with payment methods and we require py to work only with pm
thats what im trying to clarify
since i did other integrations and charges worked with pm
since i did other integrations and charges worked with pm
The Charges API doesn't support PaymentMethod objects.
alright will need to check that then, ty
happy to help 🙂