Zen Cart Logo
Forums / Addon Payment Modules / Square Payment Module for Zen Cart [Support Thread]

Square Payment Module for Zen Cart [Support Thread]

Sticky

Views: 366,760

Results 201 to 220 of 835
1 Oct 2018, 2:34 PM
#201
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Square Payment Module for Zen Cart [Support Thread]

Ya, it's the same issue. Notice how there's no "break" between fields in the AIM module, just like in the Square module?
It's a typical Template-Monster deficiency to be missing correct styling for features they didn't implement/test in their demo (payment modules are often left out).
You'll need to do a bit of CSS styling to tweak things for your template.

1 Oct 2018, 3:19 PM
#202
jakelawless avatar

jakelawless

Zen Follower

Join Date:
Jan 2018
Posts:
146
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

Where would i start to fix this? And what would i do?

Thanks

1 Oct 2018, 9:24 PM
#203
joeh avatar

joeh

New Zenner

Join Date:
Jan 2015
Location:
USA
Posts:
12
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

I am using Zen 1.5.4
I can not get rid of the Square (Access Token needed)

I followed all the suggestions. Can anyone take a look?

Got these errors
ERROR: module not loaded due to missing language file: /home/cps/public_html/catalog/includes/languages/english/modules/payment/ZenCartChargeRequest.php
ERROR: module not loaded due to missing language file: /home/cps/public_html/catalog/includes/languages/english/modules/payment/square_admin_notification.php

Those 2 files aren't in the download

2 Oct 2018, 5:46 PM
#204
simon1066 avatar

simon1066

Totally Zenned

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

Re: Square Payment Module for Zen Cart [Support Thread]

JoeH:

Got these errors
ERROR: module not loaded due to missing language file: /home/cps/public_html/catalog/includes/languages/english/modules/payment/ZenCartChargeRequest.php
ERROR: module not loaded due to missing language file: /home/cps/public_html/catalog/includes/languages/english/modules/payment/square_admin_notification.php

Those 2 files aren't in the download

These two files should actually be located in \includes\modules\payment\square_support and they are not language files, I'm not sure why you're getting missing language file errors for them.

You don't say which version of ZC you are using but if you installed this mod yourself (before it was included in the stock ZC) or upgraded recently you might want to check you have files in the correct locations.

edit: saw your earlier post re ZC version, so you probably did install it yourself. Checking you have the correct file locations might also help with that post.

2 Oct 2018, 5:52 PM
#205
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Square Payment Module for Zen Cart [Support Thread]

simon1066:

These two files should actually be located in \includes\modules\payment\square_support and they are not language files.Correct.
simon1066:

I'm not sure why you're getting missing language file errors for them.The error is because ZC attempts to automatically load a language file for all files in the modules directory. So putting files in the modules directory will cause this problem if the files don't belong there.

2 Oct 2018, 6:07 PM
#206
simon1066 avatar

simon1066

Totally Zenned

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

Re: Square Payment Module for Zen Cart [Support Thread]

DrByte:

Correct.
The error is because ZC attempts to automatically load a language file for all files in the modules directory

I did not know that, thank you for the explanation.

2 Oct 2018, 8:16 PM
#207
joeh avatar

joeh

New Zenner

Join Date:
Jan 2015
Location:
USA
Posts:
12
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

Thanks
So what do I need to do to fix it? All files are in the right place

3 Oct 2018, 12:51 AM
#208
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Square Payment Module for Zen Cart [Support Thread]

JoeH:

Thanks
So what do I need to do to fix it? All files are in the right place
Um, if you're still getting the error messages you quoted, then no the files are not in the right place. Or else they're also in places where they don't belong.

3 Oct 2018, 2:41 AM
#209
joeh avatar

joeh

New Zenner

Join Date:
Jan 2015
Location:
USA
Posts:
12
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

I went through each file one at a time. Please how do I find it?

3 Oct 2018, 3:13 AM
#210
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Square Payment Module for Zen Cart [Support Thread]

If your errors are the following:

JoeH:

ERROR: module not loaded due to missing language file: /home/cps/public_html/catalog/includes/languages/english/modules/payment/ZenCartChargeRequest.php
ERROR: module not loaded due to missing language file: /home/cps/public_html/catalog/includes/languages/english/modules/payment/square_admin_notification.php
... then you need to delete the following files, because they should have been placed in another subdirectory:
/home/cps/public_html/catalog/includes/modules/payment/ZenCartChargeRequest.php
/home/cps/public_html/catalog/includes/modules/payment/square_admin_notification.php

