---
tags: [vompay, hub]
module: VomPay
---

# VomPay Module — Hub

> Payment gateway integration with MyFatoorah. Allows tenants to send payment links on Invoices, Proforma Invoices, and Debit Notes to customers. Handles supplier (merchant) onboarding, commission setup, webhook callbacks for payment confirmation, and accounting journal entry creation on successful payment.

## Models
[[[Model]Models]]

## Controllers
[[[Controller]Controllers]]

## Services
[[[Service]SupplierServices]] · [[[Service]InvoiceServices]] · [[[Service]MyFatoorahAPIServices]] · [[[Service]DashboardSettingsServices]]

## Actions
[[[Action]Actions]]

## Infrastructure
[[[Repo]Repositories]] · [[[Enum]Enums]] · [[[Job]Jobs]] · [[[Notification]Notifications]] · [[[Routes]Routes]] · [[[DB]DatabaseTables]] · [[[Cross]CrossModuleDependencies]]

---

## Core Flow

```
ONBOARDING
  Tenant fills supplier form → VomPaySupplierService.createSupplier()
      → CreatingMyFatoorahSupplierAction → MyFatoorahSupplierAPIService.createSupplier()
      → SetMyFatoorahCommissionsAction (package-based rates)
      → activate() → status = COMPLETED_PROFILE → emails sent
      → MyFatoorah reviews → webhook: SupplierStatusChanged
          → APPROVED → is_integrated_with_vompay = true
          → REJECTED → KYC feedback stored + email sent

PAYMENT LINK CREATION
  Invoice/Proforma/DebitNote saved → VomPayPaiable trait
      → CreateVomPayPaymentLinkJob (queue: vom_pay)
          → VomPayInvoiceService.createPaymentLink()
              → GeneratingPaymentLinkAction → MyFatoorahInvoiceAPIService.generatePaymentLink()
              → VomPayInvoice created in DB

PAYMENT CALLBACK (Webhook)
  MyFatoorah POST → VomPayController (webhook route)
      → VomPayWebHookEventsEnum routes to:
          TransactionsStatusChanged → VomPayInvoiceStatusService
              → SUCCESS → VomPayStatusHandlerForInvoice/DebitNoteService
                  → CreatingJournalEntryAfterPayingService
                  → CreatingCustomerReceiptAfterPayingService
                  → invoice paid_amount updated
          SupplierStatusChanged → VomPaySupplierStatusService
          BalanceTransferred → VomPayBalanceTransferredService (no-op)
```

## Key Constraint
Module only activates when `is_integrated_with_vompay = true` in `settings` table (set by `VomPaySupplierStatusService` on APPROVED webhook). Package must be in `VomPayPackagesEnum::PACKAGES_SUPPORT_VOM_PAY`.

---

## Related Modules
[[START_HERE]] · [[_Accounting]] · [[_Settings]] · [[_CompanyUser]]
