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,769

Results 581 to 600 of 835
4 Jun 2021, 2:16 PM
#581
rocketsites avatar

rocketsites

New Zenner

Join Date:
Jun 2013
Location:
United Kingdom
Posts:
41
Plugin Contributions:
4

Square Payment Module for Zen Cart [Support Thread]

With the assistance of @Congerman, I have made some changes to the Square module with a view to achieving SCA compliance.

The following is ready for TESTING - use AT YOUR OWN RISK. Replace these two core files with those included in the archive:

/includes/modules/pages/checkout_payment/jscript_square.php
/includes/modules/payment/square.php

No need to un-install and then re-install the module in admin, as there are no DB changes.

https://www.rocketsites.co.uk/square.zip

4 Jun 2021, 3:45 PM
#582
dbltoe avatar

dbltoe

Totally Zenned

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

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

Have you tested the jscript with OPC and, isn’t this only required for non-US sites?

5 Jun 2021, 9:21 AM
#583
john_large avatar

john_large

New Zenner

Join Date:
Oct 2015
Location:
Cornwall, UK
Posts:
41
Plugin Contributions:
0

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

RocketSites:

With the assistance of @Congerman, I have made some changes to the Square module with a view to achieving SCA compliance.

The following is ready for TESTING - use AT YOUR OWN RISK. Replace these two core files with those included in the archive:

/includes/modules/pages/checkout_payment/jscript_square.php
/includes/modules/payment/square.php

No need to un-install and then re-install the module in admin, as there are no DB changes.

https://www.rocketsites.co.uk/square.zip

Will give this a test myself, as yet havent had any declines, so what will be the best way to test this & actually trigger a challenge/response from my card issuer?
Is there something in the square dashboard that will indicate a user has been issued an SCA challenge during their transaction?

Thanks so much for looking into this, square has been a lifeline to our small business with regards increasing conversions & reducing abandoned transactions as was the casewhen we only had paypal.

5 Jun 2021, 10:29 AM
#586
congerman avatar

congerman

Zen Follower

Join Date:
Oct 2008
Posts:
392
Plugin Contributions:
0

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

Have you changed your settings in admin to use the Square Sandbox credentials for testing?

5 Jun 2021, 10:36 AM
#587
john_large avatar

john_large

New Zenner

Join Date:
Oct 2015
Location:
Cornwall, UK
Posts:
41
Plugin Contributions:
0

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

That's the first thing I checked, but I have no options to enable sandbox under the square payment module config in ZC. Can't see it anywhere.

edit**
Scratch that, i can see square gives us different api credentials for sandbox testing. I'm having a senior moment over here!

5 Jun 2021, 10:41 AM
#588
congerman avatar

congerman

Zen Follower

Join Date:
Oct 2008
Posts:
392
Plugin Contributions:
0

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

You have to log into your square account and get the sandbox Application ID and sandbox application secret and then use them in the module settings in Zen

6 Jun 2021, 8:15 AM
#589
john_large avatar

john_large

New Zenner

Join Date:
Oct 2015
Location:
Cornwall, UK
Posts:
41
Plugin Contributions:
0

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

No matter how many times I remove the square module and reinstall, generate a new sandbox OAuth secret & try to use the sandbox credentials, whenever I click the green button in ZC to get tokens via OAuth, I receive this error. If I use my production credentials, the module receives its tokens and becomes active.

Also, could you take a screenshot of the modal challenge that pops up on your website if the transaction does require a two-factor code such as via text or email for SCA? I'm curious to see how this looks and at what point it is shown. I've tried a few test transactions using my own cards and as yet haven't seen any challenges.

Attachment 19606

6 Jun 2021, 10:26 AM
#590
congerman avatar

congerman

Zen Follower

Join Date:
Oct 2008
Posts:
392
Plugin Contributions:
0

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

John Large:

Also, could you take a screenshot of the modal challenge that pops up on your website

This is the challenge I get when using sandbox credentials

7 Jun 2021, 12:54 PM
#591
rocketsites avatar

rocketsites

New Zenner

Join Date:
Jun 2013
Location:
United Kingdom
Posts:
41
Plugin Contributions:
4

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

John Large:

No matter how many times I remove the square module and reinstall, generate a new sandbox OAuth secret & try to use the sandbox credentials, whenever I click the green button in ZC to get tokens via OAuth, I receive this error. If I use my production credentials, the module receives its tokens and becomes active.
Attachment 19606

I had various issues like this.

When editing the Square settings in admin, if you add a URL parameter with a key of sandbox and any value, can you see any additional settings?

e.g. https://your-domain.tld/your-admin-dir/index.php?cmd=modules&set=payment&module=square&action=edit&sandbox=1

If so, may be worth removing the three Token values and also confirming the Sandbox Merchant Token.

7 Jun 2021, 12:56 PM
#592
rocketsites avatar

rocketsites

New Zenner

Join Date:
Jun 2013
Location:
United Kingdom
Posts:
41
Plugin Contributions:
4

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

dbltoe:

