Active
Project:
Commerce Square Connect
Version:
8.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Jul 2020 at 09:42 UTC
Updated:
22 Feb 2023 at 12:54 UTC
Jump to comment: Most recent

Comments
Comment #2
alibama commentedsimilarly borked in drupal 7 - any known cures?
Comment #3
jmester13 commentedHey All,
I'm also having this experience with the plugin. This is my first attempt ever at my own Drupal patch and this is probably just scratching the surface for a proper fix.
/commerce_square/src/Plugin/Commerce/PaymentGateway/Square.php
Line 90 Enter your test_location_id. I got mine from the locations page in square.
Line 120 Commented out
This allowed me to save the payment gateway. Obviously removing required is a hack move, but it seems to get us saving at least.
I'll report back on how my testing goes from this point forward.
Comment #4
brandonratz commentedSame issue here. The Production Locations sync properly but not Sandbox. I haven't tried hard coding the location_id as I'm testing in a production environment.
Using version 1.4.0
Comment #5
brandonratz commentedRelating the D7 version of the issue
Comment #6
nhepner1 commentedOkay - I've got this figured out I think.
Was having this issue and beating my head into a wall on this. Did some light digging and found out that the API request for the sandbox locations was returning "401 Unauthorized".
So I investigated this a bit and it took me longer than I'm proud to admit.
Essentially, I went on autopilot and copied the "Sandbox Application Secret" and pasted it into the Square settings page (admin/commerce/config/square). It felt obvious.
This is wrong.
You want the "Sandbox Access Token". This is a little harder to find, but it's on the same page. Scroll all the way to the bottom of the OAuth screen in the Square Developer Dashboard, and under Test Account Authorizations, you'll see the Default Test Account. Click on that and you should get a modal with the access token.
I'm not totally sure if this is the issue you're experiencing, but this definitely explains why my sandbox locations weren't loading, but my prod ones were.
Comment #7
socialnicheguru commentedI can confirm that @nhepner1 is a superstar.
Yes what he outlined is correct.
Once that is done the Sandbox location is available.
Can the readme be updated?
Comment #8
socialnicheguru commented