WooCommerce
Add Teyra Pay to your WordPress and WooCommerce store as a payment gateway.
Not released yet
The Teyra Pay plugin for WooCommerce is in development and not yet published. This page describes how setup will work so you can prepare. Contact support@teyra.co for early access.
The Teyra Pay WooCommerce plugin adds a Teyra Pay payment gateway to your checkout. Customers are redirected to the Teyra Pay hosted checkout and return to the WooCommerce Order received page. The plugin marks an order as paid only after it confirms the payment with the Teyra Pay API when the customer returns, or through a signed webhook, and payments appear in your Teyra Pay dashboard with channel set to woocommerce.
Requirements
- WordPress 6.0 and WooCommerce 8.0 or later, with HTTPS enabled. Classic checkout and the Cart/Checkout blocks both work, and the plugin is compatible with High-Performance Order Storage (HPOS).
- PHP 7.4 or later.
- A store currency supported by Teyra Pay (
KWD,SAR,AED,QAR,BHD,OMR,JOD,EGP). - A Teyra Pay account. Live payments need an approved account.
Setup
Install the plugin
In WordPress admin, open Plugins → Add New, upload the Teyra Pay plugin .zip (or search for Teyra Pay once it is listed), then click Activate.
Enter your API key
Open WooCommerce → Settings → Payments → Teyra Pay. Keep Mode on Test and paste a test secret key (sk_test_…) from Developers → API keys in the Teyra Pay dashboard into Test secret key, then save.
Connect webhooks
The settings page shows your store's webhook URL, for example https://yourstore.com/wc-api/teyra_pay/ (or https://yourstore.com/?wc-api=teyra_pay without pretty permalinks). Click Connect webhooks to register it with Teyra Pay for the selected mode and save its signing secret automatically, or add it yourself under Developers → Webhooks and paste the signing secret (whsec_…) into Test webhook signing secret.
The plugin verifies the Teyra-Signature header of every webhook and ignores events for other stores, other modes and payments that weren't made through WooCommerce.
Configure checkout
Set the title and description customers see, in English and in Arabic (the Arabic text is shown when the site language is Arabic), and choose the checkout language: follow the site language, or always Arabic or English. Enable the gateway and save.
Place a test order
Place an order, choose Teyra Pay and pay with a test card on the test checkout page. The order should move to Processing (or Completed when every product is virtual and downloadable). The order notes show the payment ID (pay_…), which is also the order's transaction ID.
Go live
When your Teyra Pay account is approved, set Mode to Live, paste a live key (sk_live_…) into Live secret key, save, and click Connect webhooks again to connect a live webhook endpoint. Test and live keys and webhook secrets are stored separately, so you can switch back to test mode at any time.
Refunds
Use Refund on the WooCommerce order page. The plugin sends a full or partial refund to Teyra Pay and adds an order note with the refund ID (re_…) and its status. If the refund is still pending, the webhook adds another note when it completes or fails. Refunds you make from the Teyra Pay dashboard are also added to the WooCommerce order.
Troubleshooting
| Problem | Check |
|---|---|
| Orders stay Pending payment | Webhook deliveries in the Teyra Pay dashboard. Security plugins or a firewall may be blocking POST requests to your webhook URL. |
"Invalid signature" in the logs (turn on Debug log; logs are in WooCommerce → Status → Logs, source teyra-pay) | The signing secret in the plugin matches the endpoint's secret, and the endpoint mode (test/live) matches the API key. |
| Amounts look wrong | The store currency's decimal places match the currency exponent (3 for KWD, BHD, OMR, JOD). |