#Yashish
1 messages ยท Page 1 of 1 (latest)
Hi ๐ no, setting proration_behavior to always_invoice will always immediately generate an Invoice for the prorations and attempt to collect payment for that Invoice.
What is it that you're trying to build a flow to accomplish?
i want that payment statue should be as open or drafted insted of fail
Sorry, I'm still not clear, you do want to create prorations and immediately generate an Invoice for them? But not charge the Customer for that Invoice?
subscription = subscription.modify(
subscription_id,
items=[subscription_item],
payment_behavior='pending_if_incomplete',
billing_cycle_anchor="now",
)
in this code is executed the stripe tries to make the payment and the payment fail occur
but if we want the payment status to be open or drafted
In that snippet you're resetting the billing_cycle_anchor, which moves the Subscription to a new billing period and generates an Invoice for that. If the Subscription's collection_method is set to charge_automatically, then the the payment for that Invoice will be automatically attempted.
I think you will need to change the collection_method of the Subscription if your desire is to change the fact that the Subscription automatically attempts payments. But doing so will also change the behavior of the renewal payments for the Subscription.
`subscription = subscription.modify(
subscription_id,
proration_behavior='always_invoice',
items=[subscription_item],
payment_behavior='pending_if_incomplete',
)`
in this can there be any way that we can make the payment statue as open or as drafted
So you managed to do it?
no i am asking how we can do it
Did you try setting collection_method to send_invoice?
https://stripe.com/docs/api/subscriptions/update#update_subscription-collection_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
but this will affect my future plan renuals