Jump to content

Worldpay hosted payments - php7

Recommended Posts


installing wordplay hosted payments 2.2 on CE bootstrap 4 with php - 7.2.14

There are a couple of depreciated PHP elements in  includes/modules/payment/rbsworldpay_hosted.php

The first  being line 16 - 

Function rbsworldpay_hosted {

I changed to 

function __construct() {

and that solved that one, but there is also a "Each" issue

line number 153

while (list(, $value) = each($order_total_modules->modules)) {

I have messed about with it but cannot get it to work, i know it has to be swapped around and be "foreach" but my amateur attempts are not working in this case

my last attempt is

foreach($order_total_modules->modules  as (array $value)) {

anyone with a bit more knowledge of PHP be able to correct it for me and the next person who will undoubtedly have the same issue

Thank you for looking




Share this post

Link to post
Share on other sites

Hi Rainer

Thanks for pointing towards some clues, and for that matter the compliment of thinking I knew how to understand them (if i understood emoji's i would put one in here with my head blowing up)

For anyone else looking for same i replaced the following

lines 152 and 153

      //    reset($order_total_modules->modules);
       //   while (list(, $value) = each($order_total_modules->modules)) {

with this
           foreach($order_total_modules->modules as $value) {

seems to be working as it should now but I am no expert, in fact far from it, so it may help you, but do your own research and test


kindest regards





Share this post

Link to post
Share on other sites

This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

Get the latest Responsive osCommerce CE (community edition) here

Share this post

Link to post
Share on other sites

Hi Gary

actually I first used the version included from the Master, but it stated it was v2 (in the shop), i already had V2.2 running on my other site so just assumed I would be better to download the latest from the add-ons.

In hindsight I should have known that despite it not showing as greater than v2 upon install into the shop that it would have been, could have saved myself a bit of time




Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now