#Mohana-default_payment_method

1 messages ยท Page 1 of 1 (latest)

quartz iron
#

That's a different parameter

#

1 sec

solemn oak
#

okay ๐Ÿ™‚

quartz iron
#

invoice_settings.default_payment_method

solemn oak
#

oh yeah thanks

#

i was looking up what was in that too ๐Ÿ™‚

#

thanks Orakaro !

quartz iron
#

np!

solemn oak
#

whats the purpose of the other parameter ?

#

the default source one ?

quartz iron
#

source is a legacy parameter

#

invoice_settings.default_payment_method is newer and take precedence

#

source is only there for old API level compatible users

solemn oak
#

cool ๐Ÿ™‚ thanks

solemn oak
#

hi guys

#

so i am having one more query

#

I have created a subscription for a customer and since he does not have an invoice, i am using the send invoice via email option

#

when the customer pays for the invoice, i can see that the payment methods are collected and set as default payment method in dashboard

#

When i retrieve the customer object, i am seeing the default payment method in default source parameter and not in invoice_settings.default_payment_method

#

What I am trying to achieve is, when creating subscriptions, i need to check if the customer has a payment method saved and if so, charge for the subscription via the default payment method

#

i guess i can't just look at the invoice_settings.default_payment_method and come to a conclusion as to whether or not the customer has a payment method set right ?

cursive inlet
#

I'm assuming you have built a UI for your subscription creation where your customers checkout via?

#

i.e. where they can select their payment method

solemn oak
#

Umm, we had to not use checkout sessions because we were unable to set billing_cycle_anchor through checkout sessions

#

so, the payment for initial subscription for a new customer will be collected via the invoice sent by email

#

once the payment methods are collected, successive subscriptions/renewals will make use of the default payment method (if available)

cursive inlet
#

Do you have an example cus_xxx I can look at?

#

I'm surprised invoice_setting.default_payment_method is unset after the invoice is paid

solemn oak
#

cus_KsMdb4mnj5mBJ6

#

I was infact surprised as to why it was not set ๐Ÿ˜„

cursive inlet
solemn oak
#

is that intentional ?

#

earlier Orakaro mentioned that field was a legacy field for old api

cursive inlet
solemn oak
#

okay ๐Ÿ™‚ with that info, will either customer's default source or invoice_settings.default_payment_method provide me whether or not I can create subscriptions with collection_method as charge_automatically ?

cursive inlet
#

Yep I can replicate this!

solemn oak
#

Okay ๐Ÿ™‚

cursive inlet
solemn oak
#

๐Ÿ˜ฎ

cursive inlet
#

Assuming there's been a previous Hosted Invoice Page payment then it looks like the default_source field is set. But equally, that can be unset via the API/Dashboard

solemn oak
#

Ahhh I see

#

So if either customer.default_source or customer.invoice_settings.default_payment_method is set, a new subscription can be created right ?

#

with collection_method as charge_automatically ?

cursive inlet
#

Yes, and we will automatically attempt to charge the provided payment method

solemn oak
#

cool ๐Ÿ™‚

#

one more request, is it possible to include the billing_cycle_anchor on the checkout session api ?

cursive inlet
#

It's not, nope

#

What's the use case?

solemn oak
#

We want to create subscriptions which renews 1st of every month

cursive inlet
#

Is it to specifically start on that date, or just renew then?

solemn oak
#

you can start the subscription on any date but it will always renew on 1st of month

#

so the first cycle will be short of 30 days

#

and rest all will fall on 1st of every month

#

when i mentioned as a request, i hope you got it as a feature request right ?

#

we had this conversation a couple of days back ๐Ÿ™‚ and i got several alternatives for that

cursive inlet
#

Got it. Yep, it's a common ask. Just trying to understand the use case as some merchants want to specify a date on which the subscription starts too

#

Right now you could use one of the trial parameters to se tthe billing anchor

solemn oak
#

cool ๐Ÿ™‚

#

thanks ynnoj ๐Ÿ™‚ have a nice evening

cursive inlet
#

you too