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

Square WebPay support thread.

Views: 128,128

Results 521 to 540 of 800
02 Oct 2023, 21:02
#521
jasonshanks avatar

jasonshanks

Zen Follower

Join Date:
Feb 2009
Location:
atlanta GA
Posts:
296
Plugin Contributions:
0

Square WebPay support thread.

@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.

02 Oct 2023, 22:00
#522
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

jasonshanks:

@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.

04 Oct 2023, 00:03
#523
dbltoe avatar

dbltoe

Totally Zenned

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

Re: Square WebPay support thread.

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/running/login_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.

05 Oct 2023, 21:28
#524
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,278
Plugin Contributions:
37

Re: Square WebPay support thread.

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.

05 Oct 2023, 22:14
#525
dbltoe avatar

dbltoe

Totally Zenned

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

Re: Square WebPay support thread.

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.

05 Oct 2023, 22:22
#526
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,278
Plugin Contributions:
37

Re: Square WebPay support thread.

dbltoe:

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.

Same plugin files, no changes except uninstalled, then reinstalled & configured.

05 Oct 2023, 23:51
#527
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

mprough:

Same plugin files, no changes except uninstalled, then reinstalled & configured.

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:

if (is_array($response['results'])) {
                    trigger_error(json_encode($response['results']));
                    return new Models\Order;
                }

and then post the results of the corresponding log file. and we can take a look at what is happening.

best.

05 Oct 2023, 23:58
#528
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

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.

06 Oct 2023, 00:08
#529
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

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.

06 Oct 2023, 01:25
#530
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,278
Plugin Contributions:
37

Re: Square WebPay support thread.

carlwhat:

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.

I am using

Square Web Payments Module 1.0.4
[using SDK: 17.2.0.20220216]

06 Oct 2023, 01:36
#531
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,278
Plugin Contributions:
37

Re: Square WebPay support thread.

carlwhat:

m,
we have an order, 10030690, and we are trying to get the details of that order.

Yes, like
index.php?cmd=orders&page=1&oID=10030686&action=edit

for example.

carlwhat:

was that order processed using square_webPay or the old square version? do you know?

Same version, same files, same store etc.... Only difference is different merchant.

carlwhat:

what is the date of the order?
All Square orders prior to switching the merchant information for Square.

carlwhat:

when you say, reinstalled and configured, is the configuration new from the time the order was originally placed?
Yes

carlwhat:

is this problem just occurring for this order or for all orders?
All Square orders prior to switching the merchant information for Square.

carlwhat:

just before line 113 which has the getOrders call you can add:

if (is_array($response['results'])) {
trigger_error(json_encode($response['results']));
return new Models\Order;
}

> 
> and then post the results of the corresponding log file.  and we can take a look at what is happening.
> 
> best.

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 =)
06 Oct 2023, 14:07
#532
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

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

//from
                $response = $this->processResult($apiResponse, $request);
                return $response['results']->getOrders(); 

//to
                $response = $this->processResult($apiResponse, $request);
                if ($response['errors']) {
                    return [];
                }
                return $response['results']->getOrders();
06 Oct 2023, 14:12
#533
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,278
Plugin Contributions:
37

Re: Square WebPay support thread.

carlwhat:

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

//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
        $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;
}
}


Here is the error

[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.
06 Oct 2023, 14:24
#534
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

before the getOrders, aka, the error line, add

trigger_error('Response: ' . json_encode($response));

and post that log.

06 Oct 2023, 14:33
#535
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,278
Plugin Contributions:
37

Re: Square WebPay support thread.

carlwhat:

before the getOrders, aka, the error line, add

trigger_error('Response: ' . json_encode($response));

> 
> and post that log.


[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.
06 Oct 2023, 14:37
#536
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

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.

06 Oct 2023, 14:50
#537
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,278
Plugin Contributions:
37

Re: Square WebPay support thread.

carlwhat:

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.

One was not generated

06 Oct 2023, 22:25
#538
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

try:

trigger_error('Response: ' . json_encode($response), E_USER_WARNING);
09 Oct 2023, 10:05
#539
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,278
Plugin Contributions:
37

Re: Square WebPay support thread.

carlwhat:

try:

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.
09 Oct 2023, 13:58
#540
carlwhat avatar

carlwhat

zennedOut

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

Re: Square WebPay support thread.

look back at this post.

//from
if ($response['errors']) {
//to
if ($response['error']) {

TSIS.