Set up Square for Events Manager Pro
ProEvents Manager Pro - SquareRequires Events Manager Pro. Compare plans
The Square add-on adds two gateways to Events Manager Pro, and you can use either or both:
- Square Web Payments puts a card form inside your booking form, so customers never leave your site.
- Square Checkout sends customers to a payment page hosted by Square, then returns them to your site.
Both use the same Square account and the same credentials, so you enter your details once.
- Events Manager Pro 3.2.7 or later and the Events Manager Pro - Square plugin, both activated. The plugin needs PHP 7.4 or later. Paying from the payment page and taking deposits need Pro 3.10 and Square add-on 1.1.0.
- A Square account. You can build and test everything in Square's sandbox before taking real payments.
- Your site served over HTTPS, in the sandbox as well as live. Neither gateway is offered to visitors without it.
- A site Square can reach from the internet, so that it can send payment notifications.
Get your Square credentials
You need three values from Square: an Application ID, an Access Token and a Location ID.
-
Go to the Square Developer Dashboard and sign in.
-
Add an application, give it a name you will recognize (your site's name, for example), and open it.
-
Copy the three values for the mode you are setting up:
- Sandbox (testing)
- Production (real payments)
Open Credentials and make sure the toggle at the top is set to Sandbox. Copy the Application ID, which starts with
sandbox-sq0idb-, and the Access token. Then open Locations and copy the Location ID.Open Credentials and switch the toggle at the top to Production. Copy the Application ID, which starts with
sq0idb-, and the Access token. Then open Locations and copy the Location ID of the location that should receive these payments.
A production access token can take real payments. Don't share it or post it anywhere public. If it is ever exposed, replace it in Square and save the new value in Events Manager.
Connect Events Manager to Square
-
Go to Events then Payment Gateways and click Square Web Payments or Square Checkout. The credentials are shared, so either one will do.
-
Open the [Test] API Keys/Notifications tab for sandbox values, or [Live] API Keys/Notifications for production values.
-
Paste in your Application ID, Access Token and Location ID, and click Save Changes.
The three Square credentials. Payment Notifications below them reports on the webhook.
-
Read the notice at the top of the page. Saving creates Square's payment notifications (a webhook subscription) for you, and you should see Square webhook subscription created for Test Mode. or Live Mode. On later saves it reads verified. You don't set up anything in the Square dashboard.
-
Go back to Events then Payment Gateways and click Activate under each Square gateway you want to offer.
Each gateway starts in test mode and uses the sandbox values. The banner above the tabs on its settings page shows the mode and has the button to change it. The two gateways switch mode separately.
Test it
-
With the gateway in test mode, open a priced event on your site and book a ticket, choosing your Square payment method.
-
Pay with one of Square's sandbox test cards, for example
4111 1111 1111 1111with any future expiry date and any CVV. -
You should arrive at your thank you message, and the booking should be Approved in Events then Bookings with a Completed transaction.
Square's test card page also lists cards that decline, so you can see what your customers would see.
Go live
-
Save your production values on the [Live] API Keys/Notifications tab and check for the Live Mode webhook notice.
-
Click Enable Live Mode in the banner above the tabs, on each Square gateway you use.
-
Make one small real booking to confirm it works. You can refund it from your Square dashboard afterwards.
Payment notifications
Square tells your site about payments, refunds and disputes through one webhook subscription per mode, shared by both gateways. Events Manager creates it when you save your credentials, names it Events Manager Pro - Square (Sandbox) or (Live), and repairs it on later saves if its address or events have changed. Don't delete it in Square.
It listens for these events:
| Event | What Events Manager does with it |
|---|---|
payment.created, payment.updated | A completed payment is recorded and the booking approved. A payment Square reports as approved or pending sets the booking to Pending. A failed or canceled payment releases a booking that was still waiting. |
refund.created, refund.updated | A completed refund is recorded against the booking. |
dispute.created, dispute.state.updated | A dispute is recorded against the booking, once. |
The access token must be allowed to manage webhook subscriptions (Square's WEBHOOKS_WRITE permission).
Refunds
Refund a payment from your Square dashboard. There is no refund button in WordPress. Once Square reports the refund as completed, Events Manager records a Refunded transaction with a negative amount.
- When nothing paid is left on the booking, it is cancelled.
- A partial refund sets the booking to Pending, without a status email.
- A booking paying a deposit and balance is only cancelled once nothing is left paid.
Refunds that Square reports as pending, rejected or failed are not recorded.
Disputes
When a customer disputes a charge with their bank, Square notifies your site and a Disputed transaction is recorded for the disputed amount. A dispute for the full booking price cancels the booking, and a smaller one sets it to Pending. Later changes to the same dispute are ignored, so if you win it, approve the booking again yourself.
Unpaid, abandoned and declined payments
A booking is saved as Awaiting Online Payment before the customer pays. Each gateway's General Options tab has Unpaid Bookings Expiry (in minutes) and Expired Booking Action (No Action, Delete or Cancel), described in Unpaid, abandoned and expired bookings.
When a booking's expiry runs out, Events Manager asks Square before doing anything:
- If Square has a completed payment, it is recorded and the booking is approved. This covers a notification that never arrived.
- If nothing was paid, a Square Checkout payment link is deleted at Square first, so it can't be paid afterwards, and then the expiry action is applied.
- If Square can't be reached, or the result of a card charge is unknown, the booking is left alone. One day after its expiry it is cancelled. It is never deleted in this case.
What the customer sees on a declined card differs between the two gateways, and is covered on the Square Web Payments and Square Checkout pages.
Troubleshooting
The Square payment method is missing from the booking form
Make sure the gateway is Active, the event has a priced ticket, and the page is loaded over https://. This applies in test mode too.
"Could not create Square webhook subscription" when saving
The message continues with Square's reason. The usual causes are wrong credentials, an access token without permission to manage webhooks, or a site Square can't reach, such as a local development site. For local development, define EM_GATEWAY_API_DOMAIN in wp-config.php with the address of a tunnel to your site.
"You have not entered Live Mode Square credentials"
This appears after saving while one mode's fields are empty. It is a reminder, and you can ignore it for a mode you are not using yet.
A booking stays at Awaiting Online Payment after the customer paid
Square notifies your site when a payment completes. If that is delayed or lost, Events Manager checks with Square when the booking's expiry runs out, so set an Unpaid Bookings Expiry. If it keeps happening, save your credentials again and look for the green confirmation under Payment Notifications.
A refund is not showing on the booking
Only completed refunds are recorded, so wait until Square has finished processing it. If nothing changes, save your credentials again so the webhook subscription is checked.
"The card form was loaded for a different payment mode, please reload the page and try again."
The gateway was switched between test and live mode while the customer had the form open. Reloading the page fixes it.