What webhook Notification URL and events should I use for Square Sandbox? - Forum | JoomShaper
Staff replied EasyStore Joomla 6 latest

What webhook Notification URL and events should I use for Square Sandbox?

Asked by K 3 days ago Last activity 1 day ago

I'm using the latest version of EasyStore on Joomla 5.4.10 and setting up Square Sandbox payments.

The Square documentation asks me to create a webhook subscription in Square, but it doesn't provide the Notification URL. In EasyStore's Square settings, I can see the Test Webhook Secret field, but I can't find a webhook URL.

What is the exact Notification URL for Square Sandbox payments in EasyStore, and which payment events should I select for the webhook subscription?

6 replies

Ofi Khan Staff

Hello K,

Thank you for reaching out to our technical support forum. I’m sorry to hear about the trouble you’re experiencing.

Please follow the documentation and try the setup process:

EasyStore Square Payment Setup

Best regards

Ziaul Kabir Staff

Hi K,

Thanks for reaching out to us.

EasyStore uses one webhook URL format for all its payment plugins, so the Notification URL for Square is:

https://YOUR-DOMAIN/index.php?option=com_easystore&task=payment.onPaymentNotify&type=square

Replace YOUR-DOMAIN with your site's domain. A few things to check:

  • The type value. It should match the Square plugin's element name. You can see it under System → Plugins.
  • HTTPS and a public domain. Square rejects localhost and .test domains. If you're testing locally, use a tunnel such as ngrok and put its domain in the URL.
  • An exact URL match. Square signs each notification using the URL you registered. If that URL differs from the one your site sees (http vs https, www vs none), signature verification fails.

Events to subscribe to (Square Developer Dashboard → Sandbox → Webhooks → Add subscription):

  • payment.created
  • payment.updated. This is the important one, because it fires when a payment becomes completed, failed or canceled.
  • refund.created and refund.updated, if you want refunds reflected in EasyStore.

After you save the subscription, Square shows a Signature key. Paste that into EasyStore's Test Webhook Secret field. When you go live, create a separate production subscription and put its key in the live secret field.

Please test with a sandbox payment and tell us if the order status updates. If it doesn't, check Square's webhook delivery log for the response code.

Thanks

K Asked this

Thanks for the reply. I have followed those instructions. But my question was:

“What is the exact Notification URL” for Square Sandbox payments? I don’t know what to use for this URL?

K Asked this

The Plugin Type field in my square plugin says “easystore” does that sound right? Your example had “square”

K Asked this

Okay I think mine should be squareup not square.

I set that up. Payment in the sandbox works, but the link to view the order (see hidden) brings up an error?

Ziaul Kabir Staff

Hi K,

EasyStore has an official Square gateway. It appears as Square (element squareup, version 1.0.1) under EasyStore → Settings → Payments → Available payment gateways. If you haven't installed it from there, do that first.

1. The Notification URL

You're right that your plugin's name is squareup. The "easystore" value in the Plugin Type field is the plugin group, not the name. EasyStore builds the webhook URL the same way for every gateway, so yours is:

https://www.ast-simulators.com.au/index.php?option=com_easystore&task=payment.onPaymentNotify&type=squareup

Paste it into your Square Sandbox webhook subscription. It must match exactly, including https and www, because Square signs each notification using the URL you registered.

After you save the subscription, Square shows a Signature key. Paste it into the Test Webhook Secret field in the Square plugin settings.

2. Events

The one that matters is payment.updated, which fires when a payment completes or fails. payment.created and the refund.* events are optional extras. If the plugin's settings page lists the events it needs, use those instead.

3. The order page error

"Unknown format specifier ')'" is a PHP formatting error. It happens when text containing a % sign, such as (2.9%), is passed through sprintf or Text::sprintf. It isn't a payment or token problem. The order page started to render and then failed on one piece of text. Since the payment worked, check these:

  1. Labels saved on order 1001. Look for a % in the payment method name, a fee description, or a discount or tax label (for example "Square fee (2.9%)").
  2. Language overrides. Check System → Language Overrides for any string you've edited that contains %.
  3. Versions. Make sure the Square plugin and EasyStore are both on their latest versions.

To find the exact line, go to System → Global Configuration → Server, set Error Reporting to Maximum, and enable Debug System. Reload the order page and post the stack trace, which shows the file and line.

To confirm the cause, place a second sandbox order with no discount code. If that order page loads, the % is in the data on order 1001.

Best Regards,

Log in to reply.