The IremboPay Java SDK is a robust and developer-friendly library designed to simplify the integration of payment functionality into your Java applications. With a comprehensive set of features, the SDK streamlines transaction management, enabling seamless payment processing within the IremboPay ecosystem. Whether you’re developing a new application or enhancing an existing one, the IremboPay Java SDK provides smooth integration, high performance, and a hassle-free development experience.
Copy import rw.irembo.payment.sdk.IremboPay;
import rw.irembo.payment.sdk.Invoice;
import rw.irembo.payment.sdk.IremboPay;
import rw.irembo.payment.sdk.models.*;
import rw.irembo.payment.sdk.util.*;
String secretKey = "yourSecretKey"
IremboPay iremboPay = new IremboPay(secretKey, Environment.SANDBOX);
Copy String transactionId="TST-1001477106";
String paymentAccountIdentifier = "07808652516";
Customer customer = new Customer();
customer.setFullName("Jixle Manzi");
customer.setPhoneNumber("0780000001");
customer.setEmail("user@email.com");
List<PaymentItem> paymentItems = new java.util.ArrayList<>(List.of());
PaymentItem paymentItem = new PaymentItem();
paymentItem.setCode("PC-aaf751b73f");
paymentItem.setQuantity(1);
paymentItem.setUnitAmount(2000);
paymentItems.add(paymentItem);
String description = "Invoice description";
Calendar calendar = Calendar.getInstance();
calendar.set(2025, Calendar.JULY, 27, 16, 24, 51);
Date expiryAt = calendar.getTime();
String language = "EN";
IremboPayResponse<Invoice> createdInvoice = iremboPay.invoice.createInvoice(transactionId,paymentAccountIdentifier,customer,paymentItems,description,expiryAt,language);
System.out.println(createdInvoice);
Copy List<String> invoiceNumbers = new ArrayList<>();
invoiceNumbers.add("880620445855");
invoiceNumbers.add("880620346771");
String transactionId = "TST-10015-Test";
String description = "Batch SDK test invoice creation";
IremboPayResponse<Invoice> createdBatchInvoice = iremboPay.invoice.createBatchInvoice(invoiceNumbers, transactionId, description);
System.out.println(createdInvoice);
Copy IremboPayResponse<Invoice> invoice = iremboPay.invoice.getInvoice("880628496284");
System.out.println(invoice);
Copy Calendar calendar = Calendar.getInstance();
calendar.set(2024, Calendar.JUNE, 28, 16, 24, 51);
Date expiryAt = calendar.getTime();
List<PaymentItem> paymentItems = new ArrayList<>();
PaymentItem paymentItem = new PaymentItem();
paymentItem.setUnitAmount(2000);
paymentItem.setCode("PC-aaf751b73f");
paymentItem.setQuantity(1);
paymentItems.add(paymentItem);
IremboPayResponse<Invoice> invoice = iremboPay.invoice.updateInvoice("880530633460",expiryAt,paymentItems);
System.out.println(invoice);
Copy String accountIdentifier = "0781110011"
String paymentProvider = "MTN";
String invoiceNumber = "870611420239";
String transactionReference = "MTN_001";
iremboPay.mobileMoney.initiate(accountIdentifier,paymentProvider,invoiceNumber,transactionReference);
Copy String payload = "{\"key\": \"value\"}";
String signatureHeader = "signature_header_here";
boolean isValid = irembopay.signatureHelper.verifySignature(payload, signatureHeader);