# Your first online payment

Put Moyasar in test mode with its keys and its bank journal, send a client the payment link of an invoice, and follow a card payment that came back authorized until you decide to capture it.

An online payment lets a client pay an invoice by card from a link, without anyone in the firm typing the payment in. This walk-through follows one payment from the provider to the invoice. On the demo database the Moyasar provider is already in test mode and one invoice already holds a card payment waiting for a decision; on your own database you fill the same fields with the keys of your Moyasar account.

## Before you start {#before-you-start}

- You need the **Administrator** access right on **Accounting**, and the **Administrator** role on your user: payment providers belong to the platform's settings, and only that role opens them.
- You need a Moyasar merchant account for its keys. In test mode no card is really charged.

## Step 1: the payment providers {#providers}

Open **Accounting/Configuration/Online Payments/Payment Providers**. Each card is a provider. **Moyasar** carries two labels: **Test Mode**, and **Unpublished**, which means that only the firm's own users see it on a payment page. **Tamara**, the instalment provider, is described in [Set up Tamara](set-up-tamara); the cards with an **Install** button are gateways that are not installed.

![The payment providers; Moyasar is in test mode and not yet published.](https://jaah.app/web/image/11464-68ed733f/online-payments-first-payment-providers-en.png)

## Step 2: the state {#state}

Click the **Moyasar** card. The **State** has three values: **Disabled** (offered nowhere), **Test Mode** (payments go through Moyasar's test environment, with test keys and test cards) and **Enabled** (real payments, with live keys). Keep **Test Mode** while you try; the ribbon in the corner of the form says so too.

![The provider's state; Test Mode takes no real money.](https://jaah.app/web/image/11468-590f7d59/online-payments-first-payment-provider_state-en.png)

## Step 3: the keys {#keys}

The **Credentials** tab holds what you copy from the Moyasar dashboard: the **Publishable Key**, which starts with pk_ and is sent to the client's browser to draw the card form, the **Secret Key**, which starts with sk_ and never leaves the server, and the **Webhook Secret Token**, which proves that a notification really comes from Moyasar. A test key is refused on an enabled provider and a live key on a provider in test mode, so the keys and the state always agree.

![The keys copied from the Moyasar dashboard, test keys while in test mode.](https://jaah.app/web/image/11472-f65b5dae/online-payments-first-payment-provider_keys-en.png)

## Step 4: currency and journal {#currency-and-journal}

Open the **Configuration** tab. Moyasar settles in Saudi riyals; **Enable Multi-Currency** adds the US dollar, the euro, the pound sterling, the UAE dirham, the Kuwaiti, Bahraini and Jordanian dinars, the Omani and Qatari riyals and the Egyptian pound. It is ticked here because the demo invoices are in dollars. Tick it on your database only when multi-currency is also active on your Moyasar account, or the client's payment is refused after the card is typed.

![Multi-currency lets Moyasar take payments in dollars, as the demo invoices are.](https://jaah.app/web/image/11476-59adb46f/online-payments-first-payment-provider_currency-en.png)

Lower down, the **Payment Journal** is the bank journal in which every successful payment is recorded, **Bank** here. If you changed anything, click the cloud icon **Save manually**.

![The bank journal that receives every successful payment.](https://jaah.app/web/image/11480-253e5b78/online-payments-first-payment-provider_journal-en.png)

## Step 5: send the payment link {#payment-link}

Open **Accounting/Customers/Invoices** and open **INV/2026/00008**, posted and not paid. In the **Actions** menu, choose **Generate a Payment Link**. The window proposes the amount due, and **Generate and Copy Payment Link** copies the link, ready to paste into an e-mail or a message to the client. The link opens the invoice on the customer portal; while Moyasar is in **Test Mode** it stays unpublished, so only the firm's own users see it there. [Send a payment link](send-a-payment-link) shows how to ask for part of the amount.

![The payment link of the invoice, copied with one click.](https://jaah.app/web/image/11484-530388ec/online-payments-first-payment-link_dialog-en.png)

Click **Close** to leave the window.

## Step 6: a payment comes back {#payment-back}

Go back to the invoices and open **INV/2026/00009**: OpenWood paid it by card, and the chatter says that the transaction **PAYDEMO-0001** of 1,799.00 has been authorized. Because **Capture Amount Manually** is ticked on Moyasar, the money is only held on the client's card: nothing is recorded in the books yet, and the invoice is still not paid.

![A card payment that came back authorized, noted in the invoice's chatter.](https://jaah.app/web/image/11412-7e66acd8/online-payments-capture-capture_invoice-en.png)

Click the **Payment Transaction** button at the top of the invoice; on a phone it sits behind the lightning icon. The transaction shows its state, **Authorized**, the amount, the payment method **Card**, the provider and the **Provider Reference**, the number Moyasar gave the payment.

![The transaction behind it, with its reference at Moyasar and its state.](https://jaah.app/web/image/11418-435adc45/online-payments-capture-capture_transaction-en.png)

## What happens next {#what-next}

From the invoice, **Capture Transaction** takes the money and **Void Transaction** releases it: see [Capture, void or refund an online payment](capture-void-or-refund). Once the money is taken, the payment is posted in the **Payment Journal** and matched with the invoice by itself, and the invoice shows **Paid**. Matching the provider's deposit with the bank statement is explained in [Banks, cash and currencies](/docs/banks-and-cash).

[How an online payment reaches the books](how-an-online-payment-reaches-the-books) explains each stage, [Set up Moyasar](set-up-moyasar) every field of the provider, and [Online payment settings](online-payment-settings) the switch that opens invoices to online payment.

---

- Source: https://jaah.app/docs/online-payments/first-online-payment
- Updated: 2026-10-23
- Version: Online payments 19.0.1.3.0
- Verified: 2026-10-23
