Webhooks
Webhooks tell WordPress when Square completes a payment — even if the customer closes the browser before returning to your site.
Why webhooks matter
Without a saved Square payment ID, you cannot refund from WooCommerce. Payment IDs are usually saved when:
- The buyer returns to your site after payment, or
- Square sends a payment.completed webhook
Setup
- Go to Payments Square Connect → Connect.
- Copy the Webhook URL shown on the screen.
- Open the Square Developer Dashboard → your application.
- Add the webhook URL and subscribe to payment events (e.g.
payment.completed). - Save in Square and in WordPress.
Sandbox vs Live
Configure webhooks for both environments if you test in Sandbox and accept Live payments.
Troubleshooting
| Symptom | Fix |
|---|---|
| Order stuck Pending after payment | Check webhook URL and Square event subscriptions |
| Missing payment ID on order | Enable webhooks; wait a few minutes and check order notes |
| Refund fails | Confirm payment ID exists on the order meta |
Enable Debug Log on the Connect screen and check WooCommerce → Status → Logs (source shc4wc) for webhook errors.