I need create integration with our own plugin to be notified when:

Sure. Thanks.
I need create integration with our own plugin to be notified when:
1. Someone buys a membership, and payment is successful.
2. Which membership and type; subscription or one time
3. If free trial, then free trial period
4. When subscription lapses and is not renewed.
5. If not renewed, which level is downgraded to.

Thanks in advance.
nagui