Back

VibeFox Moyasar for PrestaShop — Help

Requirements

PrestaShop: 8.0 to 9.x.

PHP: 8.0 or later. The module refuses to install on older PHP versions.

Currency: the cart currency must be SAR, AED, USD, EUR, KWD, BHD or OMR. For any other currency the payment method is hidden at checkout.

Moyasar account: you need the secret API keys of your Moyasar account (test and live). Only the secret keys are used. The publishable key is not needed, because the payment happens on the Moyasar page. A webhook in the Moyasar Dashboard is recommended (see Configuration).

VibeFox license key: bought on vibefox.net. One key works on one domain.

Installation

1. In the back office go to Modules > Module Manager and click Upload a module. Choose the module ZIP file.

2. When the upload finishes, click Configure, or find VibeFox Moyasar Payment Gateway in the module list later and click Configure.

3. Paste your VibeFox license key into License key in the license block at the top of the Configure page and click Activate (see License key).

4. Paste your Moyasar secret keys and click Save. Set up the webhook in the Moyasar Dashboard (see Configuration).

5. Turn on Enable/Disable and click Save. Place a test order in test mode, then turn off Test mode.

On install the module creates two order statuses, Awaiting Moyasar payment and Moyasar payment on hold. PrestaShop offers a new payment module for all currencies, countries and customer groups. You can limit them in Payment > Preferences.

Configuration

All settings are on the module page: Modules > Module Manager > VibeFox Moyasar Payment Gateway > Configure. Each section has its own Save button, which saves the whole page. Above the fields the page warns you when the current mode has no secret key (the payment method is then hidden at checkout), when no webhook shared secret is saved (the webhook then rejects every call) or when the shop's default currency is not supported. While the module is enabled in test mode it shows Test mode is active: payments are simulated, no money is charged. When you save, the module refuses a publishable key, a key of the other mode or a key with spaces, keeps the previous value and shows the reason.

Moyasar

Enable/Disable: Enable Moyasar turns the payment method on or off. Default: off.

Title: the payment method name customers see at checkout. It is also the payment method name stored in the order. Default: Pay with Moyasar. Required.

Description: the text shown under the payment method at checkout. Default: You will be redirected to the secure Moyasar payment page to pay with mada, Visa, Mastercard, Apple Pay or STC Pay. In test mode the checkout adds (Test mode: no real payment is made.)

API keys

Copy the secret keys from Moyasar Dashboard > Settings > API Keys. Test and live keys are separate. Test mode uses only the test key, live mode only the live key.

Test mode: uses the test secret key: payments are simulated and no money is charged. Default: on. Turn it off to accept real payments with the live secret key.

Test secret key: the secret key of the test mode. It starts with sk_test_.

Live secret key: the secret key of the live mode. It starts with sk_live_.

Saved keys and secrets are never shown again. The field stays empty and shows Saved — leave empty to keep it. Type a new value only to change it.

Payment notifications (webhook)

The webhook is recommended, not required. Orders are also confirmed when the customer returns to the shop and by the invoice notification that Moyasar sends to your shop automatically when the invoice is paid. The webhook covers customers who close the browser before returning and reports refunds made in the Moyasar Dashboard. Add it in Moyasar Dashboard > Settings > Webhooks.

Webhook URL: shown read-only with a Copy button. With friendly URLs it looks like https://your-shop/module/wcp_moyasar_payment_gateway/webhook, possibly with a language code such as /en/. Copy the URL exactly as the settings show it. HTTP method: POST.

Webhook shared secret: enter the same value as Shared secret of the webhook in Moyasar. If nothing is saved, Save generates a random secret; Generate a new secret replaces the saved one. A generated secret is shown once above the settings after saving and never again, so copy it into Moyasar at once. Webhooks without the correct shared secret are rejected.

Select these events for the webhook (they are also listed in this section):

payment_paid: the customer paid the invoice.
payment_failed: the payment failed.
payment_refunded: the payment was refunded, for example in the Moyasar Dashboard.
payment_voided: the payment was voided.

Nothing in a webhook or notification is trusted directly: for each one, the module reads the invoice from the Moyasar API with the secret key of the mode the invoice was created in and checks that it was created for this cart. Payments of other integrations on the same Moyasar account are ignored. One shared secret serves both modes.

Orders

Status after payment: the order status set after a confirmed payment. The order is created directly in this status.

Processing (default): the standard PrestaShop status Payment accepted.
Completed: every paid order becomes Delivered.
On hold: every paid order goes to Moyasar payment on hold and waits for your manual review. The payment is still recorded on the order.

Advanced

Clear saved secrets: tick Test secret key, Live secret key or Webhook shared secret and click Save to remove it. An empty field keeps the saved value.

Debug log: logs API calls and notifications to logs/moyasar_p_debug.log.php in the module folder. The file cannot be opened from the web. Errors and warnings are always logged. API keys, card data and customer details are never logged. Default: off.

