How to test IPN for subscription notification?

Robotuner
Contributor
Contributor

I am having a hard time figuring out how to test IPN with a subscription in the sandbox. This is what I have done so far.


1. Create a subscription plan under my sandbox facilitator account. I have verified this by using postman to create a subscription plan and get plan details based on the plan id.

 

2. Create a sandbox buyer and subscribe to the subscription plan by using the subscription buttons created for my when setting up the subscription. This is confirmed to work because I can go to the sandbox facilitator account and see subscription activity in the Notification section.

 

3. I would like to capture the Subscription IPN in my IPNController to look at the IPNRequest Body on my local webserver. The local web server instance is https://localhost:44307 and I have set a breakpoint at https://localhost:44307/IPN/Receive. This is a Visual Studio asp.net core web site. I can hit this URL from Postman.  

 

4. When I log in to my sandbox facilitator account and select Account Settings, then Notifications, then select Edit Instant Payment Notification settings to update, I have tried to enter https://localhost:44307/IPN/Receive as the Notification URL and choose the Receive IPN Messages option. Saving this tells me the Domain name is not a valid IPN URL. I believe the issue is the port, so I used Ngrok to get a URL to route to local host. PayPal appears to accept that and I am able to set the IPN.


Postman doesn't seem to like this arrangement.

 

In postman I can hit the controller using https://localhost:44307/IPN/Recieve

but using the ngrok  URL instead of  gives me a bad request.

 

My goal is to simulate a buyer subscribing using the paypal subscription button and capturing the IPN on my local server to validate the request body.

 

How should I configure the sandbox to do this?

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.