Overview
Moyasar integration in Tirdad syncs invoices to Moyasar and generates a payment link (Moyasar invoice URL) for each synced invoice.Synchronization Flow
The sync process is one-way (Tirdad → Moyasar) and works as follows:How it Works
1
Trigger
An invoice sync is triggered (automatically).
2
Creation
Tirdad creates an invoice object in Moyasar using the
secret_key.3
Link Generation
Moyasar returns a
url (the payment page).4
Metadata Update
Tirdad saves the Moyasar invoice ID and payment URL in the invoice metadata.
Invoice Data Model
Tirdad Invoice Structure
Moyasar Invoice Structure
Sync Configuration
The following fields are mapped during sync:Payment Flow & Webhooks
Payment Journey
1
User pays
User clicks the
moyasar_invoice_url.2
Processing
Payment is processed on Moyasar’s hosted page.
3
Webhook
Moyasar sends a
payment_paid webhook.4
Reconciliation
Tirdad receives the webhook, finds the invoice via the metadata/mapping, and updates the invoice status to
PAID.Error Handling
Testing
1
Create invoice
Create a Tirdad invoice.
2
Trigger sync (Automatically)
Trigger the sync to Moyasar.
3
Check metadata
Check invoice metadata for
moyasar_invoice_url.4
Test payment
Open the URL and pay using a Test Card.