Skip to content
Merged
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
Expand Up @@ -21,12 +21,16 @@ public class CreateInvoiceParam implements Request.Param {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("description=").append(encode(description))
.append("&amountSat=").append(encode(String.valueOf(amountSat)))
.append("&amountSat=").append(amountSat == null ? "" : amountSat)
.append("&expirySeconds=").append(expirySeconds == null ? "" : expirySeconds)
.append("&externalId=").append(encode(externalId));
if (webhookUrl != null) {
sb.append("&webhookUrl=").append(encode(webhookUrl.toString()));
String urlString = webhookUrl.toString();
if (urlString.contains("?")) {
sb.append("&webhookUrl=").append(encode(urlString));
} else {
sb.append("&webhookUrl=").append(urlString);
}
}
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@ToString(callSuper = true)
public class PayBolt11InvoiceInvoiceResponse extends PayInvoiceResponse {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@ToString(callSuper = true)
public class PayLightningAddressInvoiceResponse extends PayInvoiceResponse {
}
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,14 @@ public String replacePathVariables(String path, Request.Param param) {
Field[] fields = param.getClass().getDeclaredFields();
for (Field field : fields) {
field.setAccessible(true);
Object value = field.get(param);
if (value != null) {
String placeholder = "{" + field.getName() + "}";
path = path.replace(placeholder, value.toString());
try {
Object value = field.get(param);
if (value != null) {
String placeholder = "{" + field.getName() + "}";
path = path.replace(placeholder, value.toString());
}
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}
return path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@
import java.util.Properties;

public final class TestUtils {
private TestUtils() {
}

public static void setBaseUrl(String baseUrl) {
try {
private static final String CONFIG_FIELD_NAME = "CONFIG";
private static final String PHOENIXD_BASE_URL_KEY = "phoenixd.base_url";

private TestUtils() {
}
Expand Down
Loading