So I am integrating the Paypal Rest API with my django site so I can introduce subscription based billing, so far everything is going great.
I have a interface for Billing plans, Billing agreements, Transaction history and everything to create and activate billing agreements ect.
However I need a way to be notified if a billing agreement is cancelled or a payment is made for a billing agreement so I though webhooks would be the way to go for this however I am not 100% sure that webhooks work for billing agreements?
Can anyone suggest a way I can track payments made for billing agreements or another method?
I can confirm that when a recurring payment is executed, one is notified via webhook event PAYMENT.SALE.COMPLETED as described here: https://github.com/paypal/PayPal-Python-SDK/issues/132#issuecomment-261374087
JSON structure of the webhook event:
{
...
"resource": {
...
"billing_agreement_id": "I-38097XVV6XVU"
...
}
...
}
A list of all event names can be found here: https://developer.paypal.com/docs/integration/direct/webhooks/event-names/
This might not be covered by paypal's webhooks notification. You can try it on sandbox and see if you get webhooks notification. Or you can use IPN, you should be able to get IPN notifications.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With