创建一个新支付票据
java
import com.basicex.sdk.BasicExClient;
import com.basicex.sdk.exception.BasicexException;
import com.basicex.sdk.model.InvoiceObject;
import com.basicex.sdk.model.params.InvoiceCreateParams;
import com.basicex.sdk.model.params.constant.AmountType;
import java.io.IOException;
import java.math.BigDecimal;
import java.security.cert.CertificateException;
import java.util.UUID;
public class BasicExTest{
private static String configPath = "~/4d1ebd88-8154-4ca1-b1c6-051b7d28c204/config.json";
public static void main(String[] args) throws CertificateException, IOException, BasicexException {
BasicExClient client = new BasicExClient(configPath);
InvoiceObject invoiceObject = client.invoices().create(InvoiceCreateParams.builder()
.redirectUrl("https://basicex.com")
.notificationUrl("https://basicex.com/notify")
.currency("USDT")
.amount(new BigDecimal("10.25"))
.amountType(AmountType.COIN_AMOUNT)
.orderId(UUID.randomUUID().toString())
.description("Hello, BasicEx")
.build());
String cashierUrl = invoiceObject.getCashierUrl();
System.out.println(cashierUrl);
}
}