DEV Community

Rambo Peng
Rambo Peng

Posted on

Why Virtual Card Billing Is Really a Ledger Problem

Virtual card issuance looks like the main feature. In production, the difficult part is accounting.

A reliable implementation separates wallet balance, funds locked to cards, issuer-reported card balance, pending authorizations, fees, and refundable amounts. Combining them into one number creates confusing dashboards and dangerous refund paths.

Three rules prevented most failures in our implementation:

  • calculate percentage fees with integer basis points
  • make provider transaction IDs idempotent
  • roll back both principal and service fee when a top-up submission fails

We also keep read-only card-detail access free. Revealing an authenticated card number is not a network movement and should not be charged like an authorization.

This describes our work at ChinaWHAPI. Product page and published fees: https://chinawhapi.com/vcard

Top comments (0)