Google Translate: |
Setting up PayPal IPNNOTE The code modifications to 'transfer.inc.php' are no longer required for CubeCart v4.2.0 onwards.
The easiest way to set up PayPal IPN is to control the payment process and parameters from the cart side, rather than configuring the details within the PayPal account. This enables multiple stores to use the same PayPal account, and still take advantage of IPN.
In the screenshot below, I have entered some demonstration information showing typical PayPal Standard with IPN configuration. The email address used there is the primary email address associated with your PayPal account.
Once you have entered your details, click on 'Edit Config'. Next find the following file: /modules/gateway/PayPal/transfer.inc.php Edit it, and look for the text following the end of the PayPal form data around line 62, which looks like this:
<input type='hidden' name='upload' value='1' />";
Replace it with the following the following directly afterwards:
<input type='hidden' name='upload' value='1' />
<input type='hidden' name='return' value='".$GLOBALS['storeURL']."/index.php?_g=co&_a=confirmed&s=3' /> <input type='hidden' name='cancel_return' value='".$GLOBALS['storeURL']."/index.php?_g=co&_a=confirmed&s=3' /> <input type='hidden' name='notify_url' value='".$GLOBALS['storeURL']."/index.php?_g=rm&type=gateway&cmd=call&module=PayPal' />"; Save and upload. These new settings override PayPal account settings, enabling IPN and auto-return. PayPal Account UpdateLog into PayPal, browse to 'Profile > Website Payment Preferences'.Set Auto Return for Website Payments to On, entering a default return URL. The IPN part of the CubeCart gateway overrides this setting anyway, so you can enter any custom website address. If you are not sure what to use, use your store homepage... http://www.mydomain.com/index.php ... or 'https' depending on whether you're using SSL or not. Set Payment Data Transfer to 'On'. The payment process should now take the customer to PayPal, and after the transaction return successfully to the confirmation page updating the payment status on the order. There is no need to follow the instructions on the dialog to enable IPN in your PayPal account, as this modification overrides the setting in your account. These settings allow multiple stores to use the same PayPal account because any store specific information is passed with the transaction rather than preconfigured in your PayPal account. If the additional stores do not use a return address, the default one entered in the PayPal settings is used. This should be enough to get CubeCart successfully working with IPN, with the benefit of allowing multiple stores with one PayPal address. Please post any feedback you might have on these instructions in the Documentation forum, as we want to ensure the instructions are as helpful and accurate as they can be. |
| Comments, Feedback, Suggestions and Documentation Submissions please post in the Documentation Chat Forum. |