In my application. I check for each active subscription once a day to check if they are still valid (I do not use Webhooks, simply a Homemade loop script).
I can successfully retrieve if a Subscription is Cancelled (by the Buyer, or the seller), if a subscription is expired or suspended.
But nothing can tell me if a subscription has been refunded or not. Is there a way to know that type of information by the Paypal REST API ?
Apparently I can't Cancel a subscription after a refund. Is this a bug ? A bad design from paypal ? or did I miss something ?
I found why. A refund only concern a certain payment, not the subscription itself. I just have to get the Subscription-ID, get the last payment of that same subscription, and check his status. The payment can have the refund status. Then I just have to Cancel the subscription if I encounter this status, Done.