Search code examples
wordpresspaypalpaypal-ipn

Custom PayPal Checkout for subscription plan


I want to build a custom PayPal checkout for a single product (subscription plan).

On successful purchase I need to save the current date +30 days to the user profile as well as upgrade the user role to "premium". This part is no problem but I'm having trouble finding how and what I need to use from PayPal.

Could someone point me in the right direction? Is the PayPal IPN service still a thing, or is it legacy?

I checked out some PayPal WordPress plugins but they offer too much esp. an own member solution or integration with WooCommerce, which I don't need. I only need a plugin that handles the checkout and gives me the chance to hook some custom actions on some events for example the successful purchase.


Solution

  • There's no reason to use something old like PayPal IPN. Use the current Subscriptions API, and webhooks for event notifications.

    Subscriptions are documented here: https://developer.paypal.com/docs/subscriptions/integrate/

    And to subscribe to webhooks for later event notification, see webhook event names for subscriptions.


    The Webhook documentation mentions using REST SDKs. Those SDKs are deprecated, use HTTPS API calls.