Class GeneratePaymentRequestResponse

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

public class GeneratePaymentRequestResponse extends Object
Response DTO for generating a NUT-18V VoucherPaymentRequest.

Contains the encoded payment request string that can be displayed as a QR code or shared with customers, along with the parsed request object for reference.

Usage Example

 GeneratePaymentRequestResponse response = voucherService.generatePaymentRequest(request);

 // Get the encoded string for QR code
 String qrContent = response.getEncodedRequest();

 // Get payment ID for tracking
 String paymentId = response.getPaymentId();

 // Access the full request object if needed
 VoucherPaymentRequest voucherRequest = response.getRequest();
 
  • Constructor Details

    • GeneratePaymentRequestResponse

      public GeneratePaymentRequestResponse()
  • Method Details

    • from

      public static GeneratePaymentRequestResponse from(String encodedRequest, xyz.tcheeric.cashu.common.VoucherPaymentRequest request)
      Creates a successful response from an encoded request and parsed object.
      Parameters:
      encodedRequest - the encoded request string
      request - the parsed VoucherPaymentRequest
      Returns:
      a new response instance