public class MyService{
@Autowired
private ChargilyEpayClient client;
public void makePayment(){
InvoiceModel invoice = new InvoiceModel(
"someClient",
"someEmail@mail.com",
"1000",
BigDecimal.valueOf(75.0),
55d,
"https://backurl.com/",
"https://webhookurl.com/",
Mode.CIB,
"a comment"
);
//handle response after you get it as a call back
client.makePayment(invoice, new Callback() {
@Override
public void onFailure(@NotNull Call call, @NotNull IOException e) {
//in case of failure
}
@Override
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
//in case of success
}
});
}
}