Log: shows the current size and the latest entries of the log. Click Clear log to empty it.

Clean uninstall: when on, uninstalling the module deletes the module settings and the log. Payment details stored with orders (Moyasar invoice and payment IDs) are kept, so refunds remain traceable. Default: off.

Checkout

At the payment step the customer chooses the payment method (by default Pay with Moyasar) and confirms. The module creates a Moyasar invoice for the cart total in the cart currency and sends the customer to its payment page. There the customer pays with any method active on your Moyasar account. The invoice shows Order #, the cart number and your shop name. No order exists yet at this point.

The order is marked paid only after Moyasar confirms it: the module reads the invoice from the Moyasar API and checks that it is paid, belongs to this cart and has the exact cart amount and currency. The order is then created and the customer sees the standard order confirmation page with Your payment with Moyasar has been received. If Moyasar holds the payment for review, the page shows Your payment is being reviewed by Moyasar. The order will be updated automatically when Moyasar confirms it — please do not pay again. If the order is on hold for your review, the page says the payment was received and the order is being reviewed. If a payment under review later fails, or the unpaid order was cancelled, the page shows Your Moyasar payment was not completed. Please contact us about this order.

If the customer comes back without paying (for example with the back button of the payment page), they are back at checkout with one of these messages: The payment at Moyasar was not completed. You can try again or choose another payment method., Your Moyasar payment was declined or has expired. Please try again or choose another payment method. or, when the payment cannot be checked yet, We could not confirm your payment with Moyasar yet. If you completed the payment, the order will be updated automatically in a few minutes — please check your e-mail before paying again. The cart is kept.

The customer can try again. If the open payment page of the cart still has the same amount and currency, it is reused. If the cart total changed, the old payment page is cancelled at Moyasar and a new one is created, so the old one can no longer be paid. If the previous invoice turns out to be paid already, the order is created instead of a new payment.

If Moyasar cannot start the payment, the customer stays at checkout with a short message, for example The Moyasar payment service is not responding. Please try again in a few minutes., and can choose another payment method. The details are written to the log.

The webhook and the invoice notification work while the shop is in maintenance mode and are not blocked by the country restriction of your shop.

The module takes one-time payments on the Moyasar page only. It has no card form on your own checkout, no saved cards or tokenization, no subscriptions and no separate authorize and capture.

Orders and refunds

Order statuses

No order yet: the customer was sent to Moyasar and has not paid, or Moyasar has not confirmed the payment yet. Only the cart exists.

Payment accepted, Delivered or Moyasar payment on hold: the payment was confirmed. The status follows Status after payment. The payment is recorded with the Moyasar payment ID as the transaction ID, and a note shows how the payment was confirmed (webhook, invoice notification, customer return or checkout), the invoice ID, the payment ID and the payment method.

Awaiting Moyasar payment: Moyasar holds the payment for review. The order moves to the paid status when Moyasar confirms the payment.

Payment error: the payment under review failed.

Moyasar payment on hold after payment: Moyasar reported a different amount or currency than the cart total (for example, the cart was changed in another tab after the payment started), or the invoice was paid after you had cancelled the order. The order is not marked paid, but the amount actually received is recorded when it is in the order currency. The note explains it. Check the payment in the Moyasar Dashboard and fulfil the order or refund the payment.

Refunded: the payment was fully refunded through the module.

A paid order is never changed back by later events. If a second invoice of a cart that is already paid is paid too (for example from two browser tabs), the order is not changed. A note asks you to refund the duplicate payment in the Moyasar Dashboard.

Moyasar payment block

The order page shows a Moyasar payment block with the Moyasar invoice ID, the payment ID, the method (for example the card brand and the last four digits), the status, the amounts paid and refunded, a Test mode badge for test payments, the refund history and the Moyasar notes of the order.

Refunds

In the Moyasar payment block enter the amount (the amount not refunded yet is filled in), optionally a reason, and click Refund via Moyasar. Confirm the question Refund this amount through Moyasar? This cannot be undone. Full and partial refunds are supported. You need the right to edit orders; access to the Modules pages is not needed. Refunds are made in the amount and currency Moyasar charged, so after an amount mismatch you can refund up to what the customer actually paid, not the order total. A full refund of a card payment made less than 2 hours ago is sent as a void (cancel before settlement, no fees); otherwise it is a refund. The refund uses the secret key of the mode the payment was made in (test or live), so that mode's key must be set. The module first checks the currency, status and refundable amount of the payment at Moyasar. If Moyasar does not accept the refund, the block shows the error and no refund is recorded. A successful refund or void is added to the refund history and the notes. A full refund sets the order to Refunded. A partial refund does not change the status. Refunds are available once Moyasar has confirmed the payment.

The module does not create credit slips. The standard PrestaShop refund buttons of the order page do not send money back through Moyasar.

Refunds and voids made in the Moyasar Dashboard arrive by the webhook. If Moyasar shows more refunded than the module recorded, a note is added to the order. The order status and credit slips are not changed automatically. Update them manually if needed, without Refund via Moyasar.

