Zen Cart Logo
Forums / Addon Payment Modules / Square WebPay support thread.

Square WebPay support thread.

Views: 128,153

Results 241 to 260 of 800
20 Aug 2022, 9:52 AM
#241
wtfbbq avatar

wtfbbq

New Zenner

Join Date:
Aug 2012
Posts:
45
Plugin Contributions:
0

Square WebPay support thread.

dbltoe:

Those of you who were already using Square prior to carlwhat's update to WebPay may want to check your ADMIN >> Customers >> Orders for orders made in late March or earlier that have square under the Payment/Shipping header versus square_webPay.

We (myzencarthostDOTcom) updated several of our customers while some did 1.0.0 and 1.0.1 on their own. Both groups have shown cases where the Payment/Shipping was not changed to square_webPay on orders made with the old square.

If you are using WebPay and the Payment/Shipping shows square, you will not be able to access the full details for the order. IOW, you will not see anything AFTER the payment method. A partial blank screen with no log created and no way to see comments on the order.

NOTE: Some sites with Edit Orders are able to access the data with that mod. Still, the fix needs to be made.

Somehow, the upgrades did not modify the orders table in the database for any existing square orders. Specifically, the payment_module_code field. Some sites had a DB prefix and others did not so, I don't think that's the problem.

There's a quick fix if you find this happening. Go to ADMIN >> Tools >> Install SQL Patcches (it shows up as SQL Query Executor on the page).

Please read the instructions on that page that are in RED.

Enter the following code.

UPDATE orders
SET payment_module_code = 'square_webPay'
WHERE payment_module_code = 'square';

> 
> Then click on send.
> 
> You'll be good to go

Is this still the method to fix the order details not showing up?  Tried it and doesn't work.
20 Aug 2022, 10:10 AM
#242
wtfbbq avatar

wtfbbq

New Zenner

Join Date:
Aug 2012
Posts:
45
Plugin Contributions:
0

Re: Square WebPay support thread.

solved. had to login and set the credentials for oauth again for it to work.

27 Aug 2022, 10:25 PM
#243
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,841
Plugin Contributions:
0

Re: Square WebPay support thread.

So why does the token expire even when there have been multiple orders processed in the last week?

28 Aug 2022, 4:55 AM
#244
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,953
Plugin Contributions:
8

Re: Square WebPay support thread.

barco57:

So why does the token expire even when there have been multiple orders processed in the last week?

because the developer stinks?

i do not know.

how many clients do you have using this module? is it happening to all of them? is anyone else on the forum having this problem?

best.

28 Aug 2022, 11:18 AM
#245
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Square WebPay support thread.

because the developer stinks?

Dunno - I've heard good things. They say he is a bit OCD about formatting though.

30 Aug 2022, 10:54 AM
#246
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Square WebPay support thread.

Some people seem to get the "OAuth access token has expired" more often than others - not sure why.

Are people just preventatively renewing the token every couple of weeks to prevent this issue?

31 Aug 2022, 6:28 AM
#247
brittainmark avatar

brittainmark

Totally Zenned

Join Date:
Apr 2009
Posts:
507
Plugin Contributions:
1

Re: Square WebPay support thread.

I have a cron job that runs every 3 days that seems to keep my square web pay alive.
I set it to run at 01:01 every 3 days 1 1 */3 * * with the command php PATH_TO_M_STORE/squareWebPay_handler.php

31 Aug 2022, 7:48 AM
#248
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Square WebPay support thread.

Possibly because it's server dependent but the php command cron didn't work for me. From a post by @dbltoe the command I now use

/usr/bin/wget https://mydomainDOTcom/squareWebPay_handler.php

the scheduling is set in the control panel. Seems to be working.

31 Aug 2022, 7:31 PM
#249
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,763
Plugin Contributions:
9

Re: Square WebPay support thread.

OTOH,
I've got one site without cron that has had no sales since the update to webpay.

Yet, the thing has never dropped.

go figure.

31 Aug 2022, 7:46 PM
#250
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Square WebPay support thread.

Run a test order to be sure it truly works?

31 Aug 2022, 7:48 PM
#251
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Square WebPay support thread.

@proseLA - I'm adding this to the documentation unless you have objections:

Run a cron job every 3 days with the command

/usr/bin/wget https://YOURSTORE/squareWebPay_handler.php

31 Aug 2022, 10:01 PM
#252
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,953
Plugin Contributions:
8

Re: Square WebPay support thread.

swguy:

@proseLA - I'm adding this to the documentation unless you have objections:

Run a cron job every 3 days with the command

/usr/bin/wget https://YOURSTORE/squareWebPay_handler.php

if that works for people, that would be great.

1 Sep 2022, 12:20 AM
#253
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,763
Plugin Contributions:
9

Re: Square WebPay support thread.

swguy:

Run a test order to be sure it truly works?Actually, i just go to the mod, click on edit, and then click on update.

I've found that action alone will let you know if things are not right.

BTW, I had specifically left this site without a cron to see when and if it would drop.

1 Sep 2022, 10:36 AM
#254
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Square WebPay support thread.

@carlwhat thanks.
@dbltoe thanks for that - I'll advise using one of these two methods.

6 Sep 2022, 6:05 PM
#256
brent avatar

brent

Totally Zenned

Join Date:
Mar 2005
Location:
United Kingdom
Posts:
606
Plugin Contributions:
0

Re: Square WebPay support thread.

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.

[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?

6 Sep 2022, 8:49 PM
#257
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,953
Plugin Contributions:
8

Re: Square WebPay support thread.

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.

[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
            $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.

6 Sep 2022, 10:09 PM
#258
brent avatar

brent

Totally Zenned

Join Date:
Mar 2005
Location:
United Kingdom
Posts:
606
Plugin Contributions:
0

Re: Square WebPay support thread.

Thank you kind sir! That did the trick :smile:

13 Sep 2022, 2:40 PM
#259
brent avatar

brent

Totally Zenned

Join Date:
Mar 2005
Location:
United Kingdom
Posts:
606
Plugin Contributions:
0

Re: Square WebPay support thread.

Since switching I've had a number of customers reporting their transaction is declined but I don't get any error logs my end. I am getting orders through so it is card type or issuing bank dependant. I think it may be card type as I had one user who could not get their credit card to work but as soon as they tried debit card it went through.

I've now enabled logging on success and failure but don't think this will help me troubleshoot. Also I don't think there is a way to differentiate between credit and debit card in the Square portal so I could investigate that theory?

13 Sep 2022, 3:07 PM
#260
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Square WebPay support thread.

Square should have logs on their side that will help you troubleshoot this.