Magento store - payments not working

Hey

We have a Magento store. We are trying to connect Square as a payment method
We created the API credentials in the Square panel:
Production Application ID
Production Application Secret

Then pasted these creds in Magento admin panel. But the payments are not working, we have the console error - 

Uncaught TypeError: Cannot read properties of undefined (reading 'uid')


Does anyone know what the reason may be?

391 Views
Message 1 of 2
Report
1 REPLY 1
Square Champion
 
I’ve seen this a few times with Magento + Square, and that console error is usually a symptom rather than the root cause.
 
A few things worth checking:
 
1) Application secret vs access token
Some Magento Square extensions label the field as ‘Production Application Secret’, but they don’t always mean the access token. A lot of them actually expect the OAuth application secret instead. If the wrong one is pasted in, Square can’t fully initialise and checkout JS starts failing, which can surface as errors like uid being undefined.
It’s worth double checking which credential your specific extension expects in that field.
 
2) Location ID not loading
Square’s Web Payments SDK needs a valid Location ID. If the Magento config screen is meant to auto-populate a location dropdown and it’s empty or stuck on ‘please select location’, that usually means authentication isn’t working correctly.
You can confirm the Location ID in the Square Developer Dashboard and make sure Magento is pointing at the correct production location.
 
3) First error in the console matters most
The uid error often shows up after something earlier fails. Have a look for any errors above it like:
  • invalid configuration
  • locationId missing or invalid
  • square.js failing to load
    Those usually point much more clearly to what’s actually wrong.
 
4) Cache, JS and theme checks
Magento can make this harder than it needs to be:
  • Flush cache and redeploy static content after changing Square settings
  • Temporarily disable JS bundling or minification to rule out load order issues
  • If you’re using a custom checkout or theme, try testing briefly on Luma or default checkout to see if the issue disappears
 
Also worth mentioning that different Magento Square extensions expect credentials slightly differently. Knowing exactly which extension you’re using helps narrow this down very quickly.
 
Hope that helps you get pointed in the right direction.
Proud Australian Square Champion and avid users of Square AppointmentsSquare POSSquare OnlineSquare ReaderSquare Stand

We use Square with integrations for Xero by AmakaPrintful / We design, develop and implement Square with Squarespace • Shopify • WooCommerce • QuickBooks and more!
345 Views
Message 2 of 2
Report