Paypal Setup (IPN: Instant Payment Notification System)

Overview
Instant Payment Notification (IPN) is PayPal's message service that sends a notification when a transaction is affected. Once IPN is integrated, sellers can automate their back office so they don't have to wait for payments to come in to trigger order fulfillment. Maian Lockbox supports IPN.
Enable IPN
1. Log into your paypal click the summary icon from the top menu:


2. From the left menu, scroll down and select 'Seller Preferences'.


3. When the screen loads, select 'Instant Payment Notifications'.


4. Click to 'Edit Settings' and enter the url to the 'paypal.php' file in your lockbox root. This should be done ONLY if no url currently exists. Example:

https://www.example.com/lockbox/paypal.php (Replacing the domain/path with your own correct path. Note that you MUST use https and have valid SSL certificate installed)


Make sure the radio button to 'Receive IPN Messages' is selected and click 'Save'. Note that if you already have an IPN url specified for another system, this does not need changing. This should be all you need to activate IPN for your website. Note that you must have a premier or business account for this to function correctly.

Paypal is now ready to go.
Paypal Sandbox
Paypal has a sandbox system for testing. This enables you to test the payment system without taking live payments. For this you need to have a Sandbox account. This is free to web developers and can be found here:

https://developer.paypal.com

There are support forums for you to get help with the IPN system if you are experiencing problems. Once you have a Sandbox account set up you can enable this to test the script out.

To activate in Maian Lockbox, set the payment mode to 'Sandbox' in the admin settings.

NOTE: Sandbox mode can be temperamental at the best of times. Sometimes it works, sometimes it doesn`t.

If the Sandbox mode isn`t working, try a live payment. You can have 2 Paypal accounts, one Personal and one Business. For testing you can then send money between the two accounts.
Passing Additional Payment Parameters
Maian Lockbox allows you to specify additional payment parameters besides the required system ones. This maybe useful if you need to pass a certain parameter to any gateway during purchase. Some gateways have many parameters that enable/disable functions on the checkout page. To add addtional parameters for Paypal, enter array key => value pairs in the following file:

control/classes/payments/inclusions/paypal.php
Performing Additional Actions After Successful Payment
Maian Lockbox allows you to perform additional actions after a successful transaction. This is useful if you need to execute additional code after the payment has been accepted. Edit the following file:

control/classes/payments/triggers/paypal.php

This is for advanced users. The trigger file should NOT return any HTTP headers.
Paypal Sales Tax
DO NOT configure Paypal for sales tax or else your payments may fail. The system checks the amount paid is the same as your package amount. As packages may not contain tax they will be different amounts.
eCheck/eCheque Payments
An eCheck is a payment that a buyer makes directly from their bank account.

Just like a regular check/cheque, it usually takes between 3 and 5 business days for an eCheck to clear and the money to appear in your PayPal account.

Both eChecks and Instant Transfers are ways for a buyer to pay with their bank account. With an eCheck, the recipient receives the money in a few days. With an Instant Transfer, the recipient receives the money right away.

If a buyer uses an eCheck for payment in Maian Lockbox, the payment is automatically marked as pending because the funds won`t be in your Paypal account. If you wish to treat eCheck payments the same as standard payments (ie: completed), set the following to 1 in the 'control/defined.php' file:

define('PAYPAL_PENDING_COMPLETED', 0);
Re-Transmitting IPN Messages
Paypal used to have an easy option to resend IPN transmissions. Where this is located in the new interface is anyones guess. Let me know if you can find it, because I gave up trying to find anything with the new layout. :(