#RickyU-Subscription

1 messages ยท Page 1 of 1 (latest)

opaque tendon
#

It's explained here

wraith ether
#

Yes i read that, but it doesn't state that when a subscription goes in to "unpaid" how then does it go in the cancelled , and after what period.

opaque tendon
#

No it won't. It will continue to generate Invoice as normal

wraith ether
#

right, in this way what i want to do is trigger a webhook and send an email to the user.
previously i set the setting to "cancel" the subscription if it was past_due, and this would cancel it, but now i cahnged it to unpaid... how then i can i create another webhook for cancelled? or will it not trigger one

#

here is another option in the setting to cancel the subscription after 60 days past due invioce, i wonder if this would work?

#

is this the chain of events :

  • create a subscription (trial)
  • 3 days before trail over a webhook is sent
  • when trail is over a updated webhook is sent switching the status to "active"
  • 1 hour later a invoice is generated and a charge attempt is made.
  • if no cc is on file, the webhook updated is sent with status : unpaid
  • based on setting "smart retires" 4 times for 1 month, the subscription can either be marked as unpaid or cancelled..

am i right with the above.

opaque tendon
#

Yes sounds correct

#

The screenshot's setting can mark the Sub as cancelled yes

#

I am a bit lost, what event that you want to trigger a webhook?

wraith ether
#

im not sure if this will trigger :

#

this is what i am looking for, get webhooks at teh correct time so i can generate emails and update my database.

  1. 3 days before trail ends [trail_end] DONE

  2. when trail_ends i get a update hook that changes the status to active for a short while - DONE, i dont do anything here

  3. when an invoice fails to be paid which is abour an 1hr or so after no.2 the sttus is changed to past_due. this indicates to me that the trail is ended. i sent the user an email

  4. i then want to send another final email to the user 1 week later , warning them of cancellation -- what hook can i look out here.

  5. finally , if 4 attempts are made to charge and no payment method on file, i want to cancel the subscription -- which hook or setting do i need to set here.

#

everything is okay i just nee no. 4 and 5.

opaque tendon
#
  1. I think we don't have any event for that. You would want to track by 1 week after the Invoice failed, verify if the Invoice is still unpaid
wraith ether
#

i though so, okay that is fine for no. 4,, but how abuot for no. 5.. the last screenshot i sent i think will not trigger as that seems to be only for "payments that require confirmation"

opaque tendon
#

For 4. there is an option for 15 days though, on "Manage invoices sent to customers"

wraith ether
#

i dont want stripe to send invoices, i only want webhooks

#

our backend will handle the email,.s

opaque tendon
#

Ah okie, nevermind above

#

Looking for 5

#

Are you setting retry up to 4 times, using Invoice Plus?

wraith ether
#

one way is for instead of changing to "unpaid" i can change it to "cancelled' but this will remove the subscription right after 1 month (4 retires) not sure if i want to do that.

#

im not using invoice plus, im using smart retries 4 times within 1 month.

#

which webhook will i get here. updated ?

opaque tendon
#

How about invoice.payment_failed ? Did you get them?

wraith ether
#

will that trigger one time or once for each of the 4 failed attempts?

#

also when a subscription is cancelled or unpaid will the webhook tell me that it was a trail user or not? thats what i would need to know.

opaque tendon
#

It should be triggered on each of 4 failed attempts.

wraith ether
#

i have set up "charge failed"

#

thats when a card is already on file.

wraith ether
opaque tendon
#

Why would you think it will not trigger? It says if a payment failed last through 15 days the Sub will be cancelled

wraith ether
#

the title of that section is "Manage payments that require confirmation"

#

hence that would mean only for paymetns that need 3ds or actions.

#

yes no??

#

also it clashes with the former smart retires 4 times in 1 month then change the subscription to past_due

opaque tendon
#

Ah right, its' for Invoice's PI that is on require_actions status

wraith ether
#

so to summarize my question when i retry 4 times on a trial account. and it fails, i have the option to change to "unpaid" or "cancelled'

  • will i know in the webhook if it was a trial account that is unpaid or cancelled?
#
  • how do i somehow go from a unpaid to cancelled, or do i need to handle that myself.
opaque tendon
#

Whenever it changed to unpaid or cancelled it's the same webhook event of customer.subscription.updated

#

Inside it there is a Subscription object

#

Am I correct that you want to distinguish between:

  1. If it is a Subscription retried 4 times and failed, then transited into "unpaid" or "cancelled" based on Setting
  2. Or if it is a Subscription simply be canceled or unpaid by your own API?
wraith ether
#

yes i know its all in the updated hooked which i am subscribed to.
i would like to know if the subscription that has been updated to status : unpaid or deleted, weather it was a trial account or not, i have seen the logs and i cant find this information that it was a trial account.. ONLY when the status goes from trailing to active is this data visisble in the updated hook.

#

the reason is i want to send an email to the user saying " your [trail account ]account is cancelled" or [pro account]

#

for example this is the updated event.

#

evt_1L87EOLJFiJSdSFpd9X3Nb3i

#

this event changes the status from past_due to "unpaid" the subscription is still active, BUT the event object doesn't contain any data telling me this user is a trailing user.

#

trialing

opaque tendon
#

By trialing user, do you mean the Subscription had a trial? There is no "Trial user" concept, only "Trial Subscription"

#

evt_1L87EOLJFiJSdSFpd9X3Nb3i -> The Subscription does have trial_end and trial_start, which indicates it is a Sub that had a trial

wraith ether
#

yes i mean trial subscription.

#

oh ok yes it does have a trial_end okay i can use that.

#

one last thing.

#

i found this setting which may work , but i want you to help me check if this will trigger

#

will the above trigger after 60 days past due? even if i have customer emails radio button turned off?

opaque tendon
#

It should be. You can test it using Billing Clock I believe. It's virtual clock that simulate times pass for Subscription

#

๐Ÿ‘‹ I would need to step down for the day. I believe that option should work and you can also test it. If it doesn't please write into Support as a bug report and we are happy to investigate.