#ilyeselb
1 messages · Page 1 of 1 (latest)
hey i want to make a condition if i save or not the payment method
here its always saving it
Then can't you just omit the parameter when you create the Subscription? Sorry, I'm not understanding
when i create a subsciritpion its saving the card automatically
the paymentMethod
Ok, what do you mean by 'saving'? Can you share an API request you're making?
save the payment method
i dont want to save it automatically
on subscription create
Then just remove the save_default_payment_method parameter from your creation request
i put it as undefined but it still saving
You need to elaborate on what you mean by 'saving'? Where is it saving? What is your expectation?
If you can share some object IDs, that helps too
save default payment method , it mean its attaching the payment method to the customer
i dont want that only if the customer select (SAVE PAYMENT METHOD )
but its always saving it autmaticaly
Ok, so can you share me an example Customer or Subscription object where it's saving?
Right now all you've shared with me is a screenshot of our documentation
Also, the general recommendation is to always save the PM to the Susbscription. Without it future payments will likely fail
sub_1NOcWfGyOBDbEOMChyMqLZjs
Ok, sure. default_payment_method is set on the Subscription because you passed payment_settings[save_default_payment_method]: https://dashboard.stripe.com/test/logs/req_2BnwoDqkMlnTnJ
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Just remove that parameter form your request depending on whether the user has checked the box or whatever
(I'd advise against this personally)
aha okay so i shouldnt ?
do it
because it will fail futur payment
but how can i avoid saving it to the customer
this is the customer and it automatically saving it to that custumer
cus_OAyQ6QQdqJQ9vW
I think that's just how this works. Needs to be attached to the Customer, otherwise it PMs can't be reused
But it's not the default PM for the Customer
if i remove it from the cus , will this cause failur of sub future payment ?
Yes because once 'detached' the PM is no longer re-usable so you'd need to collect payment info again
okayy
A PM must be attached/saved to a Customer for it to be reusable
okay