
Originally Posted by
Brent
Having another go at installing this version. I notice this warning was in an
earlier post but as it wasn't the main issue it never got addressed.
PHP Code:
[06-Sep-2022 16:00:53 Europe/London] Request URI: /...../admin/index.php?cmd=orders&page=1&oID=31216&action=edit, IP address: xxx.xxx.xxx.xxx
#1 square_webPay->__construct() called at [/admin/orders.php:521]
#2 require(/admin/orders.php) called at [/admin/index.php:11]
--> PHP Warning: Use of undefined constant MODULE_PAYMENT_SQ_WEBPAY_TESTING_MODE - assumed 'MODULE_PAYMENT_SQ_WEBPAY_TESTING_MODE' (this will throw an Error in a future version of PHP) in /includes/modules/payment/square_webPay.php on line 106.
[06-Sep-2022 16:00:53 Europe/London] Request URI: /..../admin/index.php?cmd=orders&page=1&oID=31216&action=edit, IP address: xxx.xxx.xxx.xxx
#1 square_webPay->__construct() called at [/admin/orders.php:521]
#2 require(/admin/orders.php) called at [/admin/index.php:11]
--> PHP Warning: Use of undefined constant MODULE_PAYMENT_SQ_WEBPAY_ACCESS_TOKEN - assumed 'MODULE_PAYMENT_SQ_WEBPAY_ACCESS_TOKEN' (this will throw an Error in a future version of PHP) in /includes/modules/payment/square_webPay.php on line 111.
I can add quotes to the code to get rid of the warning but I'm not convinced this is the solution as nobody else seems to have the issue.
I am using V1.0.1 from the downloads on Zen V1.5.7d and PHP 7.4
Any pointers please?
hey brent,
that has been fixed, but i have not uploaded it for a new version. you should replace lines 105-118 with the following code:
PHP Code:
$environment = Environment::PRODUCTION;
if (defined('MODULE_PAYMENT_SQ_WEBPAY_TESTING_MODE') && MODULE_PAYMENT_SQ_WEBPAY_TESTING_MODE === 'Sandbox') {
$environment = Environment::SANDBOX;
}
$this->token= '';
if (defined('MODULE_PAYMENT_SQ_WEBPAY_ACCESS_TOKEN')) {
$this->token = MODULE_PAYMENT_SQ_WEBPAY_ACCESS_TOKEN;
}
$this->client = new SquareClient([
'accessToken' => $this->token,
'environment' => $environment,
]);
$this->oauthClient = new SquareClient([
'environment' => $environment,
]);
if (IS_ADMIN_FLAG === true) {
there's actually 4 new lines in there and 2 changed lines.
let me know if you run into any other problems.
best.