Skip to main content

Creating a Payment

To process a payment:

HashMap<String, Object> transactionData = new HashMap<>();
transactionData.put("customer_id", 29); // Customer ID
transactionData.put("amount", 500.00); // Transaction amount
transactionData.put("transaction_type", "payment"); // Type: 'payment' or 'credit'
transactionData.put("date", "2024-01-15"); // Transaction date

int transactionId = co.create(ChargeOver.Target.TRANSACTION, transactionData);
if (transactionId < 0) {
System.out.println(co.getLastError());
} else {
System.out.println("Created Transaction ID: " + transactionId);
}