License key

The module works with a VibeFox license key from vibefox.net. The license block License — VibeFox Moyasar Payment Gateway is the first block on Modules > Module Manager > VibeFox Moyasar Payment Gateway > Configure, above the settings. Paste the key into License key and click Activate. After that the block shows the key masked, the status (for example the date the license is active until and your domain) and the buttons Check now to check the status again, Change key to enter another key and Remove key to remove the key from this shop. Below them are the line Product: presta-payment-moyasar and the link Manage licenses and domains in your account, which opens your vibefox.net account. Only employees with the Configure permission for the module can change the key. The texts of the block follow the back office language (English and Russian are included).

If the key is not accepted, the block says why, for example Key not found, This key belongs to another product, Domain limit reached or License expired on a date. After the shop address changes, or after you free a domain slot in your account, click Check now. If the license server cannot be reached, the module keeps working on the last known status.

One key works on one domain: the domain of the main shop, also in a multistore setup. Removing the key from the shop does not free its domain slot. Free the slot in your vibefox.net account.

Without an active key, Moyasar is not shown to customers at checkout. If a payment is started anyway, the customer sees This payment method is not available. Please choose another one. The PrestaShop storefront does not know that you are logged in to the back office, so the payment method is hidden for you too: you can set up the module before you buy a key, but not test it at checkout. A reminder appears in Modules > Module Manager on the Alerts tab. Existing orders are not affected: payments already started are still confirmed, and refunds work.

When a license expires, the module keeps working, but updates and support need a renewal. The status is checked again automatically while you work in the back office: once a day for the first 14 days after the key is entered, then once a week. No cron job is needed. Uninstalling or resetting the module always removes the license key and license status.

Troubleshooting

Moyasar does not appear at checkout: check that the license is active, Enable/Disable is on, the current mode has a secret key (Test secret key in test mode, Live secret key in live mode) and the cart currency is SAR, AED, USD, EUR, KWD, BHD or OMR. The settings page shows a warning when the key is missing or the shop currency is not supported. In Payment > Preferences check that the module is allowed for the cart currency, the customer's country and the customer's group.

The payment went through, but no order was created: the confirmations did not reach your shop. Set up the webhook: in the Moyasar Dashboard check that it exists, that its URL is exactly the Webhook URL from the settings, the method is POST, the four events are selected and its shared secret equals the one saved in Webhook shared secret. The order is also created when the customer returns to the shop or tries to pay the same cart again.

Webhook answers Unauthorized: the shared secret in Moyasar differs from the saved one. Type the secret of the Moyasar webhook into Webhook shared secret and save, or tick Generate a new secret, save and paste the secret shown into Moyasar.

Webhook answers Webhook secret not configured: no shared secret is saved, for example after it was removed with Clear saved secrets. Click Save to generate one and copy it to Moyasar.

Webhook answers Key not configured: the invoice was created in a mode (test or live) whose secret key is empty. Enter that key.

Webhook answers Verification failed or Try again later: the invoice could not be read from the Moyasar API, the cart was being updated by another request at the same moment, or the order could not be created (for example, the module is disabled). Moyasar retries the webhook. Turn on Debug log to see the reason.

The webhook URL shows Method not allowed in the browser: this is normal. The URL accepts only POST requests from Moyasar.

Error on save about the key: a publishable key (pk_...) or a key of the other mode was pasted, or the key contains spaces. The previous value was kept. Test keys start with sk_test_, live keys with sk_live_.

The customer sees an error when choosing Moyasar: turn on Debug log and look at the Log field on the module page. This payment method is temporarily unavailable. Please choose another payment method or contact us. usually means a wrong or missing secret key. A payment for this order has already been received and is being reviewed. Please contact us instead of paying again. means the cart already has a paid invoice that could not be turned into an order; check the log.

Order is Moyasar payment on hold after payment: read the Moyasar notes in the Moyasar payment block. The paid amount or currency differed from the cart, or the payment came after the order was cancelled. Fulfil the order or refund the payment.

Refund fails: read the message. If the payment was made in the other mode, enter that mode's secret key. If the amount is larger than the amount still refundable at Moyasar, part of the payment was already refunded, for example in the Moyasar Dashboard. If Moyasar did not confirm the refunded amount, check the payment in the Moyasar Dashboard before trying again.

Uninstall

Go to Modules > Module Manager, open the menu next to VibeFox Moyasar Payment Gateway and choose Uninstall. The license key and license status of this module are always removed. If Clean uninstall is on, the module settings and the log are removed. If it is off, all settings are kept for a later re-install. The Moyasar invoices, payments and refunds and the order statuses Awaiting Moyasar payment and Moyasar payment on hold are always kept, so old orders can still be refunded after a re-install. Existing orders keep their payment notes and transaction IDs.

Moyasar is a trademark of its respective owner. This module is not affiliated with or endorsed by Moyasar.