Package xyz.tcheeric.cashu.voucher.pass
Class VoucherPassMapper
java.lang.Object
xyz.tcheeric.cashu.voucher.pass.VoucherPassMapper
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 Summary
Modifier and TypeMethodDescriptionstatic PassJsontoPass(SignedVoucher voucher, MerchantBranding branding) Renders a voucher as a store card, not voided.static PassJsontoPass(SignedVoucher voucher, MerchantBranding branding, VoucherStatus status) Renders a voucher as a store card, voided according to ledger status.
-
Method Details
-
toPass
Renders a voucher as a store card, not voided.- Parameters:
voucher- the signed voucher; must not be nullbranding- 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.VoucherStatusis not carried onSignedVoucher— it comes from the ledger — so the caller resolves it. A null status means not voided.- Parameters:
voucher- the signed voucher; must not be nullbranding- merchant branding, or null for defaultsstatus- ledger status, or null- Returns:
- the pass document
-