#ilyeselb

1 messages · Page 1 of 1 (latest)

carmine ingotBOT
faint ridge
#

hey i want to make a condition if i save or not the payment method

#

here its always saving it

hazy ginkgo
#

Then can't you just omit the parameter when you create the Subscription? Sorry, I'm not understanding

faint ridge
#

when i create a subsciritpion its saving the card automatically

#

the paymentMethod

hazy ginkgo
#

Ok, what do you mean by 'saving'? Can you share an API request you're making?

faint ridge
#

save the payment method

#

i dont want to save it automatically

#

on subscription create

hazy ginkgo
#

Then just remove the save_default_payment_method parameter from your creation request

faint ridge
#

i put it as undefined but it still saving

hazy ginkgo
#

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

faint ridge
#

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

hazy ginkgo
#

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

faint ridge
#

sub_1NOcWfGyOBDbEOMChyMqLZjs

hazy ginkgo
#

Just remove that parameter form your request depending on whether the user has checked the box or whatever

#

(I'd advise against this personally)

faint ridge
#

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

hazy ginkgo
#

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

faint ridge
#

if i remove it from the cus , will this cause failur of sub future payment ?

hazy ginkgo
#

Yes because once 'detached' the PM is no longer re-usable so you'd need to collect payment info again

faint ridge
#

okayy

hazy ginkgo
#

A PM must be attached/saved to a Customer for it to be reusable

faint ridge
#

okay