3 Oct 2018, 3:44 AM
#211
joeh avatar

joeh

New Zenner

Join Date:
Jan 2015
Location:
USA
Posts:
12
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

Thanks!
Got rid of those and the error message is gone. But the accesse token error is still there

I really do appreciate your help

3 Oct 2018, 8:00 AM
#212
gerrim avatar

gerrim

New Zenner

Join Date:
Jul 2013
Location:
Brisbane, Australia
Posts:
39
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

DrByte:

To get descriptive output for debugging, you can TEMPORARILY edit square_handler.php and change line 11, which says:

$verbose = false;

> NOTE that this may prevent normal transactions from operating properly until you put it back to false.
> 
> With $verbose=true, it will give output with one of:
> not configured = module doesn't have an Application ID set
> failure = token expired more than 15 days ago, or no token available to refresh
> refreshed = the job refreshed the token
> not refreshed = a refresh was attempted, but did not complete properly
> not expired = a token exists but it is younger than 3 weeks old, so no need to refresh

Thanks for that info and your other replies, Dr Byte. Apologies for my delayed reply: I've been away.

Changing line 11 unfortunately resulted no output produced (i.e. no error log or email received). 

So I experimented further. By adding simple echo requests at different points in the square_handler.php file I found that it did produce output - but only when added BEFORE the 2 'require....' statements at lines 12 & 13 (i.e. I gather output was produced in the header). After that point, no output was produced.

To be clear, my amended code from line 11:
> $verbose = true; //GM Changed from false for testing
> echo $verbose . ' ' . $mode . ' ' . '- results when echo placed BEFORE require statements'; //GM Line added for testing
> require 'includes/application_top.php';
> require DIR_WS_CLASSES . 'payment.php';
> echo $verbose . ' ' . $mode . ' ' . '- results when echo placed after require statements'; //GM Line added for testing

produced this output in the email and no error log:
 
> 1 cli - results when echo placed BEFORE require statements

Despite more experimenting, I couldn't work out why output didn't include the messages you cited nor the later echo statements - and more importantly, whether this meant the cron job did not successfully complete its task to refresh the token. Any ideas? Thanks.
3 Oct 2018, 8:54 AM
#213
jakelawless avatar

jakelawless

Zen Follower

Join Date:
Jan 2018
Posts:
146
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

Anyone know this is for UK banks, cant find the RBS Routing number?

Attachment 18066

3 Oct 2018, 2:50 PM
#214
jakelawless avatar

jakelawless

Zen Follower

Join Date:
Jan 2018
Posts:
146
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

Getting this error when testing the module

"YOUR TRANSACTION COULD NOT BE COMPLETED DUE TO A MISCONFIGURATION IN OUR STORE. PLEASE REPORT THIS ERROR TO THE STORE OWNER: SQ-MISCONF"

Any idea why?

4 Oct 2018, 8:59 PM
#215
joeh avatar

joeh

New Zenner

Join Date:
Jan 2015
Location:
USA
Posts:
12
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

I got rid of the error messages in admin. But when I test it by trying to buy something I get this:

Error We could not initiate your transaction because of a problem with the card data you entered. Please correct the card data, or report this error to the Store Owner: SQ-NONCE-FAILURE

4 Oct 2018, 10:11 PM
#216
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Square Payment Module for Zen Cart [Support Thread]

JoeH:

I got rid of the error messages in admin. But when I test it by trying to buy something I get this:

Error We could not initiate your transaction because of a problem with the card data you entered. Please correct the card data, or report this error to the Store Owner: SQ-NONCE-FAILURE
SQ-NONCE-FAILURE appears when the javascript code in your template has errors and is preventing the javascript for the module from executing properly.
This is often caused by other plugins that are using outdated javascript or old versions of jQuery. It can also happen if you're using a template designed for an older version of Zen Cart and therefore have an old jscript_framework.php file in your template's jscript folder.

4 Oct 2018, 10:17 PM
#217
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Square Payment Module for Zen Cart [Support Thread]

JakeLawless:

Anyone know this is for UK banks, cant find the RBS Routing number?

Attachment 18066
Best to ask your Bank, or contact Square Support for help in filling in banking details inside your Square account.

