Addons for programming languages
Java
Addons for programming languages
Java
Instaltation:
To install add Jitpack Repository & chargily package dependency to build.gradle
gradle build file:
repositories {
...
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.chargily:chargily-epay-java:1.0'
}
Example Usage
import chargily.epay.java.*;
class ChargilyApp {
public static void main() {
ChargilyClient client = new ChargilyClient("[API_KEY]");
Invoice invoice = new Invoice(
"Chakhoum Ahmed",
"rainxh11@gmail.com",
5.0,
"https://backend.com/webhook_endpoint",
"https://frontend.com",
PaymentMethod.EDAHABIA,
"5001",
10000.0);
try {
var response = client.createInvoice(invoice);
System.out.println(response.body().checkoutUrl);
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
}
On this page