Hi All
I have my code that works fine in PHP 7.2 however in PHP 7.4 I get an error in my error_log file.
My code is:
$result = $gateway->creditCard()->update($creditCardToken, [
‘cardholderName’ => ‘New Holder’,
‘cvv’ => $cvv,
‘number’ => $cardNumber,
‘expirationDate’ => $expMonth.‘/’.$expYear,
‘options’ => [
‘verifyCard’ => true
]
]);
if ($result.success) { DO WHAT I WANT }
The error is:
[01-Dec-2020 06:10:14 UTC] PHP Warning: Use of undefined constant success - assumed ‘success’ (this will throw an Error in a future version of PHP) in /home/filepath/account.php on line 72
Does anyone know how I fix this?
Thanks for any help.
@mrmbarnes - you need to format your code!
chorn
December 1, 2020, 7:55am
3
set the constant or use a string.
Thanks… can you please give me an example?
rpkamp
December 1, 2020, 10:19am
6
Is there literally $result.success
in your code? That is java/javascript notation. I think you’re looking for $result->success
here?
If this is in production I would really double check that you didn’t accept orders that weren’t really paid for …
1 Like
Thanks… no, this is not production yet and I had someone else help me with this code and this is what they gave me… I will change it to what you have suggested… thank you so much.
rpkamp
December 1, 2020, 2:48pm
8
I would advice to test the code thoroughly! If this mistake is in there there is high chance there are more mistakes …
1 Like
system
Closed
March 2, 2021, 9:48pm
9
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.