Class IssueVoucherResponse

java.lang.Object
xyz.tcheeric.cashu.voucher.app.dto.IssueVoucherResponse

public class IssueVoucherResponse extends Object
Response DTO for voucher issuance.

This DTO contains the newly issued voucher along with its serialized token representation that can be shared with the recipient.

Usage Example

 IssueVoucherResponse response = voucherService.issue(request);

 // Get the voucher object
 SignedVoucher voucher = response.getVoucher();

 // Get the shareable token string
 String token = response.getToken();
 // Token can be: printed as QR code, sent via NFC, shared as text, etc.
 
  • Constructor Details

    • IssueVoucherResponse

      public IssueVoucherResponse()
  • Method Details

    • getVoucherId

      public String getVoucherId()
      The unique voucher identifier (convenience accessor). Equivalent to voucher.getSecret().getVoucherId()
    • getAmount

      public Long getAmount()
      The face value of the voucher (convenience accessor). Equivalent to voucher.getSecret().getFaceValue()
    • getUnit

      public String getUnit()
      The currency unit (convenience accessor). Equivalent to voucher.getSecret().getUnit()