Ok well the new method was installed, I just upgraded and overwrote the files it to the latest version that was available to download from Zen Cart Modules on the website.
Printable View
Ok well the new method was installed, I just upgraded and overwrote the files it to the latest version that was available to download from Zen Cart Modules on the website.
The files for the old Square that need to be maintained for historical reasons are not overwritten by the new WebPay.
no you have misunderstood. The old method has been disabled. The new method was already installed, however it was an older version of the newer method. So it has been upgraded to the latest version of the newer method.
There is Square (the original mod) and Square WebPay (the current mod). Both have had more than one version.
If you used the Square mod to process any past orders, leaving those Square files on your site will allow you to view the complete history for those orders.
I you did not use the Square mod to process any orders, removing the old Square files is optional (some folks are just cumpuslsive about "getting rid" of things). WebPay upgrades are generally done to override existing files with the newer version but always check the readme for any extra instructions.
The old Square is still being loaded with 2.0 as of this date, so many will have the Square files and never have used it for processing.
Hopefully, that clarifies what I was saying.
ok it doesn't really give me any ideas of why I am getting errors.
You are aware that Square was down last week when you reported your error, right?
The are supposedly operational today. https://isSquareUp.com shows the outage on the 7th and 8th.
If you are still having problems, we need to know as many answers to the Posting Tips as you can provide. Also, any error/warning logs should be entered using the # above.
Attachment 20386
I'm now getting these errors as well.
Since you did not answer any of the posting tips, this is possibly more informational than helpful.:( I have no idea if you are using OPC, a template that might be a problem, or some other situation.
A generic decline means that some information was not entered or entered incorrectly. Since the billing address/zip is an important part of the transaction verificaton, payment gateways will never specify to the customer what was "generically" incorrect. It gives information that bad guys can use to get information not found on hte card. Since the newest WebPay is set to not allow checking out without filling the form with all the info, my money's on the information being incorrect.
One problem that comes up in Chrome and other browsers is that it may be set to automatically fill in the shipping/billing and has a tendency to add the city into the Address 2 block. That will cause a generic decline. Another instance is a user with a corporate CC using their home zip instead of that for the card's billing address. Both situations result in a generic decline.
Review every entry on the checkout page
I ran the test.php and the array is coming up empty. I also compared a fresh download of 1.5.7b to my files. There are no differences in the core files.
The OAuth Redirect URL in the module appears to be wrong. It does not include "squareWebPay_handler.php".
Attachment 20388
If I have squareWebPay_handler.php in my OAuth Redirect URL in developer.squareup.com, I get a blank white page when clicking ""Click Here to Log in and Authorize Your Account". But if I leave squareWebPay_handler.php out in my OAuth Redirect URL in developer.squareup.com, it redirects to the website main page, but the token does not update in the payment module.
Do you know why the requested OAuth Redirect URL in the Square Web Payments Module is not requesting squareWebPay_handler.php?
test.fantasycostume.com
zen 1.7.5d
Php 7.4
LOL..type on ver...1.5.7d
xxxxxxx
hallos
Looks like i ran into some error logs on my last plugin i needed to install lol. So this is a test domain. Php 8.1 , zencart 1.5.8b. I am using responsive classic. The last plugin i installed was the latest ceon from the github version 5.1.0. Steven had just given me a fix to a issue i was having with 500 errors. I then moved to install the latest squarewebpay 1.0.4. Now i am getting this error log
[18-Sep-2023 07:07:08 America/Los_Angeles] Request URI: /adminfolder/index.php?cmd=modules&set=payment&module=square_webPay&action=edit, IP address: a actual ip address, Language id 1
#0 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/square/square/src/Models/ListLocationsResponse.php(15): zen_debug_error_handler()
#1 /home/hostingaccountname/domainname/laravel/vendor/composer/ClassLoader.php(571): include('/home/hostingaccountname/...')
#2 /home/hostingaccountname/domainname/laravel/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile()
#3 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#4 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(320): class_exists()
#5 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/square/square/src/Apis/LocationsApi.php(81): apimatic\jsonmapper\JsonMapper->mapClass()
#6 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay.php(831): Square\Apis\LocationsApi->listLocations()
#7 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay.php(842): square_webPay->getLocationsList()
#8 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay.php(1463): square_webPay->getLocationsPulldownArray()
#9 /home/hostingaccountname/domainname/adminfolder/modules.php(322) : eval()'d code(1): zen_cfg_pull_down_squareWebPay_locations()
#10 /home/hostingaccountname/domainname/adminfolder/modules.php(322): eval()
#11 /home/hostingaccountname/domainname/adminfolder/index.php(11): require('/home/hostingaccountname/...')
--> PHP Deprecated: Return type of Square\Models\ListLocationsResponse::jsonSerialize(bool $asArrayWhenEmpty = false) should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/square/square/src/Models/ListLocationsResponse.php on line 87.
[18-Sep-2023 07:07:08 America/Los_Angeles] Request URI: /adminfolder/index.php?cmd=modules&set=payment&module=square_webPay&action=edit, IP address: a actual ip address, Language id 1
#0 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/square/square/src/Models/Location.php(12): zen_debug_error_handler()
#1 /home/hostingaccountname/domainname/laravel/vendor/composer/ClassLoader.php(571): include('/home/hostingaccountname/...')
#2 /home/hostingaccountname/domainname/laravel/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile()
#3 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#4 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(794): ReflectionClass->__construct()
#5 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(540): apimatic\jsonmapper\JsonMapper->createInstance()
#6 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(277): apimatic\jsonmapper\JsonMapper->mapArray()
#7 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(188): apimatic\jsonmapper\JsonMapper->getMappedValue()
#8 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(339): apimatic\jsonmapper\JsonMapper->map()
#9 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/square/square/src/Apis/LocationsApi.php(81): apimatic\jsonmapper\JsonMapper->mapClass()
#10 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay.php(831): Square\Apis\LocationsApi->listLocations()
#11 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay.php(842): square_webPay->getLocationsList()
#12 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay.php(1463): square_webPay->getLocationsPulldownArray()
#13 /home/hostingaccountname/domainname/adminfolder/modules.php(322) : eval()'d code(1): zen_cfg_pull_down_squareWebPay_locations()
#14 /home/hostingaccountname/domainname/adminfolder/modules.php(322): eval()
#15 /home/hostingaccountname/domainname/adminfolder/index.php(11): require('/home/hostingaccountname/...')
--> PHP Deprecated: Return type of Square\Models\Location::jsonSerialize(bool $asArrayWhenEmpty = false) should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/square/square/src/Models/Location.php on line 807.
[18-Sep-2023 07:07:08 America/Los_Angeles] Request URI: /adminfolder/index.php?cmd=modules&set=payment&module=square_webPay&action=edit, IP address: a actual ip address, Language id 1
#0 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/square/square/src/Models/Address.php(14): zen_debug_error_handler()
#1 /home/hostingaccountname/domainname/laravel/vendor/composer/ClassLoader.php(571): include('/home/hostingaccountname/...')
#2 /home/hostingaccountname/domainname/laravel/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile()
#3 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#4 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(260): is_subclass_of()
#5 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(188): apimatic\jsonmapper\JsonMapper->getMappedValue()
#6 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(541): apimatic\jsonmapper\JsonMapper->map()
#7 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(277): apimatic\jsonmapper\JsonMapper->mapArray()
#8 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(188): apimatic\jsonmapper\JsonMapper->getMappedValue()
#9 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(339): apimatic\jsonmapper\JsonMapper->map()
#10 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/square/square/src/Apis/LocationsApi.php(81): apimatic\jsonmapper\JsonMapper->mapClass()
#11 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay.php(831): Square\Apis\LocationsApi->listLocations()
#12 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay.php(842): square_webPay->getLocationsList()
#13 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay.php(1463): square_webPay->getLocationsPulldownArray()
#14 /home/hostingaccountname/domainname/adminfolder/modules.php(322) : eval()'d code(1): zen_cfg_pull_down_squareWebPay_locations()
#15 /home/hostingaccountname/domainname/adminfolder/modules.php(322): eval()
#16 /home/hostingaccountname/domainname/adminfolder/index.php(11): require('/home/hostingaccountname/...')
--> PHP Deprecated: Return type of Square\Models\Address::jsonSerialize(bool $asArrayWhenEmpty = false) should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/square/square/src/Models/Address.php on line 260.
[18-Sep-2023 07:07:08 America/Los_Angeles] Request URI: /adminfolder/index.php?cmd=modules&set=payment&module=square_webPay&action=edit, IP address: a actual ip address, Language id 1
#0 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/square/square/src/Models/BusinessHours.php(12): zen_debug_error_handler()
#1 /home/hostingaccountname/domainname/laravel/vendor/composer/ClassLoader.php(571): include('/home/hostingaccountname/...')
#2 /home/hostingaccountname/domainname/laravel/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile()
#3 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#4 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(260): is_subclass_of()
#5 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(188): apimatic\jsonmapper\JsonMapper->getMappedValue()
#6 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(541): apimatic\jsonmapper\JsonMapper->map()
#7 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(277): apimatic\jsonmapper\JsonMapper->mapArray()
#8 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(188): apimatic\jsonmapper\JsonMapper->getMappedValue()
#9 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(339): apimatic\jsonmapper\JsonMapper->map()
#10 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/square/square/src/Apis/LocationsApi.php(81): apimatic\jsonmapper\JsonMapper->mapClass()
#11 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay.php(831): Square\Apis\LocationsApi->listLocations()
#12 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay.php(842): square_webPay->getLocationsList()
#13 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay.php(1463): square_webPay->getLocationsPulldownArray()
#14 /home/hostingaccountname/domainname/adminfolder/modules.php(322) : eval()'d code(1): zen_cfg_pull_down_squareWebPay_locations()
#15 /home/hostingaccountname/domainname/adminfolder/modules.php(322): eval()
#16 /home/hostingaccountname/domainname/adminfolder/index.php(11): require('/home/hostingaccountname/...')
--> PHP Deprecated: Return type of Square\Models\BusinessHours::jsonSerialize(bool $asArrayWhenEmpty = false) should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/square/square/src/Models/BusinessHours.php on line 55.
[18-Sep-2023 07:07:08 America/Los_Angeles] Request URI: /adminfolder/index.php?cmd=modules&set=payment&module=square_webPay&action=edit, IP address: a actual ip address, Language id 1
#0 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/square/square/src/Models/Coordinates.php(12): zen_debug_error_handler()
#1 /home/hostingaccountname/domainname/laravel/vendor/composer/ClassLoader.php(571): include('/home/hostingaccountname/...')
#2 /home/hostingaccountname/domainname/laravel/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile()
#3 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#4 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(260): is_subclass_of()
#5 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(188): apimatic\jsonmapper\JsonMapper->getMappedValue()
#6 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(541): apimatic\jsonmapper\JsonMapper->map()
#7 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(277): apimatic\jsonmapper\JsonMapper->mapArray()
#8 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(188): apimatic\jsonmapper\JsonMapper->getMappedValue()
#9 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/apimatic/jsonmapper/src/JsonMapper.php(339): apimatic\jsonmapper\JsonMapper->map()
#10 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/square/square/src/Apis/LocationsApi.php(81): apimatic\jsonmapper\JsonMapper->mapClass()
#11 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay.php(831): Square\Apis\LocationsApi->listLocations()
#12 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay.php(842): square_webPay->getLocationsList()
#13 /home/hostingaccountname/domainname/includes/modules/payment/square_webPay.php(1463): square_webPay->getLocationsPulldownArray()
#14 /home/hostingaccountname/domainname/adminfolder/modules.php(322) : eval()'d code(1): zen_cfg_pull_down_squareWebPay_locations()
#15 /home/hostingaccountname/domainname/adminfolder/modules.php(322): eval()
#16 /home/hostingaccountname/domainname/adminfolder/index.php(11): require('/home/hostingaccountname/...')
--> PHP Deprecated: Return type of Square\Models\Coordinates::jsonSerialize(bool $asArrayWhenEmpty = false) should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/hostingaccountname/domainname/includes/modules/payment/square_webPay/square/square/src/Models/Coordinates.php on line 76.
What am i doing wrong here ? This is a clean 1.5.8b install. I thought i was home free too lol
They're only deprecated warnings and will only be a problem if you move to a higher PHP version. You're getting them because Square WebPay v1.0.4 is only valid for up to PHP v8.0
oh ! thank you so much. I was like , what did i break now ? lol So is it okay for me to make a live site using what i have now ? So pretty much just delete them so they don't fill up the folder ?
I'm using this plugin on PHP v8.0 so don't have any issues but I do recall that others have had errors/warnings on live sites with PHP > v8.0 - you will need to look back through this thread to see if any are serious and have solutions. Otherwise, there's a more up to date version (paid) in the author's signature.
Zen Cart 1.5.8a
PHP 8.2
Square 1.0.4
Your transaction failed due to an error: [UNAUTHORIZED] This request could not be authorized.
Error Dump: [UNAUTHORIZED]: This request could not be authorized.
There are error log files but they contain no further information on why it could not be authorized.
Try it with 8.0
I went into the plugin, clicked, edit, changed nothing and saved. Now transactions process. We had a different error about a month ago and the same steps fixed it then. The error was:
Your transaction failed due to an error: [UNAUTHORIZED] The `Authorization` http header of your request was incorrect or expired. The header value is expected to be of the format "Bearer TOKEN" (without quotation marks), where TOKEN is a valid access token (e.g. "Bearer ABC123def456GHI789jkl0").
I'll change the PHP to 8.0. Seems unlikely that is the issue, but worth a try.
@carlwhat
Hallo,
I was wondering. Is there a way to rebill a past customer with this app ? They asked if we could change them and send another order of a item we carry.
within ZC and square webPay, there is no ability to re-bill a customer using a credit card that they previously entered.
i would think that ability could be built into the app; but it currently is not done.
there might be a way to charge the customer from the square dashboard. one would need to track down the original transaction and see what options might be available to do that.
i do not have any clients that use this payment module, so i have no real access to a live dashboard. my developer dashboard does not allow for add-on transactions.
you can do a little bit of reading on the square website.
Even though it's a matter of having to get their card info over the phone, you can use the Place Order function discussed at https://docs.zen-cart.com/user/runni...n_as_customer/.
Log in as them, and enter their card data as they give it to you. You will get the same rate as if the customer entered their data instead of being charged for entering the card data in Square or by invoice.
Zen Cart 1.5.8
PHP 7.4
MySQL 8.0.34
OPC 2.4.5
Square WebPay 1.0.4
This store recently sold. It was working fine, switched the Square account to the new owner and it works fine. However, previous orders in the orders screen cannot be viewed with the following error.
[05-Oct-2023 17:23:22 America/New_York] Request URI: /xx/index.php?cmd=orders&page=1&oID=10030690&action=edit, IP address: 000.000.000.000
--> PHP Fatal error: Uncaught Error: Call to a member function getOrders() on array in /home/xxx/public_html/includes/modules/payment/square_webPay.php:913
Stack trace:
#0 /home/xxx/public_html/includes/modules/payment/square_webPay.php(526): square_webPay->lookupOrderDetails(10030690)
#1 /home/xxx/public_html/xx/orders.php(741): square_webPay->admin_notification(10030690)
#2 /home/xxx/public_html/xx/index.php(11): require('/home/xxx/...')
#3 {main}
thrown in /home/xxx/public_html/includes/modules/payment/square_webPay.php on line 913.
Were the previous orders done with 1.0.4 as well? It was necessary to keep the old square files for some older orders to be seen on some sites but they were made with the old Square, not WebPay.
m,
we have an order, 10030690, and we are trying to get the details of that order.
was that order processed using square_webPay or the old square version? do you know? what is the date of the order?
when you say, reinstalled and configured, is the configuration new from the time the order was originally placed?
is this problem just occurring for this order or for all orders?
just before line 113 which has the getOrders call you can add:
and then post the results of the corresponding log file. and we can take a look at what is happening.PHP Code:
if (is_array($response['results'])) {
trigger_error(json_encode($response['results']));
return new Models\Order;
}
best.
it does seem like the response object is an array, and the first element is called error, and i have a feeling that might be true.
i have a distinct feeling you are using the wrong, sdk. in the square dashboard, you should be using SDK version: 17.2.0.20220216.
when i used that sdk, and the response['results'] was an array, no error occurred.
hope that helps.
Yes, like
index.php?cmd=orders&page=1&oID=10030686&action=edit
for example.
Same version, same files, same store etc.... Only difference is different merchant.
All Square orders prior to switching the merchant information for Square.
Yes
All Square orders prior to switching the merchant information for Square.
913
[05-Oct-2023 21:34:50 America/New_York] Request URI: /admin/index.php?cmd=orders&page=1&oID=10030690&action=edit, IP address: 000.000.000.000
--> PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function Square\Models\Order::__construct(), 0 passed in /home/xxx/public_html/includes/modules/payment/square_webPay.php on line 915 and exactly 1 expected in /home/xxx/public_html/includes/modules/payment/square_webPay/square/square/src/Models/Order.php:172
Stack trace:
#0 /home/xxx/public_html/includes/modules/payment/square_webPay.php(915): Square\Models\Order->__construct()
#1 /home/xxx/public_html/includes/modules/payment/square_webPay.php(526): square_webPay->lookupOrderDetails(10030690)
#2 /home/xxx/public_html/admin/orders.php(741): square_webPay->admin_notification(10030690)
#3 /home/xxx/public_html/admin/index.php(11): require('/home/xxx/...')
#4 {main}
thrown in /home/xxx/public_html/includes/modules/payment/square_webPay/square/square/src/Models/Order.php on line 172.
Thanks =)
ok. you have new credentials. and you are trying to get the details of an order that made use of previous credentials. that is the problem you are experiencing.
i would like to point out that i do not use square (nor do any of the few clients i have); and i only decided to code this module at the request of one of the admins.
i tried to follow the path of the previous square module, and really i never liked the idea of making an API call every time someone is looking at an order in the admin. it is a waste of bandwidth IMO, and totally unnecessary. if one looks at my authorize.net card on file module, i only make API calls when needed, ie when refunded or doing an add-on transaction, etc.
for those of you that are experiencing this error, here is the solution. script:
includes/modules/payment/square_webPay.php
lines 912 -913 on version 1.0.4
PHP Code:
//from
$response = $this->processResult($apiResponse, $request);
return $response['results']->getOrders();
//to
$response = $this->processResult($apiResponse, $request);
if ($response['errors']) {
return [];
}
return $response['results']->getOrders();
It doesn't work for me.
Here is what I have
Here is the errorCode:$request = new Models\BatchRetrieveOrdersRequest($ids);
try {
$apiResponse = $this->client->getOrdersApi()->batchRetrieveOrders($request);
//orders fix (https://www.zen-cart.com/showthread.php?228750-Square-WebPay-support-thread&p=1397245#post1397245)
//$response = $this->processResult($apiResponse, $request);
//return $response['results']->getOrders();
$response = $this->processResult($apiResponse, $request);
if ($response['errors']) {
return [];
}
return $response['results']->getOrders();
} catch (\SquareConnect\ApiException $e) {
return new Models\Order;
}
}
[06-Oct-2023 10:10:23 America/New_York] Request URI: /XX/index.php?cmd=orders&page=1&oID=10030684&action=edit, IP address: 000.000.000.000
--> PHP Fatal error: Uncaught Error: Call to a member function getOrders() on array in /home/XXX/public_html/includes/modules/payment/square_webPay.php:919
Stack trace:
#0 /home/XXX/public_html/includes/modules/payment/square_webPay.php(526): square_webPay->lookupOrderDetails(10030684)
#1 /home/XXX/public_html/XX/orders.php(741): square_webPay->admin_notification(10030684)
#2 /home/XXX/public_html/XX/index.php(11): require('/home/XXX/...')
#3 {main}
thrown in /home/XXX/public_html/includes/modules/payment/square_webPay.php on line 919.
before the getOrders, aka, the error line, add
and post that log.PHP Code:
trigger_error('Response: ' . json_encode($response));
[06-Oct-2023 10:32:26 America/New_York] Request URI: /xxx/index.php?cmd=orders&page=1&oID=10030689&action=edit, IP address: 134.215.175.155
--> PHP Fatal error: Uncaught Error: Call to a member function getOrders() on array in /home/xxx/public_html/includes/modules/payment/square_webPay.php:920
Stack trace:
#0 /home/xxx/public_html/includes/modules/payment/square_webPay.php(526): square_webPay->lookupOrderDetails(10030689)
#1 /home/xxx/public_html/xxx/orders.php(741): square_webPay->admin_notification(10030689)
#2 /home/xxx/public_html/xxx/index.php(11): require('/home/xxx/...')
#3 {main}
thrown in /home/xxx/public_html/includes/modules/payment/square_webPay.php on line 920.
you are not posting the contents of:
trigger_error('Response: ' . json_encode($response));
i need a log file that starts with:
Response:
if you want more help.
try:
PHP Code:
trigger_error('Response: ' . json_encode($response), E_USER_WARNING);
[09-Oct-2023 06:03:08 America/New_York] Request URI: /XX/index.php?cmd=orders&page=1&oID=10030681&action=edit, IP address: 000.000.000.000
#1 trigger_error() called at [/home/XXX/public_html/includes/modules/payment/square_webPay.php:919]
#2 square_webPay->lookupOrderDetails() called at [/home/XXX/public_html/includes/modules/payment/square_webPay.php:526]
#3 square_webPay->admin_notification() called at [/home/XXX/public_html/XX/orders.php:741]
#4 require(/home/XXX/public_html/XX/orders.php) called at [/home/XXX/public_html/XX/index.php:11]
--> PHP Warning: Response: {"error":true,"results":[{"category":"AUTHENTICATION_ERROR","code":"FORBIDDEN","detail":"Cannot fetch orders for a different merchant."}]} in /home/XXX/public_html/includes/modules/payment/square_webPay.php on line 919.
[09-Oct-2023 06:03:08 America/New_York] Request URI: /XX/index.php?cmd=orders&page=1&oID=10030681&action=edit, IP address: 000.000.000.000
--> PHP Fatal error: Uncaught Error: Call to a member function getOrders() on array in /home/XXX/public_html/includes/modules/payment/square_webPay.php:920
Stack trace:
#0 /home/XXX/public_html/includes/modules/payment/square_webPay.php(526): square_webPay->lookupOrderDetails(10030681)
#1 /home/XXX/public_html/XX/orders.php(741): square_webPay->admin_notification(10030681)
#2 /home/XXX/public_html/XX/index.php(11): require('/home/XXX/...')
#3 {main}
thrown in /home/XXX/public_html/includes/modules/payment/square_webPay.php on line 920.
look back at this post.
TSIS.PHP Code:
//from
if ($response['errors']) {
//to
if ($response['error']) {
Have it working now with webpay
the square would not work for me.
Has anyone here managed to get Apple Pay to work via the Square Web Pay plugin. On Square's developer site it seems to say that as well as verifying the domain we need to add some code to certain pages on our site.
Can anyone help with this as ApplePay seems to be getting quite popular.
Thanks as always
Step 2: Attach Apple Pay to the page
The Apple Pay payment method needs information about the buyer and the payment amount before it can open the Apple Pay sheet. Your application creates a PaymentRequest object to provide that information and then gets a new ApplePay object initialized with it.
The following code creates the payment request and attaches the ApplePay method to the page:
Add an HTML element to the prerequisite walkthrough form with an ID of apple-pay-button. The HTML for the body of index.html should look like the following:
<form id="payment-form">
<!-- Add the below element -->
<div id="apple-pay-button"></div>
<div id="card-container"></div>
<button id="card-button" type="button">Pay $1.00</button>
</form>
<div id="payment-status-container"></div>
Add a style element and button style properties in the <head> tag. For a reference of Apple Pay button styles, see Styling the Apple Pay Button Using CSS.
Add the following functions to the script tag:
function buildPaymentRequest(payments) {
return payments.paymentRequest({
countryCode: 'US',
currencyCode: 'USD',
total: {
amount: '1.00',
label: 'Total',
},
});
}
async function initializeApplePay(payments) {
const paymentRequest = buildPaymentRequest(payments)
const applePay = await payments.applePay(paymentRequest);
// Note: You don't need to `attach` applePay.
return applePay;
}
In the DOMContentLoaded event listener, add the following code after you initialize the ApplePay method:
let applePay;
try {
applePay = await initializeApplePay(payments);
} catch (e) {
console.error('Initializing Apple Pay failed', e);
// There are a number of reason why Apple Pay might not be supported.
// (such as Browser Support, Device Support, Account). Therefore you should
// handle
// initialization failures, while still loading other applicable payment
// methods.
}
I'm encountering a problem since my upgrade to 1.5.8a from 1.5.7
PHP Version: 7.4.33 (host wont upgrade to 8.X, moving hosts next month)
Refreshed token, everything is green on the admin of square webpay module.
When a customer completes and pays for an order, the order in admin says this at the top.
"The configuration of the order's payment module (square_webPay) has changed. No refunds, auths, captures or voids can be done for this order."
Order comes through but payment is basically DOA, module is set for authorization but can't capture,void, or do anything.
What could be causing this error?
you need to look at the code right here:
https://github.com/zencart/zencart/b....php#L517-L520
specifically line 518. one of those 3 conditionals is failing.
it works fine on my test system. not sure what could be causing that.
line 518 from 1.5.8 admin/orders.php is exactly the same as the github code.
Interesting enough, I rolled the 1.5.7d admin/orders.php file back and it works again.
What else should I look for?
This may help. Let us know if it works for you.
https://developer.squareup.com/docs/...ents/apple-pay
Yup, that is what I looked at. Spoke to Square to see where to put that extra code and they said it would need to be sorted in the Zen Cart plugin
"This is Cris from Square Customer Success.
Regarding your query about integrating Apple Pay with Zen Cart. Although Square integrates with Zen Cart to process payments, all API functions are operated and managed by them directly. For help with Zen Cart specific questions, you’ll need to contact their Support Team."
I really hate jumping into such questions, but I'll make an exception this time.
Updating the SDK is not a 2-3 line difference, especially not with payment plugins which are IMHO the most critical part of a store - you're handling very sensitive information and there's no margin for error in this step.
There *is* a version available with a newer SDK which works on php 8.1 (and 8.2). carlwhat was generous enough to share the plugin that worked in most cases for quite a long time and has so patiently provided support for it. If you *really* need an updated version, you can show some author support and buy the newer version of the plugin from the same person who shared the free version at a more-than-reasonable price... Or, as an alternative, dig in and read the docs provided by Square and release an updated version... :wink2:
I can second that as I've been running the the mentioned version on php 8.1 all year without any issues. Look in @carlwhat's signature.
Hi All,
Just made my site live and have an issue with square which is that it puts in two payments on an order and when I click to delete a payment I get this error message:
Fatal error: Uncaught TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, bool given in /home/xxxx/outdoorking.com.au/xxxx/super_payments.php:456 Stack trace: #0 /home/xxxx/outdoorking.com.au/xxxxx/index.php(11): require() #1 {main} thrown in /home/xxxx/outdoorking.com.au/xxxx/super_payments.php on line 456
The transaction are going through ok.
Any assistance would be a great help.
It appears that it is from super orders here: https://www.zen-cart.com/downloads.php?do=file&id=155
Would this be a conflict with Square Webpay because it has an sql script.
Should I uninstall the super orders module?
Occasionally I get a complaint from a customer that they were unable to make a payment - and my zencart is showing them this error -
Your transaction could not be completed due to a misconfiguration in our store. Please report this error to the Store Owner: SQ-MISCONF
Checking the relevant myDEBUG file it's getting triggered by the square_webPay module at line 235 -
trigger_error('missing token result: ' . json_encode($_REQUEST));
So why does a customer on the odd occasion have a missing token? And is there anything I can do to resolve this?
there are plenty of posts on this issue.
in addition, according to my records, that specific error message was changed ~19 months ago.
your customer does not have javascript enabled on the browser he is using to purchase your product.
i would suggest updating to the latest version. and buying your customer a new computer...
best.
The new computer comment seems about right. I'm yet to hear back from my customer - however I do know they were using safari, and I found a comment online about square SDK not working with versions 11 and under.
I was able to replicate the error using testingbot.
as i stated somewhere above, you need to be on the latest version of this module.
in addition, i am not sure what your testingbot does, or how it does it. for all i know, your testingbot disables javascript, and then is able to reproduce the error.
unfortunately, there is nothing i can do about that. this version of square makes use of javascript. if javascript is disabled, it will not work.
if however, you are able to provide some reproducible circumstances that your testingbot created with javascript enabled, please post them. i would be interested.
i think you are selling yourself short here; i would try a google search to see how to disable javascript on an apple.Quote:
Originally Posted by royaldave;
as i have previously stated, i have zero customers using square. but i did set up a test site on the internet and spun up my apple laptop. it is running:
Sonoma 14.2.1 (23C71)
which i believe is reasonably current. i was then able to place an order using chrome and safari. those browser versions were:
Chrome is up to date
Version 120.0.6099.234 (Official Build) (arm64)
safari
Version 17.2.1 (19617.1.17.11.12)
you have numerous customers placing orders successfully; some can not. one customer insists everything on his computer is current and yet can not place an order. as i previously stated, i do believe the problem lies there, and not with this code. but feel free to add something new. code does have bugs, and can always be improved.
best.
The fact here is that most of the time it is something they enabled, changed, added or otherwise screwed around with all their browser settings. Malware or a BHO in their browser....
There will always be people who report issues and like I said most times it's them, but you can't help most of them. Sometimes you just have to tell them to try a different device.
Also, Apple seriously does whatever it wants with regard to web standards.... Always have.
~Melanie
no, i did not. perhaps zero clients using square is more appropriate.
my few clients use my authorize net plugin; and some form of the dreaded paypal. i host them all on linux servers, and i use a linux workstation for my own development.
some clients use apple for their own workstations; but in general, i do not.
i only coded this module as someone asked me to do it. so i did it for the community. setting up very specific environments to simulate what a store's customer might have, is a bit of work. but i do want to ensure that the code works for most environments.
hope that answers your question.
I can confirm that Square works fine on my iMac. As @carlwhat noted, the OP's installation is out of date.
1.5.8a
Tried with both PHP 7.4 and 8.0
version 1.04 of WebPay
OPC
EO (Can edit the orders with this)
bootstrap template
This just cropped up for one site and the solutions mentioned earlier made things worse.
Here's what we started getting a couple of weeks ago (today's version/date):
When adding the suggested code in post #527, the error changes to:Code:[17-Jan-2024 15:26:21 America/Denver] PHP Fatal error: Uncaught Error: Call to a member function getOrders() on array in /includes/modules/payment/square_webPay.php:913Stack trace:
#0 /includes/modules/payment/square_webPay.php(526): square_webPay->lookupOrderDetails(1570)
#1 /******/orders.php(740): square_webPay->admin_notification(1570)
#2 /******/index.php(11): require('/home/******/...')
#3 {main}
thrown in /includes/modules/payment/square_webPay.php on line 913
[17-Jan-2024 15:26:21 America/Denver] Request URI: /******/index.php?cmd=orders&origin=index&page=1&oID=1570&action=edit, IP address: 12.34.56.78
--> PHP Fatal error: Uncaught Error: Call to a member function getOrders() on array in /includes/modules/payment/square_webPay.php:913
Stack trace:
#0 /includes/modules/payment/square_webPay.php(526): square_webPay->lookupOrderDetails(1570)
#1 /******/orders.php(740): square_webPay->admin_notification(1570)
#2 /******/index.php(11): require('/home/******/...')
#3 {main}
thrown in /includes/modules/payment/square_webPay.php on line 913.
I do not know if EO has to run the API to get its info but, we are able to edit orders. However, EO does not provide capture or refund capabilities. We set everything to capture versus authorize and have been refunding (where needed) thru Square.Code:[18-Jan-2024 10:47:02 America/Denver] Request URI: /******/index.php?cmd=orders&page=1&oID=1570&action=edit, IP address: 12.34.56.78, Language id 1#1 square_webPay->lookupOrderDetails() called at [/includes/modules/payment/square_webPay.php:526]
#2 square_webPay->admin_notification() called at [/******/orders.php:740]
#3 require(/******/orders.php) called at [/******/index.php:11]
--> PHP Warning: Undefined variable $apiResponse in /includes/modules/payment/square_webPay.php on line 911.
[18-Jan-2024 10:47:02 America/Denver] PHP Fatal error: Uncaught TypeError: square_webPay::processResult(): Argument #1 ($apiResponse) must be of type object, null given, called in /includes/modules/payment/square_webPay.php on line 911 and defined in /includes/modules/payment/square_webPay.php:473
Stack trace:
#0 /includes/modules/payment/square_webPay.php(911): square_webPay->processResult(NULL, Object(Square\Models\BatchRetrieveOrdersRequest))
#1 /includes/modules/payment/square_webPay.php(526): square_webPay->lookupOrderDetails(1570)
#2 /******/orders.php(740): square_webPay->admin_notification(1570)
#3 /******/index.php(11): require('/home/******/...')
#4 {main}
thrown in /includes/modules/payment/square_webPay.php on line 473
[18-Jan-2024 10:47:02 America/Denver] Request URI: /******/index.php?cmd=orders&page=1&oID=1570&action=edit, IP address: 12.34.56.78
--> PHP Fatal error: Uncaught TypeError: square_webPay::processResult(): Argument #1 ($apiResponse) must be of type object, null given, called in /includes/modules/payment/square_webPay.php on line 911 and defined in /includes/modules/payment/square_webPay.php:473
Stack trace:
#0 /includes/modules/payment/square_webPay.php(911): square_webPay->processResult(NULL, Object(Square\Models\BatchRetrieveOrdersRequest))
#1 /includes/modules/payment/square_webPay.php(526): square_webPay->lookupOrderDetails(1570)
#2 /******/orders.php(740): square_webPay->admin_notification(1570)
#3 /******/index.php(11): require('/home/******/...')
#4 {main}
thrown in /includes/modules/payment/square_webPay.php on line 473.
THANX in advance for your assitance
We are now receiving emails stating:
Code:Jan-18-2024 11:01:54
=================================
Error Dump: [UNAUTHORIZED]: This request could not be authorized.
Sent to Square: SquareModelsBatchRetrieveOrdersRequest Object
(
[locationId:SquareModelsBatchRetrieveOrdersRequest:private] =>
[orderIds:SquareModelsBatchRetrieveOrdersRequest:private] => Array
(
[0] => nwMNvXeqAS9HsQJmL72KKDSDZtOZY
)
)
Hi
I never suggested there was an issue with the code - I am convinced its an environment issue - I'd just like to have a solution to give my clients.
I fully understand how to switch on/off javascript in safari, but the fact they claim it then also doesn't work in chrome on the same device is what's throwing me - that really was my question.
I've been using Square Webpay successfully with no problems for 6 months or so on 6 shops managed by myself.
Yesterday, a customer tried to pay on one of the shops and the payment failed with a message similar to
"Authorization failed to instantiate...."
This shop is running on
Zen Cart 1.5.8a
PHP Version: 8.1.27
I've tested this myself and the problem is with Zen Cart and Square Webpay. My other 5 shops are all running fine on the same version of Square, PHP and either Zen Cart 1.5.8 or 1.5.7.
I have created a new Application ID and OAUTH (application secret) on the afflicted shop and entered these details into my Zen Cart Square Webpay module but when I click on the link "click here to log in and authorize your account" I just get a completely blank screen.
I've checked and rechecked (repeatedly) and I can't find the error.
I've tried 3 different browsers with the same result. I've deleted cookies, browsing history etc.. and I'm still getting a blank screen.
Please help!
Which version of Square WebPay?
Noting that the version in Plugins is only guaranteed to work up to PHP 8.0 with ZC v1.5.6 & v1.5.7 (You might have got lucky with your ZC 1.5.7 & 1.5.8 sites, especially if you've applied some of the code changes which, from memory, have been mentioned in this thread.)
A blank screen should have generated a debug file in your logs folder.
----------------------------------------------------------------------------------------------------
I'm using Square Webpay 1.0.4 I think this is the latest version.
Debug log:
[31-Jan-2024 15:53:44 Europe/London] PHP Fatal error: Uncaught Error: Found unconstructed IntlDateFormatter in /mydomain/includes/classes/zcDate.php:92
Stack trace:
#0 /mydomain.co.uk/includes/classes/zcDate.php(92): IntlDateFormatter->getPattern()
#1 /mydomain.co.uk/includes/classes/zcDate.php(39): zcDate->initializeConversionArrays()
#2 /mydomain.co.uk/includes/autoload_func.php(47): zcDate->__construct()
#3 /mydomain.co.uk/includes/application_top.php(237): require('/homepages/0/d2...')
#4 /mydomain.co.uk/squareWebPay_handler.php(23): require('/homepages/0/d2...')
#5 {main}
thrown in /mydomain.co.uk/includes/classes/zcDate.php on line 92
[31-Jan-2024 15:53:44 Europe/London] Request URI: /squareWebPay_handler.php?nocache=1&_=1706715189779, IP address: 2a00:23c7:c69e:3501:bd68:4ef8:dcdc:8ba9
--> PHP Fatal error: Uncaught Error: Found unconstructed IntlDateFormatter in /mydomain.co.uk/includes/classes/zcDate.php:92
Stack trace:
#0 /mydomain.co.uk/includes/classes/zcDate.php(92): IntlDateFormatter->getPattern()
#1 /mydomain.co.uk/includes/classes/zcDate.php(39): zcDate->initializeConversionArrays()
#2 /mydomain.co.uk/includes/autoload_func.php(47): zcDate->__construct()
#3 /mydomain.co.uk/includes/application_top.php(237): require('/homepages/0/d2...')
#4 /mydomain.co.uk/squareWebPay_handler.php(23): require('/homepages/0/d2...')
#5 {main}
thrown in /mydomain.co.uk/includes/classes/zcDate.php on line 92.
I think this is a known issue introduced with PHP 8.1 & 8.2 - https://www.zen-cart.com/showthread....09#post1397609
This post seems to have the fix - https://www.zen-cart.com/showthread....01#post1398201
Newby question. I have a module for my credit card processor currently. They seem to be charging me more than what seems reasonable, so I'm looking for a new module. I was looking at paypal, but then saw this. Can I add this in addition to the existing module? Currently at check out, the can choose credit card (current processor) or a "bill me" option. Can I install this and have it as another choice in the list or will this rearrange my whole checkout? Being able to go back to something that works well is my main concern. Running vc 1.57 Thanks
> Can I install this and have it as another choice in the list
You could, but you probably would want to disable the other CC module. Having two CC modules on the payment page would be confusing to customers.
Follow the installation instructions very carefully. Pitfalls abound!
https://docs.zen-cart.com/user/payment/square/
Version 1.58a
Latest bootstrap template 3.6.3
8.1 php
Square_webpay version 1.0.4
Hi all,
I have an issue with the square webpay module which is taking orders (no issue and recording items purchased on the square site) but for some reason the admin is only recording the total amount and not the items that are purchased.
Can someone guide me into the right direction like file that needs to be edited and code would be a great help.
Thanks again.
Hello,
Does someone already had this issue? I paid with my CC for a total amount of $13,79, the Square payment process pass without any issue, Square charged only once, but I find two payments records inside my order.
I'm using ZC 1.57d + square-webpay with the right API version on php 7.33
Still have the old Square plugin, but not installed.
Does someone have any clue ?
Thanks
the square webpay module creates 1 record in the square_payments table in the method after_process.
unfortunately this web forum's image handler is not good. it is rather difficult to see your attached image.
i have a distinct feeling that this web forum software could be better configured to allow larger images with better resolution. in addition, people have complained about the search function on this forum software for quite some time. i'm hopeful that perhaps an admin can look at and make these elements of this forum software better... but alas i digress...
from the looks of the fuzzy image, my best guess is that you are using super orders or a modified version of said plugin. i do not believe that specific plugin has been modified in quite some time. i see a table heading called last modified; which is a field that is not contained in the square payments table; nor is the field payor name.
as those fields are not created by the square webpay module, i would venture to guess that the problem does not reside with square webpay.
if, however, you can somehow demonstrate that there are 2 records in the square_payments table for a single charge, perhaps i can take a look at it. but even then, i would think that there would be more people complaining about said issue.
i would look at your super orders payment table (if you have one), and see where it is creating those records.
that is my best guess as to what might be going on.
You're right, I found 1 record in square_payments and 2 in so_payments. Do you know how it possible ? I tried to remove the old Square, but doesn't change the situation, even it create new bug. Thanks for your help.
without looking at your specific installation, it is hard for me to venture a guess.
super orders had some good things in there, and specifically i found the handling of payments, refunds and voids to be quite useful. ZC does not really keep track of payments in a manner that i found adequate. at one point, i had a discussion about providing a framework for all payment modules that would incorporate payment records into the base ZC. unfortunately, i ran out of steam on that initiative as it proved to be quite a daunting task.
alas, i digress yet again.
back to your specific problem, i would perhaps ask in the super orders support forum. at one point, there was some movement on updating that module; i think jsweb and torvista may have been involved.
best.
Thanks Carl, I will ask to Super Order group.
Hello, does someone have a recipe to configure Square webpay using Square SANDBOX. I'm not sure I understand what to do with the extra questions when you select SANDBOX application ID & token.
Thanks
Hi Carl,
I try to configured my DEV website connect to my SQUARE SANDBOX. But I can't make it works, the bullet always stay "Yellow".
what I did:
1) I define in the Square developer Sandbox the URL of my DEV website: https://www.pechesudv155.owally.com/...ay_handler.php
2) I define the Application ID and Application Secret (OAuth) with my Square Sandbox key, enable Enable Square Module (True)
3) I see the URL https://www.pechesudv155.owally.com/...ay_handler.php and try to click on the green message "Click here to login and authorize your account"
4) but I receive a message from Square, telling to me : To start the OAuth flow for a sandbox account, first launch the seller test account from the Developer Dashboard.
5) So on Square panel, I click on "Authorize an account" and "Default test account", with the "default test account" I got a window with the Access token inside.
6) So i go back Square Web Payments Module and input the "access token" to the field "Sandbox Merchant Token"
But the bullet still stay yellow.
Could tell to me what I do wrong ?
I check the SQUARE API log, I saw few transactions with answer corresponding to my connect try, don't know if it help.
peter,
unfortunately, i can not provide any additional support for the sandbox set up. it is there for developers to work with.
it seems that you had square working and that your problem was with super orders. so now you want to move on to enabling a sandbox account on your live site so that you can get it working with super orders? noting that super orders is a product that has not been updated for quite some time.
there is a lot going on; and unfortunately i do not have the time to resolve your sandbox set up.
maybe someone else can help you out; but it goes beyond what i am able to provide in this free forum.
best.
As a suggestion, rather than trying to create a sanbox setup, just create a second production App for your test environment (give it a meaningful name like "testWebPay") and run $1 transactions against it.
Thanks Carl, I understand. I will try to reinstall everything without Super Order.
ZC 1.5.7d
Bootstrap template with One Page Checkout
The square plugin works as expected except for one bug.
A customer at checkout enters their CC information but not the zip code for example and continue with placing order.
The page stays / refresh to the same checkout page but freezes ( shadowed screen). The customer has no other option than to abandon checkout and start over.
Is there a fix for this?
Hope this makes sense, it just hard to explain sometimes.
Thank you for your help
I am also getting the following in the logs:
thank youQuote:
[18-Mar-2024 21:16:20 America/Los_Angeles] PHP Notice: missing token result: should not get here. check that you have the latest jscript_square_webpay file and that you are not having javascript errors in the console. in /includes/modules/payment/square_webPay.php on line 261
nick,
please post what version of OPC you are using as well as your php version. also what version of square webPay.
with regards to your first issue, it does not make sense. OPC has address information on it, ie bill to and ship to information. square webPay has nothing to do with those fields. the square webpay fields are completely controlled by the square javascript. square will request a zip code in its own window and if you do not fill it in, you can not complete the posting. in my testing, i could not get past that part as square highlights that you need to fill in a zip code.
your log message indicates that you are most likely using version 1.0.3 of square webPay.
is square webPay your only payment method?
the error log in your 2nd post indicates to me one of the 3 potential scenarios:
- you potentially only have square as an available payment method.
- you are using a older version of OPC.
- OPC is not properly configured.
i would update square webpay to version 1.0.4. i would then ensure that you have a key for OPC called:
CHECKOUT_ONE_PAYMENT_METHODS_THAT_SUBMIT
and then ensure that key is set to:
square_webPay
you can either search for that key in the developer tool kit; else go to your admin -> configuration -> one page checkout and see if
Payment Methods Handling Form Submittal
is listed there.
hope that helps.
Hello Carl,
Thank you for getting back to me.
I am currently using Square_webpay 1.0.0
Square Web Payments Module 1.0.4
[using SDK: 17.2.0.20220216
Php version is 7.3.33
OPC version is 2.4.3 ( a little outdated so it could be the culprit)
I also checked the OPC configuration and the form submittal is set to square_webpay.
The site used to have Paypal payment pro and express checkout as payment method.
I recently switched to square so it is using Square_webpay and Paypal Express Checkout.
My issue i a bit hard to explain honestly. After a few customer mentioned the issue ( having to restart the whole checkout process), I tried it myself.
If for some reasons the Zip is not entered into the "Square Credit Card Form" and click order, the page gets grayed out and freezes....
The site is at wwww.royal-fleur.com if you want to take a look at it.
Thanks for helping me figuring it out
Updated OPC to 2.5.0
Unfortunately, I am still getting the following error log:
How do i fix this please?Quote:
[25-Mar-2024 13:08:07 America/Los_Angeles] PHP Notice: missing token result: should not get here. check that you have the latest jscript_square_webpay file and that you are not having javascript errors in the console. in /includes/modules/payment/square_webPay.php on line 261
Thank you
this one is not that hard to explain.
all one needs to do is select the radio button for square and then hit the submit button. it has nothing to do with the zip code.
the greying out of the screen is done by OPC, not square. i have opened up a new issue on the OPC github repo.
with regards to this error, i am able to reproduce it. however the only way i can reproduce it is if the Key: CHECKOUT_ONE_PAYMENT_METHODS_THAT_SUBMIT does not have square_webPay listed in that value.
if you have that value in there and listed correctly, then i would suggest you review the OPC install instructions. and specifically all of the javascript files.
if all of those are correct, it is entirely possible that some other javascript is submitting your form.
when that error occurs the customer does receive a message on their OPC page in the message stack.
bottom line, i do not know which of your javascript files could be submitting the form. i know that my square code will NOT submit the payment form unless the credit card information is successfully tokenized. and the only way we get to the message is if something submits the payment form without a proper tokenization result from square.