Class VoucherPassMapper

java.lang.Object
xyz.tcheeric.cashu.voucher.pass.VoucherPassMapper

public final class VoucherPassMapper extends Object
Maps a SignedVoucher to a PassJson document.

The pass is a derived view: the signed voucher is the only source of truth, and nothing parses a pass back into a voucher. Rendering is a pure function, so a balance change after partial redemption needs no synchronisation — re-render.

Apple Wallet is not a target. We adopt the pass.json schema only; there is no certificate, no .pkpass container, and no pass update web service.

  • Method Details

    • toPass

      public static PassJson toPass(SignedVoucher voucher, MerchantBranding branding)
      Renders a voucher as a store card, not voided.
      Parameters:
      voucher - the signed voucher; must not be null
      branding - merchant branding, or null for defaults
      Returns:
      the pass document
    • toPass

      public static PassJson toPass(SignedVoucher voucher, MerchantBranding branding, VoucherStatus status)
      Renders a voucher as a store card, voided according to ledger status.

      VoucherStatus is not carried on SignedVoucher — it comes from the ledger — so the caller resolves it. A null status means not voided.

      Parameters:
      voucher - the signed voucher; must not be null
      branding - merchant branding, or null for defaults
      status - ledger status, or null
      Returns:
      the pass document