Quick Start - SALE Transaction
This is the minimal integration path. Call startCore once at app startup, then call startTransaction whenever you want to charge a customer.
Step 1 — Start Core at app launch
// In Application.onCreate() or your launcher Activity Api.startCore(context, "MyApp");
Step 2 — Initiate a SALE for $10.00
Amounts are always in minor units (cents, pence, etc.). $10.00 = 1000.
HashMap<String, String> params = new HashMap<>(); params.put(Parameters.CORRELATION_ID, "order-abc-123"); // your own reference Api.startTransaction(1000, TransactionType.SALE, params, context);
Core takes control of the UI. Your app moves to the background.
Step 3 — Receive the result in your BroadcastReceiver
case Messages.TRANSACTION_RESULT_ACTION: {
TransactionResult result = WrapperUtils.getTransactionResultFromJson(
intent.getStringExtra(Messages.TRANSACTION_RESULT));
if ("00".equals(result.getTransactionResponse())) {
// Approved — result.getAuthCode(), result.getUti(), etc.
} else {
// Declined
}
break;
} Core broadcasts ACTION_CALLBACK after sending the result, bringing your app back to the foreground.