#LuckyPanda
1 messages · Page 1 of 1 (latest)
Hi there, how can I help?
Can you tell me how to create an immediate invoice just after a subscription is upgraded?
As per the doc, Stripe will invoice immediately if proration_behavior is set to "always_invoice",
That's right, But the invoice for proration is attached to the next billing date which means that it is involved in the upcoming invoice.
I also set "payment_collection" param to "charge_automatically"
What's the invoice ID so that I can take a look?
One sec.
ii_1N1MPnHn3Zy4ma8uVdav0fMD
ii_1N3DYMHn3Zy4ma8urvYMesfu
Both IDs are invoice item ID, not invoice ID (in_xxx). Could you share the invoice ID created after you update the subscription?
I can't find DCBA4AD7-0363 in your account: https://dashboard.stripe.com/test/invoices
Can you share the invoice ID starting with in_xxx?
Or can you share with me the subscription ID?
Thanks, I don't see you've made a update request with proration_behavior set to "always_invoice"
Can you share with me the request ID?
One sec.
So you mean that I didn't update the subscription with proration_behavior set to "always_invoice"?
You are right.
Sure
okay
one sec
return this.stripe.subscriptions.create({
customer: customerId,
items,
coupon: coupon || undefined,
collection_method: 'charge_automatically',
proration_behavior: 'always_invoice',
payment_settings: { payment_method_types: ['card'], save_default_payment_method: 'off' },
payment_behavior: 'allow_incomplete', // allow subscription even if payment failed
});
This is the code in which I've created that subscription.
Did you also set proration_behavior: 'always_invoice' when updating the subscription?
No
Should I?
And also set "collection_method" to 'charge_automatically'?
And all other attributes again?
??
Hi @misty mica
You need to specify proration_behavior: 'always_invoice' when updating the subscription
Thanks, it's working fine for now.
I have one more question. I'm currently using stripe test visa card and is there any way to manage the balances so that I can handle the exception in the case of lack of money in the connected card?