Square connection
The Square connection tab holds the access token, location ID, webhook signing key and currency for the sandbox and for production, separately for each store.
Where to find the values in Square
All values come from one application in the Square Developer Console.
- Sign in to the Square Developer Console and open your application, or create one.
- The console has a sandbox view and a production view of the same application. Start with the sandbox.
- On the credentials page of the application, copy the access token. The sandbox token works only with Square's sandbox, the production token only with real payments.
- On the locations page, copy the ID of the location that takes the payments. In production this is one of the locations of your Square account; it must be active.
- The webhook signing key appears after you create the webhook subscription. See Notifications and worker.
The fields
Open the Square connection tab. The fields appear in this order.
| Setting | What it does |
|---|---|
| Sandbox access token | Access token of your application for Square's sandbox. Used when Mode is Test. |
| Sandbox location ID | ID of the sandbox location that receives the test payments. |
| Sandbox webhook signing key | Signature key of the sandbox webhook subscription. The store uses it to check that a notification really comes from Square. |
| Production access token | Access token of your application for real payments. Used when Mode is Live. |
| Production location ID | ID of the active location that receives the real payments. |
| Production webhook signing key | Signature key of the production webhook subscription. |
| Sandbox location currency | Currency of the sandbox location: USD, CAD, GBP, AUD, JPY or EUR. Default: EUR. |
| Production location currency | Currency of the production location, with the same options. Default: EUR. |
Press Save settings after changing any of them.
How the credential fields behave
- The six credential fields are password fields. A saved value is never shown again.
- An empty field shows Not configured when nothing is saved and Configured; leave blank to keep when a value is saved.
- Leave a field blank to keep the saved value. Type a new value only to replace it.
- Values cannot contain spaces. Access tokens and signing keys have at least 16 characters. A location ID has 8 or more letters, digits, hyphens or underscores.
- Sandbox and production values are stored separately, so you can prepare production while still testing.
Currency rules
Square charges in the currency of the seller location, so the store must sell in that same currency.
- Select the currency of each location in Sandbox location currency and Production location currency.
- The payment method is offered only when the currency the customer has selected in the storefront equals the location currency of the active mode. A customer browsing in another currency does not see Square.
- Before every payment, the store asks Square for the location and checks that it is active, that its currency equals the order currency, and that its country and currency form one of the supported pairs below. If any check fails, no payment is opened.
| Country of the Square location | Currency |
|---|---|
| United States | USD |
| Canada | CAD |
| United Kingdom | GBP |
| Australia | AUD |
| Japan | JPY |
| Ireland, France, Spain | EUR |
The amount sent to Square is the OpenCart order total converted with the order's currency rate and rounded to two decimals, or to none for JPY. A server with 32-bit PHP cannot open payments.
Several stores
Settings and Square credentials are independent for each store. Choose the store in Store at the top of the editor, then fill in and save its own credentials and currencies. Each store can use a different Square application or location, and each store has its own notification URLs. A store without saved credentials does not offer the method.
Changing credentials later
Every payment attempt remembers the Square application and location it was opened with. If you replace the access token or the location ID while payments are still unsettled, those earlier attempts are not verified with the new account. They are moved to Review in Square with the reason The order changed after opening the payment. Check them in the Square Dashboard. Before replacing credentials, wait until Payment activity shows no attempts awaiting payment or pending.
Still need help?
Open a support ticket from your account and our team will look at your store with you.