Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package cc.getportal.command.request;

import cc.getportal.model.Currency;
import com.google.gson.annotations.SerializedName;
import org.jetbrains.annotations.Nullable;

/**
* Slim parameters for RequestInvoice command.
* Server (portal-rest) computes exchange rate from amount/currency.
* Request ID is derived from command.id.
*/
public record RequestInvoiceParams(
long amount,
Currency currency,
@SerializedName("expires_at")
String expiresAt,
@Nullable String description,
@Nullable String refund_invoice,
/** Optional request ID. If not provided, the command ID is used by the server. */
@Nullable String request_id
) {

public RequestInvoiceParams(long amount, Currency currency, long expiresAt, @Nullable String description, @Nullable String refund_invoice) {
this(amount, currency, String.valueOf(expiresAt), description, refund_invoice, null);
}

public RequestInvoiceParams(long amount, Currency currency, long expiresAt, @Nullable String description, @Nullable String refund_invoice, @Nullable String requestId) {
this(amount, currency, String.valueOf(expiresAt), description, refund_invoice, requestId);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package cc.getportal.command.request;

import cc.getportal.model.InvoiceRequestContent;
import cc.getportal.command.PortalRequest;
import cc.getportal.command.notification.UnitNotification;
import cc.getportal.command.response.RequestInvoiceResponse;
Expand All @@ -11,9 +10,9 @@ public class RequestInvoiceRequest extends PortalRequest<RequestInvoiceResponse,

private final String recipient_key;
private final List<String> subkeys;
private final InvoiceRequestContent content;
private final RequestInvoiceParams content;

public RequestInvoiceRequest(String recipientKey, List<String> subkeys, InvoiceRequestContent content) {
public RequestInvoiceRequest(String recipientKey, List<String> subkeys, RequestInvoiceParams content) {
recipient_key = recipientKey;
this.subkeys = subkeys;
this.content = content;
Expand Down