I’ve set-up Apple Pay via Square, but am having issues with Apple Pay verifying our domain.
There’s also an issue that’s occurring that took down the website for a few seconds:
This error indicates a type mismatch in a PHP function. Let’s break it down:
Error Explanation
The function EED_SquareOnsiteOAuth::errorLogAndExit() is defined to accept an array as its third parameter ($data).
However, when this function is called on line 437, the third argument passed is a boolean value (true) instead of an array.
The error explicitly points to:
The function definition in /EED_SquareOnsiteOAuth.module.php on line 828.
The location of the problematic call in /EED_SquareOnsiteOAuth.module.php on line 437.
Key Details in the Error
Function Call:
php
Copy code
EED_SquareOnsiteOAuth::errorLogAndExit(Object(EE_Payment_Method), ‘Invalid domain …’, true, true)
The third argument passed here is true (a boolean).
The function errorLogAndExit() expects the third argument to be an array.
Function Definition:
php
Copy code
function errorLogAndExit($paymentMethod, $message, array $data, $exit = true)
Notice the array $data type hint. PHP 7+ enforces this type hint, so passing a non-array value (like true) triggers a TypeError.
Steps to Fix
1. Locate the Code
Go to /EED_SquareOnsiteOAuth.module.php line 437.
Find the function call to errorLogAndExit().
2. Analyze the Arguments
Review the third argument passed to the function. It’s currently true, which is a boolean.
Update this argument to ensure it is an array, e.g., an empty array [] or a properly structured array.