Have you tested the jscript with OPC and, isn’t this only required for non-US sites?

I haven't tested with OPC. Does that load the JS from /includes/modules/payment/checkout_payment/ ?

Yes, I believe SCA only applies/will only apply to the EEA.

7 Jun 2021, 1:57 PM
#593
john_large avatar

john_large

New Zenner

Join Date:
Oct 2015
Location:
Cornwall, UK
Posts:
41
Plugin Contributions:
0

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

RocketSites:

I had various issues like this.

When editing the Square settings in admin, if you add a URL parameter with a key of sandbox and any value, can you see any additional settings?

e.g. https://your-domain.tld/your-admin-dir/index.php?cmd=modules&set=payment&module=square&action=edit&sandbox=1

If so, may be worth removing the three Token values and also confirming the Sandbox Merchant Token.

Thanks for that.

Tried as you suggested and the sandbox oauth was wrong. Have corrected & cleared the three token boxes. Re-authed the plugin then put it in sandbox mode. When I try to do a test transaction, using the test card details, I enter the details in checkout_payment and press continue, but it just sits there & doesn't load checkout confirmation.

7 Jun 2021, 3:03 PM
#594
rocketsites avatar

rocketsites

New Zenner

Join Date:
Jun 2013
Location:
United Kingdom
Posts:
41
Plugin Contributions:
4

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

John Large:

Thanks for that.

Tried as you suggested and the sandbox oauth was wrong. Have corrected & cleared the three token boxes. Re-authed the plugin then put it in sandbox mode. When I try to do a test transaction, using the test card details, I enter the details in checkout_payment and press continue, but it just sits there & doesn't load checkout confirmation.

Anything logged in the browser console?

7 Jun 2021, 3:23 PM
#596
rocketsites avatar

rocketsites

New Zenner

Join Date:
Jun 2013
Location:
United Kingdom
Posts:
41
Plugin Contributions:
4

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

John Large:

Yes. Just tried again with test card in sandbox mode :-

XHR POST https://pci-connect.squareupsandbox.com/v2/card-nonce?_=1623078415100.9626&version=bdf10289fb
[HTTP/2 401 Unauthorized 168ms]

401 suggests an issue with your API settings. If you view your API logs (https://developer.squareup.com/apps > relevant 'app' > API Logs) can you see any requests logged by Square at the time of your tests?

7 Jun 2021, 3:25 PM
#597
john_large avatar

john_large

New Zenner

Join Date:
Oct 2015
Location:
Cornwall, UK
Posts:
41
Plugin Contributions:
0

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

All Fixed.

I'd generated a new OAuth application secret not realising that would also invalidate the sandbox merchant token.

All working as expected. I could kiss you both @Congerman and @RocketSites - means we can keep offering card payments via square with their amazing fee structure & ease of use. Absolutely brilliant work!

Attachment 19614

8 Jun 2021, 12:12 PM
#598
rocketsites avatar

rocketsites

New Zenner

Join Date:
Jun 2013
Location:
United Kingdom
Posts:
41
Plugin Contributions:
4

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

John Large:

All Fixed.

I'd generated a new OAuth application secret not realising that would also invalidate the sandbox merchant token.

All working as expected. I could kiss you both @Congerman and @RocketSites - means we can keep offering card payments via square with their amazing fee structure & ease of use. Absolutely brilliant work!

Great stuff, glad to hear it! Please direct all kisses directly to @Congerman in the first instance. :laugh:

If this has saved you time and/or money and you feel so inclined, any donations to a charity that I support would be gratefully received :smile:

8 Jun 2021, 3:31 PM
#599
john_large avatar

john_large

New Zenner

Join Date:
Oct 2015
Location:
Cornwall, UK
Posts:
41
Plugin Contributions:
0

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

RocketSites:

Great stuff, glad to hear it! Please direct all kisses directly to @Congerman in the first instance. :laugh:

If this has saved you time and/or money and you feel so inclined, any donations to a charity that I support would be gratefully received :smile:

Thanks so much for the help.

Have just sent a donation using your link. Hope it can help with the fundraising. Will donate some more once our sales pick back up again.

John Large (Kool Badges)

8 Jun 2021, 4:08 PM
#600
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]

RocketSites:

With the assistance of @Congerman, I have made some changes to the Square module with a view to achieving SCA compliance.

The following is ready for TESTING - use AT YOUR OWN RISK. Replace these two core files with those included in the archive:

/includes/modules/pages/checkout_payment/jscript_square.php
/includes/modules/payment/square.php

No need to un-install and then re-install the module in admin, as there are no DB changes.

https://www.rocketsites.co.uk/square.zip

As I've yet to be asked for any form of 2FA for credit card purchases online I'm not sure how this works. Is the flow something like:

  • customer enters credit card info as usual, click Make Payment (I forget what the button's called).
  • if the issuer requires SCA then a message is displayed saying that a code has been sent to their mobile.
  • the popup shown in post #583 is displayed, asking for the customer to enter their passcode.
  • click 'verfiy now' and the transaction is accepted.