Payment Processing

Multi-merchant card and ACH payment architecture powered by Kadima Gateway.

Architecture Overview

DoorStax uses a multi-merchant payment architecture. The platform holds master credentials with Kadima Gateway, while each property manager operates under their own merchant account. Payments are routed to the appropriate merchant based on the property manager associated with the tenant's lease.

Key Concept: Platform credentials are used for merchant onboarding and reporting. Per-PM merchant credentials are used for all tenant-facing payment transactions.

Merchant Configuration
{
  "pmId": "pm_001",
  "merchantId": "mid_kadima_abc",
  "merchantStatus": "APPROVED",
  "processingCurrency": "USD",
  "supportedMethods": ["CARD", "ACH"],
  "cardSurchargeRate": 3.25,
  "achFeeAmount": 250,
  "applicationApprovedAt": "2025-01-10T00:00:00.000Z"
}

Card Payment Flow

Card payments use Kadima's vault tokenization system. The tenant's card is stored as a vault token on first use. Subsequent payments reference the vault token viamerchantCreateSaleFromVault to process charges without re-entering card details.

Card Payment via Vault Token
{
  "merchantId": "mid_kadima_abc",
  "vaultToken": "vtk_card_9876",
  "amount": 155000,
  "currency": "USD",
  "surcharge": 5038,
  "totalCharge": 160038,
  "description": "Rent payment - February 2025",
  "metadata": {
    "tenantId": "tnt_012",
    "leaseId": "lea_xyz789",
    "paymentType": "RENT"
  }
}

ACH Payment Flow

ACH payments use vault bank account tokens for direct debit from the tenant's checking or savings account. ACH transactions typically settle in 3-5 business days.

ACH Payment via Vault Account
{
  "merchantId": "mid_kadima_abc",
  "vaultToken": "vtk_ach_5432",
  "amount": 150000,
  "currency": "USD",
  "achFee": 250,
  "totalCharge": 150250,
  "accountType": "CHECKING",
  "description": "Rent payment - February 2025",
  "metadata": {
    "tenantId": "tnt_012",
    "leaseId": "lea_xyz789",
    "paymentType": "RENT"
  }
}

Autopay Engine

Tenants can enroll in autopay to automatically charge their saved payment method on the rent due date. The system sends pre-charge notifications 3 days before processing and handles failures with automatic retries.

EventTimingAction
Pre-charge notification3 days before due dateEmail sent to tenant with amount and date
Charge attemptOn due datePayment processed via saved method
Retry on failure1, 3, and 5 days after failureAutomatic retry with tenant notification
Autopay pausedAfter max retries exceededAutopay suspended, PM and tenant notified

Fee Calculation

Processing fees are calculated based on the payment method. Card payments incur a surcharge of 3.25% added to the total. ACH fees follow a cascade: property-level override, then owner-level override, then the system default.

MethodFee TypeRate
CARDSurcharge (percentage)3.25% of payment amount
ACHFlat fee (cascade)Property → Owner → Default ($2.50)

Outstanding Charges

When a tenant logs into their dashboard, they see all outstanding charges alongside their regular rent. This includes tenant-payable expenses, late fees, and any other non-rent charges. The tenant can pay all charges in a single transaction or select individual items.

Payment Void & Write-Off

Property managers can void a payment (before settlement) or write off an outstanding balance. Both actions require a reason and create a corresponding ledger entry. If the payment was tied to an expense, the expense record is updated to reflect the change.

Void Payment Request
{
  "paymentId": "pay_abc123",
  "action": "VOID",
  "reason": "Duplicate payment processed in error",
  "initiatedBy": "usr_pm001",
  "ledgerEntry": {
    "type": "VOID",
    "amount": -150000,
    "description": "Void: Duplicate payment"
  }
}

Receipt PDF Generation

A PDF receipt is automatically generated for every successful payment. The receipt includes the payment amount, method, date, property address, unit number, and a unique confirmation number. Receipts are available for download from the tenant dashboard and are also attached to the payment confirmation email.

Merchant Approval Guard

Payments are blocked until the property manager's merchant application has been approved by Kadima. The system checks the merchant status before every payment attempt and returns a clear error if the merchant is not yet approved.

Important: Tenant payment forms are hidden in the UI until the PM's merchant account reachesAPPROVED status. Attempting to process a payment via API without approval returns a 403 error.

API Reference

Payment endpoints handle the full transaction lifecycle from charge to settlement.

MethodEndpointDescription
POST/api/payments/chargeProcess a card or ACH payment
GET/api/paymentsList payments with filters
GET/api/payments/:idGet payment details
POST/api/payments/:id/voidVoid an unsettled payment
POST/api/payments/:id/refundRefund a settled payment
POST/api/payments/:id/write-offWrite off an outstanding balance
POST/api/autopay/enrollEnroll tenant in autopay
POST/api/autopay/cancelCancel autopay enrollment
GET/api/payments/:id/receiptDownload payment receipt PDF
GET/api/merchants/:pmId/statusCheck merchant approval status