JakeLawless:

Getting this error when testing the module

"YOUR TRANSACTION COULD NOT BE COMPLETED DUE TO A MISCONFIGURATION IN OUR STORE. PLEASE REPORT THIS ERROR TO THE STORE OWNER: SQ-MISCONF"

Any idea why?
SQ-MISCONF appears when your attempted transaction triggers the "INVALID_REQUEST_ERROR" response from Square's servers.
There are two steps to take for sorting this out:

  1. Look at the debug log that was generated in your server's /logs folder, as it will contain more details about the complete communication between your server and Square.
  2. Contact Square Support and tell them the information in the log file from #1 above. Their servers will contain all your transaction attempt history and their techs will be able to explain what's gone wrong with your specific transaction attempts.
4 Oct 2018, 10:19 PM
#218
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Square Payment Module for Zen Cart [Support Thread]

GerriM:

DrByte:

To get descriptive output for debugging, you can TEMPORARILY edit square_handler.php and change line 11, which says:

$verbose = false;

> > NOTE that this may prevent normal transactions from operating properly until you put it back to false.
> > 
> > With $verbose=true, it will give output with one of:
> > not configured = module doesn't have an Application ID set
> > failure = token expired more than 15 days ago, or no token available to refresh
> > refreshed = the job refreshed the token
> > not refreshed = a refresh was attempted, but did not complete properly
> > not expired = a token exists but it is younger than 3 weeks old, so no need to refresh
> 
> Thanks for that info and your other replies, Dr Byte. Apologies for my delayed reply: I've been away.
> 
> Changing line 11 unfortunately resulted no output produced (i.e. no error log or email received). 
> 
> So I experimented further. By adding simple echo requests at different points in the square_handler.php file I found that it did produce output - but only when added BEFORE the 2 'require....' statements at lines 12 & 13 (i.e. I gather output was produced in the header). After that point, no output was produced.
> 
> To be clear, my amended code from line 11:
> > $verbose = true; //GM Changed from false for testing
> > echo $verbose . ' ' . $mode . ' ' . '- results when echo placed BEFORE require statements'; //GM Line added for testing
> > require 'includes/application_top.php';
> > require DIR_WS_CLASSES . 'payment.php';
> > echo $verbose . ' ' . $mode . ' ' . '- results when echo placed after require statements'; //GM Line added for testing
> 
> produced this output in the email and no error log:
> 
> > 1 cli - results when echo placed BEFORE require statements
> 
> Despite more experimenting, I couldn't work out why output didn't include the messages you cited nor the later echo statements - and more importantly, whether this meant the cron job did not successfully complete its task to refresh the token. Any ideas? Thanks.
The fact that your 2nd echo does not appear means the code before it is failing with fatal errors. Your server's PHP error-logs will contain more information. Clearly something's unusual about your server config which is preventing this from operating normally.
4 Oct 2018, 10:38 PM
#219
joeh avatar

joeh

New Zenner

Join Date:
Jan 2015
Location:
USA
Posts:
12
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

DrByte:

SQ-NONCE-FAILURE appears when the javascript code in your template has errors and is preventing the javascript for the module from executing properly.
This is often caused by other plugins that are using outdated javascript or old versions of jQuery. It can also happen if you're using a template designed for an older version of Zen Cart and therefore have an old jscript_framework.php file in your template's jscript folder.

Thanks!
But how do I find out how to fix it?

4 Oct 2018, 10:46 PM
#220
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Square Payment Module for Zen Cart [Support Thread]

JoeH:

DrByte:

SQ-NONCE-FAILURE appears when the javascript code in your template has errors and is preventing the javascript for the module from executing properly.
This is often caused by other plugins that are using outdated javascript or old versions of jQuery. It can also happen if you're using a template designed for an older version of Zen Cart and therefore have an old jscript_framework.php file in your template's jscript folder.

Thanks!
But how do I find out how to fix it?
Ya, that's the challenging part. Teaching someone javascript-debugging is hard to do in a single post! Can't really do that here. There are a dozen discussions of the same issue earlier in this thread, all with varying examples of the same situation as yours. So I'd start there.
Additionally, you can use your browser's "console log" to inspect the actual javascript errors that are occurring when the checkout_payment page is being loaded, and when the submit button is clicked. Using the information reported there can help you understand what javascript conflicts might exist and need fixing.