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

# [Job]Jobs

## Connections
[[_VomPay]] · [[[Service]InvoiceServices]] · [[[Cross]CrossModuleDependencies]]

## Source
`Modules/VomPay/Jobs/CreateVomPayPaymentLinkJob.php`

---

## CreateVomPayPaymentLinkJob

**Queue:** `vom_pay`  
**Traits:** `Dispatchable` · `InteractsWithQueue` · `Queueable` · `TenantConnectionOnRuntime`

Dispatched by `VomPayPaiable` trait when an Invoice / Proforma / Debit Note is created and VomPay is enabled for the tenant.

### Constructor Parameters
| Param | Type | Purpose |
|---|---|---|
| $subdomain | string | Identifies tenant for DB connection |
| $paiableType | string | `VomPayInvoiceTypesEnum` value |
| $paiableId | int | ID of the Invoice / Proforma / DebitNote |
| $amount | float | Total amount to charge |
| $customerId | int | Customer to send payment link to |

### handle()
1. Retrieves tenant via `RetrievingTenantBySubdomainService`
2. Sets tenant DB connection
3. Calls `VomPayInvoiceService::createPaymentLink()` with stored params

---

## VomPayPaiable Trait (dispatch point)

`Modules/VomPay/Traits/VomPayPaiable.php`

Mixed into Sales module services. Checks supplier is APPROVED + setting is enabled before dispatching job.

| Method | Dispatches For |
|---|---|
| createVomPayInvoiceForInvoice($id, $total, $customerId) | Invoice |
| createVomPayInvoiceForProforma($id, $total, $customerId) | Proforma Invoice |
| createVomPayInvoiceForDebitNote($id, $total, $customerId) | Debit Note |

Private helpers: `isSupplierApproved()` · `getSupplier()` · `getVomPaySettings()`
