#imDeaDshoT-Billing
1 messages · Page 1 of 1 (latest)
hello Jack thanks a lot
i spoke with chat support on stripe before but today came to know this is place for technical support
So it appeared from previous conversation that
i had to set auto_advance as true while creating/finalizing invoice + set saved payment method on customer as default
i made code changes, tested on 1 deposit transaction with customer id and still in invoice webhook response it says default payment method as null
although click on customer payment methods it does show the default flag
let me know if you need furthur details, happy to expand
OK, did you set the customer's invoice_settings.default_payment_method ?
yes that's what i did
OK. can you send me the customer ID?
yeah, this is "cus_LHVIVw6W3QV55K",
test environment
invoice id - "in_1KawJ5JeHVSfrG3lOVcASblE",
The invoice is still in draft mode, it's not finalized yet.
oh right, but doesn't it get finalised automatically for automatic charging case? must I do that manually?
i thought auto_advance setting to true will finalise it automatically
in backend while creating invoice i sent it as true
auto_advance means automatically collect the payment.
Stripe automatically finalize the invoice one hour after its creation, you can also call this API (https://stripe.com/docs/api/invoices/finalize) to fianlize it programmatically.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
okay got it so i shall wait for an hour first to see if it gets finalized
if not I will do this programmaticallyt
It's up to you, you can call the finalize API when you think the invoice is good to go.
got it thanks for the clarification
could you keep this thread open in case i have furthur queries?
Sure, in case if it's closed, you can just ask in the dev-help channel and we'll open it again or just create a new one.
thanks a lot!
hi Jack
so it should be automatically finalise now
and i got this info at top of dashboard:
You’re in test mode, so your customer won’t be charged for this invoice. Customers and products created in test mode can’t be used for live invoices.
so does that mean we can't test it on test env and must test a live payment on production?
You can still test in test mode, it's just that Stripe won't send the invoice emails in test mode.
got it
https://dashboard.stripe.com/test/invoices/in_1KawJ5JeHVSfrG3lOVcASblE
it says it got finalized and paid too
i have 1 doubt, in stripe billing settings, its set due payment to collect in 30 days, so once this fix is on production it will auto deduct 2nd invoice after 30 days for deposit payment as expected?
Is it the invoice template -> default payment terms?
yes exactly
https://dashboard.stripe.com/settings/billing/invoice
says default payment terms as 30 days on prod
will this override the 1 hr default time for finalize invoice?
These are two different things
- the one hour is to let Stripe finalize the invoice automatically -> to move the invoice status from
drafttoopen - the payment terms 30 days is the period of time that your customer should make payment within -> applicable to invoices of
openstatus only.
got it, so finalizing invoice basically just toggles status from draft to open
then open invoice on live env gets paid after default payment terms (30days in this case)
The payment terms are only applicable to customer who pay the invoice manually (i.e., collection_method=send_invoice, if you set the invoice to charge_automatically + auto_advance=true then the customer will be charged when the invoice is finalized.
got it
and for automatic charging, we can't override the invoice finalizing duration from 1 hour to 30days?
the max is 1 hour, but why do you want to delay the invoice finalization?
oh, its because for our implementation of deposit payments, business requirement was to charge next invoice after 30days
in step 3 of invoice lifecycle as per docs, it says stripe automatically attempts paymenr for open invoice, is this attempt immediate or can be configured with some delay?
let me rephrase, we don't want to delay invoice finalization, just want to delay payment attempt of open deposit invoice to 30days as per requirement
But you can generate the next invoice later (on the 30th day) and charge?
yes we were doing it before manually, but recovery rates were low hence tried to see if automatic charging can help in some way
Stripe will automatically retry the payment attempt if the previous payment fails, and you can also configure to send reminder email to your customer before the invoice date.