Overview
2C2P SoftPOS Application hosts a simple web server that listens for HTTP requests over a Local Area Network (LAN). The server provides endpoints to manage activation, perform transactions, reload configurations, and query transaction statuses.
Prerequisites
1. Environment Setup
- Install 2C2P SoftPOS Application
- Ensure that the device and the SoftPOS Application are connected on the same local network
2. Obtain SoftPOS Payserver IP Address and port
Follow the steps below to activate Pay Server and retrieve IP address and port
3. Integrate and Call to Payserver
To interact with PayServer, you'll typically use an HTTP client.
val client = HttpClient(Android) {
install(ContentNegotiation) {
gson {
registerTypeAdapter(PosRequest::class.java, PosRequestDeserializer())
}
}
}
val result =
client.post("http://${remoteIpAddress.value}:${remotePort.value}/api/v1/trans") {
contentType(ContentType.Application.Json)
setBody(request)
}
How to activate Pay Server and listen to HTTP requests?
Step 1 : Launch 2C2P SoftPOS Application and go to Menu on your device
Step 2 : Click on Settings
Step 3 : Locate Support Payserver and check Payserver Status is Off
Step 4 : Click on the radio button to turn on Payserver
Step 5 : Congratulations!
2C2P SoftPOS Application is now listening for HTTP request within the LAN using the provided Payserver Address.
Updated 12 days ago