Class RedeemVoucherResponse
java.lang.Object
xyz.tcheeric.cashu.voucher.app.dto.RedeemVoucherResponse
Response DTO for voucher redemption.
This DTO indicates whether the redemption was successful and provides details about the redeemed voucher.
Usage Example
RedeemVoucherResponse response = merchantService.redeem(request);
if (response.isSuccess()) {
System.out.println("Redeemed: " + response.getAmount() + " " + response.getUnit());
// Credit customer account, etc.
} else {
System.err.println("Redemption failed: " + response.getErrorMessage());
}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RedeemVoucherResponseCreates a failed redemption response.The amount redeemed (convenience accessor).getUnit()The currency unit (convenience accessor).The voucher ID (convenience accessor).static RedeemVoucherResponsesuccess(SignedVoucher voucher) Creates a successful redemption response.
-
Constructor Details
-
RedeemVoucherResponse
public RedeemVoucherResponse()
-
-
Method Details
-
getAmount
The amount redeemed (convenience accessor). -
getUnit
The currency unit (convenience accessor). -
getVoucherId
The voucher ID (convenience accessor). -
success
Creates a successful redemption response. -
failure
Creates a failed redemption response.
-