Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
lat9
FWIW, I was able to correct the integration issue by editing the /includes/modules/pages/checkout_payment/jscript_square.php (it's also copied to the /checkout_one/jscript_square.php for the OPC integration) and changing:
Code:
if ($payment_modules->in_special_checkout()) {
return false;
}
to
Code:
if ($payment_modules->in_special_checkout() || (isset($payment_modules->paymentClass) && $payment_modules->paymentClass->code != 'square')) {
return false;
}
The result is that Square's jQuery module doesn't load if the payment class is selected and it's not Square.
Please note, after additional thought, that's not going to work! The change needs to be made to the jQuery processing itself; otherwise, the payment method can't be changed to Square after a previous selection of a payment method.
Back to the drawing board ...
Re: Square Payment Module for Zen Cart [Support Thread]
I've submitted a change-request to the Zen Cart GitHub, see this commit for details of the proposed change.
Re: Square Payment Module for Zen Cart [Support Thread]
Cindy,
:smile:
I changed:
Code:
Line 13: if ($payment_modules->in_special_checkout()) {
replaced:
if ($payment_modules->in_special_checkout() || empty($square) || !$square->enabled) { |
|
1. /includes/modules/pages/checkout_payment/jscript_square.php
2. /includes/modules/pages/checkout_one/jscript_square.php
The download worked perfectly!!!
Mark,
Re: Square Payment Module for Zen Cart [Support Thread]
Thanks for the report, Mark. Turns out that the issue was raised when/if the Square payment method was zone-restricted as well; causing the jQuery error if the payment method was not enabled for the zone associated with the current billing address.
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
dbltoe
All of a sudden, Square is bouncing with INVALID_ENUM_VALUE with the detail - "is not a valid enum value for 'billing_address.country' "
Is this something 0.95 might fix or do we need to come up with a country field to satisfy a new requirement.
[27-Nov-2018 17:04:48 UTC] Request URI: /index.php?main_page=checkout_process, IP address: 72.190.125.38
#1 trigger_error() called at [/home/spicdavi/public_html/includes/modules/payment/square.php:338]
#2 square->before_process() called at [/home/spicdavi/public_html/includes/classes/payment.php:245]
#3 payment->before_process() called at [/home/spicdavi/public_html/includes/modules/checkout_process.php:84]
#4 require(/home/spicdavi/public_html/includes/modules/checkout_process.php) called at [/home/spicdavi/public_html/includes/modules/pages/checkout_process/header_php.php:14]
#5 require(/home/spicdavi/public_html/includes/modules/pages/checkout_process/header_php.php) called at [/home/spicdavi/public_html/index.php:36]
[27-Nov-2018 17:04:48 UTC] PHP Notice: Square Connect [configuration] error.
Response Body:
stdClass Object
(
[errors] => Array
(
[0] => stdClass Object
(
[category] => INVALID_REQUEST_ERROR
Code:
=> INVALID_ENUM_VALUE
[code]
[detail] => `` is not a valid enum value for `billing_address.country`.
[field] => billing_address.country
)
)
)
Response Headers:
Array
(
[0] => HTTP/1.1 400 Bad Request
[Content-Type] => application/json
[Vary] => Origin, Accept-Encoding
[X-Content-Type-Options] => nosniff
[X-Download-Options] => noopen
[X-Frame-Options] => SAMEORIGIN
[X-Permitted-Cross-Domain-Policies] => none
[X-Xss-Protection] => 1; mode=block
[Date] => Tue, 27 Nov 2018 17:04:47 GMT
[keep-alive] => timeout=60
[Strict-Transport-Security] => max-age=631152000
[content-length] => 182
)
in /home/spicdavi/public_html/includes/modules/payment/square.php on line 338
@dbltoe ... do you have any idea why the billing country is blank? It's obtained by lookup from the customer's default address, unless they change that address during checkout. The only reason I can think of why it would be blank is if they somehow were allowed to select a country which is not supported by your store, or if you've changed the "country name" or ISO codes in your Admin to something other than the default.
Re: Square Payment Module for Zen Cart [Support Thread]
(Access Token needed) Still shows in red.
Everything is set correctly.
Everything (files) in correct location.
Yes I refreshed admin page 1 million times (not a million, but close)
Gots me baffled.
All latest versions installed.
Help, will give monatary compensation if this gets figured out.
It is on a Dreamhost server.
Re: Square Payment Module for Zen Cart [Support Thread]
It's generally that you need to take special care that all of the access token is removed and the entire access token is entered. The length of the token often makes you think you got it all when you didn't.
Re: Square Payment Module for Zen Cart [Support Thread]
EDIT: Problem resolved
ZC 156 builtin Square setup
install on sandbox server with demo data
drop tables
import db from backup of live db
run zc_install
RED: Access Token needed error
Seems that the setup is asking for input from our square account for which no field exists or I am not comprehending the field labels in setup.
Square setup.
Populate the fields as necessary.
There is NO Access token field in the zc square setup but there is one in our square account
Application ID copy/pasted from our Square account
Application Secret (OAUTH) copy/pasted from our square account
EDIT: It helps if you read all the setup instructions. I missed the line where zc provided a link which needed to be pasted into our Square Account
Problem resolved.
Re: Square Payment Module for Zen Cart [Support Thread]
a new problem for me.
I get this error when testing
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
All the credit card info is correct (used 3 different cards
Re: Square Payment Module for Zen Cart [Support Thread]
SQ-NONCE-FAILURE happens when the javascript on the page is unable to properly obtain a payment token from Square. This is almost always because there are javascript errors on your page. Javascript errors are common when mixing multiple plugins or adding extra things to the template. You'll need to investigate the errors in your template.