Installing New PayPal module (Latest API 2.0) for osCommerce Version 2.3 Manually

From osCommerce Wiki
Revision as of 14:16, 13 July 2023 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Though we released the new osCommerce 4.x version quite a lot of shop owners keep using the systems based on osCommerce 2. Therefore, we adjusted the new PayPal module supporting Express and APM (Alternative Payment Method) methods for it to work with the systems based on osCommerce 2.


If you customized any of


admin/modules or

includes/classes/payments.php


backup these files.


For example if you have SSH access run


tar -cpzf `date +%y%m%d%H%M`_paypal_rest_bk.tar.gz admin/modules.php includes/classes/payment.php


Use the following link to download the zip.


https://www.oscommerce.com/pub/osc23_customized_paypal_rest.zip

Image 1045.png


Unzip it to the required folder.

Image 1046.png
Image 1047.png


Upload the content of the new_to_upload folder to the public_html folder only using FTP client you normally use. Regarding to_modify folder you can use *_compare.php files from this folder for reference and/or compare tools as well as read the installation instructions in the install.txt file.

Image 1048.png
Image 1049.png


Set write permissions to folders:

ext/modules/payment/runtime/logs

ext/modules/payment/runtime/auth.cache

Image 1050.png
Image 1051.png


Note: Direct access to files in the folders should be denied. There is appropriate .htaccess file in the runtime folder. If you have custom web server configuration please update its settings accordingly.


Now we can start editing 2 core files that were mentioned in this manual above.


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>';

and 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
Image 1052.png
Image 1053.png
Image 1054.png
Image 1055.png

The other 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);

and insert after

             /// paypal_rest
            if ($class == 'paypal_rest' && substr($module, 0, strlen($class)) == $class) {
                $this->selected_module = $class;
            }
            /// paypal_rest EOF

Go to the admin area of your website, click on Modules and Payment tabs and then on PayPal Quick Setup button to configure the new PayPal module.

Image 1056.png

See the links to the videos below demonstrating the new PayPal module integration with systems based on osCommerce 2.

https://www.youtube.com/playlist?list=PLHN7KfrDE8gMtPCprNISvqK2ZWTQdFVVH