Instant Payment Notification (IPN) and RADIUSdesk
- We use the IPN function from PayPal to notify our RADIUSdesk server about any PayPal transactions.
- These notifications typically happens as soon as a purchase is made through PayPal.
- This means we 'know' before a person is redirected back to the Captive Portal login page about the transaction.
- If the transaction was successful we can auto-fill-in the voucher detail for the user upon return to the login page.
- If an IPN requests comes in from PayPal we can check its contents and if the transaction was successful we will generate a voucher for the person.
- This voucher's attributes (e.g. time valid / size / bandwidth ) will be derived by looking up detail from the IPN data that was submitted by PayPal and comparing it to pre-defined items in our config file.
Activating IPN
- You have to activate IPN in the merchants account before PayPal will send the transaction details through to your server.
- Log into https://www.sandbox.paypal.com with the merchant account.
- Go to My Account → Profile → Selling Tools.
- In the middle of the page will be an item called Instant payment notifications. Select the Update link next to the item.
- This will open a Instant Payment Notification (IPN) page that explains to you what it is.
- At the bottom of that page is a Choose IPN Settings button. Click on that button to continue.
- See the screenshot for a reference. Take notw of the following points.
- By default the Do not receive IPN messages (Disabled) is selected.
- You need to choose Receive IPN messages (Enabled).
- The Notification URL host will be your RADIUSdesk server and has to be reachable on the Internet.
- Our sample URL is http://rd01.wificity.asia/cake2/rd_cake/fin_paypal_transactions/paypal_ipn.json for the server rd01.wificity.asia.
- As a side note you can override the value of the IPN per PayPal button by including a hidden notify_url item.