Installing New PayPal module (Latest API 2.0) for osCommerce Version 2.3 Manually
Although osCommerce 4.x is now available, many shop owners continue to use osCommerce 2.3. To support these systems, the new PayPal module (with Express and APM – Alternative Payment Method options) has been adapted to work with osCommerce 2.
Watch the video first for an overview of the installation process.
Read the manual below for step-by-step guidance.
1) Backup Customized Files
If you have customized any of the following files, create a backup before proceeding:
admin/modules.php
includes/classes/payments.php
For example, if you have SSH access, you can run:
tar -cpzf `date +%y%m%d%H%M`_paypal_rest_bk.tar.gz admin/modules.php includes/classes/payment.php
2) Download and Upload Module Files
1. Download the PayPal module package: https://www.oscommerce.com/pub/osc23_customized_paypal_rest.zip
2. Unzip the archive into a local folder.
3. Upload the contents of the new_to_upload folder into your website’s public_html directory using your FTP client.
4. Use the files in the to_modify folder as references. Compare them with your existing files using the included *_compare.php scripts or your preferred file comparison tool.
5. Read the installation instructions in the included install.txt file.
3) Set Permissions
Set write permissions for the following folders:
ext/modules/payment/runtime/logs
ext/modules/payment/runtime/auth.cache
Note: Direct access to these folders must be denied. An .htaccess file is included in the runtime folder. If you use a custom web server configuration, update its settings accordingly.
Now we can start editing 2 core files that were mentioned in this manual above.
4) Modify Core Files
The following modifications must be applied manually.
1. admin/modules.php
- About line 120 Find:
echo ' <td class="smallText" align="right">' . tep_draw_button(IMAGE_MODULE_INSTALL . ' (' . $new_modules_counter . ')', 'plus', tep_href_link(FILENAME_MODULES, 'set=' . $set . '&list=new')) . '</td>';
- Replace with:
///paypal_rest
//echo ' <td class="smallText" align="right">' . tep_draw_button(IMAGE_MODULE_INSTALL . ' (' . $new_modules_counter . ')', 'plus', tep_href_link(FILENAME_MODULES, 'set=' . $set . '&list=new')) . '</td>';
$pp_quick_setup = '';
if ($set=='payment') {
include_once(DIR_FS_ADMIN . 'ext' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'payment' . DIRECTORY_SEPARATOR . 'paypal_rest' . DIRECTORY_SEPARATOR . 'ppp_js.php');
$pp_quick_setup = '<div id="installPPP" style="display:none">'
. tep_draw_button(ADD_PAYPAL, null, 'javascript:void();', 'primary', ['type' => 'button'])
. '</div>';
}
echo ' <td class="smallText" align="right">' . $pp_quick_setup . tep_draw_button(IMAGE_MODULE_INSTALL . ' (' . $new_modules_counter . ')', 'plus', tep_href_link(FILENAME_MODULES, 'set=' . $set . '&list=new')) . '</td>';
///paypal_rest eof
The other editing actions described below should be completed in the similar way as shown on the screenshots above.
2. includes/classes/payments.php
- About line 33 Find:
$include_modules[] = array('class' => $class, 'file' => $value);
- Insert after:
/// paypal_rest
if ($class == 'paypal_rest' && substr($module, 0, strlen($class)) == $class) {
$this->selected_module = $class;
}
/// paypal_rest EOF
5) Configure PayPal Module
- Log in to the Admin area of your website.
- Navigate to Modules → Payment.
- Click the PayPal Quick Setup button to configure the new PayPal module.