#codefoot_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1331718429895299102
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Sorry for posting here, could you guys please grant me reply privileges in my own thread here: https://discord.com/channels/841573134531821608/1331709114870534194
Hello, looking in to this but yes it should be possible. To align on some terminology, allow_incomplete and default_incomplete only apply to subscriptions that are set to have payment_behavior=charge_automatically . Creating a subscription with default_incomplete will allow oyu to create a subscription that does not attempt to charge the customer immediately, but will save their PM and charge automatically going forward. Is that roughly the behavior that you are looking for?
Yes it is, although when creating the subscription using subscriptionSchedules.create there isn't an equivalent attribute to set this
So I'm wondering if I'm missing something or if best practices is to listen to invoice.paid event then apply the schedule after the fact
Ah gotcha, I do see that now. I thought there was a way to set this, but must have been thinking of another setting. The subscription that the schedule creates should default to allow_incomplete which means the subscription will try to charge a default PM if one is set and otherwise it goes into an incomplete state. Would that behavior work for your scenario?
Yes that is the desired behaviour
Gotcha. Are you seeing another behavior when you test this in test mode, or were you more confirming that this is how it works?
Hmm I'll need to test again as this was the other day. One minute.
What is the relationship for payment_behaviour when it is created on a subscription? Here's the response I get after I:
- Create a new customer
- Create a new recurring interval = month price
- Create a subscription schedule using customer/price
- Retrieve subscription that was generated
My understanding is that it defaults to allow_incomplete, so once that invoice finalizes we will attempt to charge the default PM on the Customer or Subscription if it is set, otherwise the subscription will go into an incomplete state.
Where can I see said status
That is the allows_incomplete or is that background whereby the invoice status will update accordingly?
allow_incomplete is only a value that is passed when creating subscriptions directly. The result status-wise is that the subscription object can have a status of incomplete https://docs.stripe.com/api/subscriptions/object#subscription_object-status
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Got ya