EdfaPay Logo
New in v1.0.5

Remote Access API

Enable external POS systems to trigger payment transactions on the SDK via local network communication.

Overview

The Remote Access API allows external systems (like traditional POS terminals, cash registers, or backend services) to communicate with the EdfaPay SDK running on an Android device via local network. This enables hybrid payment setups where the payment processing logic resides on the mobile device while being triggered by external systems.

Local Network

TCP Socket communication on configurable port within local network

Real-time

Instant command execution with configurable timeout

Secure

Local network only, requires SDK initialization

Use Cases

  • Hybrid POS Integration: Connect traditional cash registers to mobile payment processing
  • Kiosk Mode: Trigger payments from a main kiosk application running on a separate device
  • Backend Integration: Allow server applications to initiate payments on registered devices
  • Multi-Device Setup: Central management system controlling multiple payment devices

Setup

Prerequisites

The SDK must be fully initialized before opening the remote channel. Always call RemoteChannel.open() after receiving theonSuccess callback from initiate().

Loading...

API Reference

RemoteAccess

Access via EdfaPayPlugin.RemoteChannel

MethodDescription
LocalNetwork(port: Int, timeout: Double)Configure a local network channel on the specified port with timeout in minutes
open()Open the remote channel and start listening for commands
Loading...

Remote Commands

Once the remote channel is open, external systems can trigger payment operations over a TCP Socket connection to the configured port on the device's local IP. Messages are formatted as newline-delimited JSON using UTF-8 encoding.

Test Clients Available

Reference client implementations for communicating with the remote access API are available in multiple languages including Java, Python, .NET, Rust, C++, Go, Node.js, Swift, PHP, Ruby, and Dart. We recommend reviewing the `edfapay-sender-multiple-langs` examples to understand the TCP socket communication flow.

Quick Test (CLI)

You can verify connectivity without writing code by sending a raw JSON payload directly to the device's IP and port from your terminal. Wait for the connection to open, and check the response.

Loading...

Purchase

Command payload to initiate a purchase transaction. Requires amount and flowType.

config.json
Loading...

Reverse Last Transaction

Command payload to reverse the last transaction:

config.json
Loading...

Security Considerations

Security Best Practices

  • Remote Access only works on local networks - not exposed to the internet
  • Use firewall rules to restrict which devices can connect
  • Consider using a dedicated network VLAN for payment devices
  • The SDK must be initialized with valid credentials before remote access works
  • All transactions still go through the secure EdfaPay backend

Network Configuration Tips

  • Use a static IP or DHCP reservation for the Android device
  • Configure your router/firewall to only allow connections from trusted POS systems
  • Use a non-standard port if 8080 conflicts with other services
  • Monitor connection logs for unauthorized access attempts

Complete Example

Here's a complete example showing SDK initialization with Remote Access setup:

Loading...

Finding Device IP

To find the device's IP address, go to Settings → Wi-Fi → [Connected Network] → IP address, or use adb shell ip addrfrom a connected computer.