Payment — Dữ liệu & bảng đọc/ghi
Góc nhìn database và khái niệm ngoài mà Payment đọc/ghi. Quy ước: 📖 READ, ✏️ WRITE (insert/update).
Dữ liệu đọc ghi
| Mảng | Dữ liệu |
|---|---|
| Payment customer | AccountPaymentCustomer, provider token, BU scope, active status. |
| Direct payment | DirectPaymentBatch, DirectPayment, batch type, provider reference. |
| Method settings | Payment gateway settings, master toggle, method availability, category option. |
| Deposit | Booking order deposit flags/snapshot, checkout lock, paid/result state. |
| Checkout result | Success/failure message, method resolution, redirect/result payload. |
| Zero-amount checkout | Không đụng provider; resolve intent từ payment settings + DD state + booking eligibility 📖 READ. |
| PayLater display name | BusinessUnitPaymentSetting.PayLaterDisplayName ✏️ WRITE (admin); 📖 READ qua BookingForCheckoutModel cho checkout. |
| PayLater eligibility | ProgramCategory.PayLaterAllowedTypeId, ProgramCategory.SubsidyEnabled 📖 READ — category scope + subsidy gate. |
| Billing payment option | Billing.PaymentOptionId ✏️ WRITE chỉ cho non-immediate (DD=4, Other=1); không ghi cho Pay Now/Pay Deposit. |
| Success message settings | PayNowSuccessMessage, PayNowDepositSuccessMessage, DirectDebitSuccessMessage, PayLaterMessage ✏️ WRITE; 📖 READ lúc resolve. |
| Windcave mode | BU payment setting mode XML/REST ✏️ WRITE; 📖 READ cho mọi checkout/callback. |
Provider ngoài
| Provider | Vai trò |
|---|---|
| Windcave | Card/PayNow checkout, result URL, notification/webhook. |
| Kiwi | Direct Debit customer create và debit/provider sync. |
| Accounting provider | Payment có thể ảnh hưởng finance/accounting sync nhưng không sở hữu accounting mapping. |
Dữ liệu từ domain khác
| Domain | Payment đọc để làm gì |
|---|---|
| Finance | Invoice/billing/payment option và trạng thái đối soát. |
| Booking | Order ids, lock state, deposit eligibility, confirm sau deposit. |
| Subscription | Billing schedule/payment selection trong enrollment. |
| Master Data | Account, BU, site/category scope và provider config. |
Liên quan
- Kiến trúc & dữ liệu — provider, batch, token.
- Finance — chứng từ & trạng thái paid.