Requirements ↑ Back to top
The following are required for the Square payment integration:
- FooSales.com account with the Square Payments add-on
- Square account where the currency matches the currency of your WooCommerce store
- Square Terminal
Setup ↑ Back to top
In order for FooSales and Square to be able to communicate with each other, you will need to create a new or update an existing Square application in your Square Developer Dashboard.
Create New Square Application ↑ Back to top
Open your Square Developer Dashboard and choose New Application, Create Your First Application if it is a new account OR Open a previously created application if one already exists in your account.
When creating a new application, you will need to enter a name for your application and agree to the Square Developer terms of service.
Next, open your newly created application or existing application. If you created a new application, it will automatically be set to use the latest version of the Square production API. If you are using an existing application, it is recommended that it be set to use the latest version of the Square production API for security and functionality purposes. You can make sure that your application’s production API version is set to the latest version by scrolling to the bottom of the Credentials page.
If you are using an existing application, already have an integration setup using an older version of the Square production API, and you are worried about breaking your current implementation by changing the API version, then to be safe, we suggest you rather create a new application for your FooSales integration.
By clicking on the Production tab, you will see your unique Application ID and Access Token. You will need to enter these two keys in your FooSales WordPress plugin settings.
Plugin Settings ↑ Back to top
Next, you will need to add the FooSales webhook to your Square application. From the Production tab, click on the “Webhooks” menu and scroll down to the Connect v2 Webhooks section
Click on the “Add Endpoint” button and enter a name for the webhook such as “FooSales Terminal API“. Enter the webhook URL for your website e.g.:
Next, you will need to let Square know which events it needs to send to FooSales by checking each relevant event.
FooSales needs to be notified about the following events:
Once you click the “Save” button, you will see your newly added webhook.
FooSales WordPress Plugin Settings ↑ Back to top
After copying your production Application ID and Access Token, navigate to your WordPress Admin Area and open the FooSales plugin settings. Under Square Integration, paste your Application ID and Access Token, then save your settings and you’re good to go!
Pairing a Square Terminal ↑ Back to top
In order to process a payment at checkout using a Square Terminal, you will need to pair a Terminal device with FooSales. Open FooSales POS and navigate to the Settings screen and scroll to Square Settings. Here you will be able to choose which Square location should be associated with the device that the FooSales app is running on. For instructions on how to setup more than one Square location, please read this Square help documentation.
In order to pair a Square Terminal with FooSales, you will need to sign-in to the Terminal using a device code that will get generated in FooSales. Click on the “Generate Code” button to generate a new device code. Once the code has been generated, you will only have 5 minutes to sign-in to the Terminal before the device code expires, in which case, you will need to generate a new code and re-attempt the pairing process.
Once you enter the device code and the Terminal has loaded, the FooSales app will update to show that it has paired with the device successfully. If you want to pair a different device or change the Square location, you will first need to unpair the device in order to choose a different location and generate a new device code.
Processing Payments at Checkout Using a Square Terminal ↑ Back to top
When you’re ready to complete an order on the Checkout screen in FooSales using a paired Square Terminal, select Square Terminal Payment as the payment method.
When you click the Pay button, a checkout request will be sent to your paired Square Terminal. Follow the prompts on the Square Terminal in order to process the payment. FooSales will wait until the checkout is successfully completed.
Once the payment has been successfully completed, FooSales will submit the order to your WooCommerce database and the order will get submitted and marked as Completed in your WooCommerce store. The Square transaction will be linked to your WooCommerce order. If you open the completed order on the Orders screen, you will see the payment method highlighted if Square was used to process the payment. Tapping on this text will open the linked Square transaction in a browser window for your convenience.
If you navigate to the WooCommerce Order in your WordPress Admin Area, you will see the payment method marked as Square along with a link to View the transaction in a new browser tab.
Refunding an Order ↑ Back to top
If you entered your Square Access Token in your FooSales WordPress plugin settings and you refund an order in FooSales, the Square transaction will be automatically refunded to the card that originally made the payment. If the transaction contained split tenders or the refund failed for some unknown reason, the order status is changed to Refunded in WooCommerce and an error message is displayed that allows you to view the transaction and refund the payment manually through your Square account.
If you originally processed the payment on a paired Square Terminal and the original card needs to be presented, a refund request will be sent to the paired Square Terminal and the FooSales app will wait until the refund is successfully completed.
Please note: Refunding an order manually through WooCommerce will not automatically refund the Square payment. If you would like to refund an order from your WordPress Admin Area instead of FooSales, you will need to click on the View transaction link in the order view to open and manually refund the payment through your Square account and then set the WooCommerce order status to Refunded.