Skip to main content

Configuration

Before accepting payments, you must configure your API keys and webhook settings in WooCommerce.

Access Settings

  1. Go to WooCommerce -> Settings.
  2. Click on the Payments tab.
  3. Locate Moyasar and click Manage.

Moyasar_General_Settings_in_WooCommerce


API Keys

You need to enter your API keys to authenticate with Moyasar.

  1. Log in to your Moyasar Dashboard.

  2. Go to Settings -> API Keys.

  3. Copy your Publishable Key and Secret Key.

  4. In WooCommerce:

    • Test Mode: Enable this checkbox to use the Test Environment.
    • Test Secret Key: Paste your sk_test_... key.
    • Test Publishable Key: Paste your pk_test_... key.
    • Live Secret Key: Paste your sk_live_... key.
    • Live Publishable Key: Paste your pk_live_... key.
  5. Click Save changes.

Entering_API_Keys_in_WooCommerce


Webhooks

Webhooks are crucial for receiving payment updates (e.g., successful payments, refunds) asynchronously. This ensures order statuses are updated even if the user closes their browser early.

  1. Log in to your Moyasar Dashboard.
  2. Go to Settings -> Webhooks.
  3. Click Add Webhook.
  4. Webhook Endpoint: Copy the "Webhook URL" and "Secret" displayed in your WooCommerce Moyasar settings.
    • It looks like: https://your-store.com?wc-api=moyasar_webhook
  5. Events: Select All Events & Post Request.
  6. Click Save.

Webhook_Configuration


Order Status Configuration

You can customize how WooCommerce tracks orders based on payment events. This allows you to match your store's fulfillment workflow.

Options:

  • Success Status: The status to apply when a payment is successful (Default: Processing).
  • Failed Status: The status to apply when a payment fails (Default: Failed).
  • Refund Status: The status to apply when a refund is processed via Moyasar (Default: Refunded).
  • Void Status: The status to apply when an authorization is voided (Default: Cancelled).