#Yashish
1 messages ยท Page 1 of 1 (latest)
Let's chat here, can you give me a quick summary of the issue as well as what you've tried so far?
subscription = subscription.modify(
subscription_id,
proration_behavior='always_invoice',
items=[subscription_item],
payment_behavior='pending_if_incomplete',
)
in subscription modification
in this can there be any way that we can make the payment statue as open or as drafted
๐ hopping in here since hanzo has to head out soon
when we are doing this update stripe tries to make the payment for the update and fails
Yes, typically if this is a charge_automatically Subscription the Invoice would be finalized immediately and payment would be attempted
Is there a reason you don't want this behavior?
yes
`subscription = subscription.modify(
subscription_id,
proration_behavior='always_invoice',
items=[subscription_item],
payment_behavior='pending_if_incomplete',
)
subscription = stripe.Subscription.retrieve(subscription_id)
invoice = stripe.Invoice.retrieve(subscription.latest_invoice, expand=['payment_intent'])
invoice_url = invoice.hosted_invoice_url
return redirect(invoice_url)`
I am performing this code and I want the user to do the payment where he is redirected
since user is getting redirect but stripe also tries to do the payment for the update which fails, i don't want strip to do the payment when user tries to update the plan
Gotcha! So really the best way to do this would be to use payment_behavior: default_incomplete - if you use that payment won't be attempted automatically and you can manually confirm the underlying payment intent when you want (when you redirect your user)
ook let me try
here the payment status is becoming
but still the payment for the plan is not done but the plan get change with the status overdue
The Subscription is overdue bcause the latest Invoice hasn't been paid - what status were you expecting instead?
until the payment occurs the plan status should not change
There's no way to get that behavior - as soon as invoice is finalized for charge_automatically subscriptions we consider the payment to be due
The only way around this would be to switch to collection_method: send_invoice which allows you to specify a separate due date that is after finalization
during the update if we specify collection_method: send_invoice
then will it affect the auto-renewal for payment
Yes, that will affect the auto renewal -you'd have to change it back to charge_automatically if you want the automatic renewal to happen
`subscription = subscription.modify(
subscription_id,
proration_behavior='always_invoice',
items=[subscription_item],
payment_behavior='default_incomplete',
collection_method='send_invoice',
days_until_due=0,
)
subscription = stripe.Subscription.retrieve(subscription_id)
invoice = stripe.Invoice.retrieve(subscription.latest_invoice, expand=['payment_intent'])
invoice_url = invoice.hosted_invoice_url`
here i am unable to get the invoice url
It's likely because the Invoice hasn't finalized yet (which is expected with send_invoice Invoices)
Have you checked the Invoice's status?
Then you need to finalize the Invoice (which you can do through the API)
how?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
let me try
days_until_due=0
what does will it exactly work?
after finalizing the invoice the user is redirected for the payment but there if the user does not do any payment then
also the plan is getting updated
Hi there ๐ taking over, as my colleague needs to step away
Give me a few minutes to get caught up.
Can you reframe your question? I don't understand
i had done this code
then updated this
now new question from here