简体   繁体   中英

Paypal rest API billing agreements webhooks

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?

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.

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/

At this point, it seems that webhooks are not the right way to implement Paypal Recurring Payments. This is a recent Github thread where you can see how the workflow might be: https://github.com/paypal/PayPal-REST-API-issues/issues/105

It's answered by one of the PayPal developers. Maybe we must use IPN until the webhooks development is done.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM