Plan for integration, staging, and pilot phases. The C2C architecture changes how payments are initiated, monitored, and recovered, so dedicate time for regression testing with your device fleet.
Overview of Changes
The Terminal C2C SDK consolidates device orchestration, networking, and payment command handling behind theTerminalC2C facade. Instead of calling saleIntent directly on the device, your app now constructs requests that the SDK dispatches to the Terminal Gateway over the local network. This enables richer device telemetry, unified error handling, and support for additional providers.
Key upgrades:
- Unified dependencies: Replace
co.xendit:xen_edc_sdk-androidwith the Terminal C2C core, provider, and helper artifacts. - Centralized device management: Configure terminals through
TerminalDevicehelpers and register them withTerminalC2C.setTerminalDeviceor per-call overrides. - Command-based payments: Migrate to
TerminalC2C.createPayment()and related command APIs (cancelPayment,printReceipt,getCommandHistory). - Standardized error surfaces: Handle
TerminalExceptioncategories (network, authentication, device) instead of provider-specific enums. - Operational visibility: Leverage command histories and status polling to surface kiosk health and reconciliation signals.
Migration Steps
Update SDK dependencies
Remove the legacy Xen BRI SDK and add the Terminal C2C artifacts to your module Add (minimum set):
build.gradle(.kts) file.Remove:If you host the artifacts locally, keep the
maven("./repository") entry in settings.gradle or build.gradle as described in the Terminal C2C SDK installation guide.Initialize the core services
Initialization now splits across New:
TerminalApp (platform bootstrap) and TerminalC2C (provider registration). Migrate the logic inside your Application class or launch activity.Old:Register terminal devices
Replace direct Wi-Fi/Bluetooth pairing calls with the new
TerminalDevice helpers. Store device metadata (Terminal ID, IP, provider) in configuration so you can update them without rebuilding the app.Use
TerminalDevice.create(id, ipAddress, provider) if you prefer not to add provider-specific artifacts. For multi-terminal sites, persist a list and choose the device per transaction using the terminalDevice argument on each command.Migrate payment execution
Replace
saleIntent with the command-based API provided by Terminal C2C. The SDK handles the HTTP call to the Gateway, relays prompts to the terminal, and returns a structured result.Map operational commands
Terminal C2C exposes dedicated helpers for voids, receipts, settlement, and transaction history. Migrate any ad-hoc socket calls to these managed APIs.
Strengthen error handling and support playbooks
Replace legacy error enums with the structured
TerminalException returned by the C2C SDK and align your monitoring with the new data model.Imports for the snippet:
Schedule periodic calls to
TerminalC2C.getHistory or use your own telemetry layer to surface stalled commands, especially in unattended kiosk deployments.Summary of Key Changes
| Capability | Xen BRI SDK (0.3.x) | Terminal C2C SDK (1.0.0) |
|---|---|---|
| Dependencies | co.xendit:xen_edc_sdk-android:0.3.x | co.xendit.terminal:core-android, co.xendit.terminal:c2c-android, provider artifacts |
| Initialization | XenBriTerminal.initialize(context, key, mode) | TerminalApp.initialize(context, key, mode) + TerminalC2C.addProvider(...) |
| Device setup | useWifi(tid, ip) / useBluetooth() | TerminalDevice.create(...) + TerminalC2C.setTerminalDevice() |
| Payment flow | saleIntent(parameters) callback | TerminalC2C.createPayment(payment) returning command status |
| Void / cancel | cancelPaymentIntent(...) | TerminalC2C.cancelPayment(cancel) |
| Receipt print | printReceiptIntent(...) | TerminalC2C.printReceipt(receipt) |
| Monitoring | Provider-specific listeners | observeCommand, observeDeviceState, command history APIs |
| Simulation | SDK-integrated test mode | Use integration environment devices or Terminal Gateway simulator commands |