#akdj16
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
would you mind explaining why are you opting for Subscription Schedules?
Hello! it is because I want to apply more than one discount (coupon) on the first invoice of the subscription (let's me find the thread about that, it is in this channel)
Hi! I'm taking over this thread.
Unfortunately it's not possible to set "payment_behavior" to "default_incomplete" in a subscription schedule. What exactly are you trying to accomplish here?
Hi @indigo goblet it's been a while ๐
Yes, I remember our conversation!
currently, I am trying to use Stripe element on the frontend side (react native) like here https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
and I want that the subscription becomes active after the payment
but because of the subscriptionSchedule, I cannot create a subscription with incomplete status ๐ฅฒ so I am searching a way to have both: a subscription in incomplete status and be able to add discounts to the invoice
does the incomplete status will create draft invoice? if so, I may be able to have both?
Thanks for the clarification. Give me a few minutes to look into this.
Hi there ๐ I'm jumping in as my teammate needs to step away. No, creating a Subscription with payment_behavior set to default_incomplete will not cause the first Invoice that is generated to wait before being finalized.
do you mean the invoice will be in draft status?
No, the Invoice will not sit in a draft status, it will immediately move to an open state.
so, impossible to add new discount or new invoice item on it?
Correct, it will be finalized immediately.
I scrolled through your previous conversation, but wanted to make sure I pulled out the right list of requirements that you're looking for. Is the below what you're looking for?
- Be able to add multiple coupons
- Have the Subscription in an
incompletestate until the first payment succeeds
yes, exactly ๐
I don't think that's possible. Is it safe to assume that you're interested in the incomplete state mostly so you can track when it changes to active and can grant access to your product/service?
yes, but I cannot remove the ability to have discounts on first month subscription in exchange for having the grant access feature
I was thinking of it the other way around.
When you create the Subscription Schedule, you can retrieve the Subscription and it's first Invoice so you can apply the coupons to that Invoice. At that point you know the ID of the first Invoice and can store that, you can then listen for invoice.payment_succeeded events particularly looking for ones that match the ID of the Invoice that you noted earlier. Then you know the Invoice for that first Subscription was paid and can grant access accordingly.
oh, in fact this way is already implemented. I already have the webhook handler for "invoicePayment.succeeded", and it works well. However, on the user's view, when the user do a subscription, the frontend will show as it is correctly subscribed even if the payment failed, there is a little delay for showing the contrary on the frontend.
Hm, that's a good point. How quickly are you planning to add coupons to, and finalize, the draft invoices?
immediately after the schedule is created
Could you change your success page to say that the order is being processed instead of immediately telling them it was successful?
I think yes, but I need to discuss with my team to confirm it. But before that, I have a question about the good way to do in a product view: I am thinking about create on the frontend a loading page between the page about "confirm your subscription" and "your subscription is successful created". And on this page, it will doing a pull event to the backend, to catch the payment.succeeded event. Like user will wait the loading page until the subscription creation is a success/failure.
Did you have an estimation about how long it will take to have an invoicePayment event after an invoice payment request? Could you tell me it is a good way to do?
Those events should be generated within a matter of seconds from the successful payment. I think it's a good idea, but I'd be hesitant to dedicate the entire page to it in case it does take a long time. Personally I'd probably try to put it in a smaller portion of the page, or use the polling to trigger some sort of notification that is presented when the payment is successful, but you know your page best and how to make this align with the look and feel that you're after.
Ok thanks a lot!