Jump to content

Opayo (Form)


CubeCart Bot

Recommended Posts

  • 3 months later...

  • 4 years later...

There is mention of a backward incompatibility with PHP8 vs PHP7: "Attempting to read a property of a non-object." We can assume similar incompatibilities with respect to writing, as well as using the 'property accessor' operator to work with arrays.

So, the following edits is an experiment that uses array index syntax:

In the SagePay module, gateway.class.php file:

Near lines 119 and 120, find:
$resultArray[$i]->start = $start;
$resultArray[$i]->token = $Tokens[$i];

Change to:
$resultArray[$i]['start'] = $start;
$resultArray[$i]['token'] = $Tokens[$i];

Near line 129, find:
$valueStart = $resultArray[$i]->start + strlen($resultArray[$i]->token) + 1;

Change to:
$valueStart = $resultArray[$i]['start'] + strlen($resultArray[$i]['token']) + 1;

Near line 132, find:
$output[$resultArray[$i]->token] = substr($thisString, $valueStart);

Change to:
$output[$resultArray[$i]['token']] = substr($thisString, $valueStart);

Near lines 134 and 135, find:
$valueLength = $resultArray[$i+1]->start - $resultArray[$i]->start - strlen($resultArray[$i]->token) - 2;
$output[$resultArray[$i]->token] = substr($thisString, $valueStart, $valueLength);

Change to:
$valueLength = $resultArray[$i+1]['start'] - $resultArray[$i]['start'] - strlen($resultArray[$i]['token']) - 2;
$output[$resultArray[$i]['token']] = substr($thisString, $valueStart, $valueLength);

 

Edited by bsmither
Link to comment
Share on other sites

21 minutes ago, bsmither said:

There is mention of a backward incompatibility with PHP8 vs PHP7: "Attempting to read a property of a non-object." We can assume similar incompatibilities with respect to writing, as well as using the 'array accessor' operator to work with arrays.

So, the following edits is an experiment that uses array index syntax:

In the SagePay module, gateway.class.php file:

Near lines 119 and 120, find:
$resultArray[$i]->start = $start;
$resultArray[$i]->token = $Tokens[$i];

Change to:
$resultArray[$i]['start'] = $start;
$resultArray[$i]['token'] = $Tokens[$i];

Near line 129, find:
$valueStart = $resultArray[$i]->start + strlen($resultArray[$i]->token) + 1;

Change to:
$valueStart = $resultArray[$i]['start'] + strlen($resultArray[$i]['token']) + 1;

Near line 132, find:
$output[$resultArray[$i]->token] = substr($thisString, $valueStart);

Change to:
$output[$resultArray[$i]['token']] = substr($thisString, $valueStart);

Near lines 134 and 135, find:
$valueLength = $resultArray[$i+1]->start - $resultArray[$i]->start - strlen($resultArray[$i]->token) - 2;
$output[$resultArray[$i]->token] = substr($thisString, $valueStart, $valueLength);

Change to:
$valueLength = $resultArray[$i+1]['start'] - $resultArray[$i]['start'] - strlen($resultArray[$i]['token']) - 2;
$output[$resultArray[$i]['token']] = substr($thisString, $valueStart, $valueLength);

 

Thanks a lot, I've just run those changes and it works as a charm !

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...
  • 1 year later...

A customer received an email from Opayo saying the payment system needs to be updated before March 31st I have installed the latest Opayo extension but the site runs on PHP 7.2.
Will SagePay-1.0.13.zip work on PHP 7.2?

If not what's the alternative?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...