Skip to content

Synqpay SDK

Overview

The Synqpay SDK is a lightweight Android library designed to provide seamless integration with the Synqpay application on payment devices. It simplifies interaction with payment processes while abstracting away complexities, enabling developers to focus on building their applications.

The SDK is modular, offering submodules tailored to specific functionalities. This modularity ensures straightforward code, making the SDK easy to integrate and use.


Why Choose Synqpay SDK?

  • Lightweight & Dependency-Free: No external dependencies, ensuring faster build times and easier integration.
  • High Performance: Optimized for speed and scalability on payment devices.
  • Simplified Payment Processes: Decouples the client application from the Synqpay UI, letting you integrate payments seamlessly.
  • Flexible Framework Integration: Use the SDK with any framework of your choice.
  • Error-Resilient: Eliminates threading and lifecycle issues during payment processing—initiate payments directly from the UI thread.

Key Features

  • Simple API Integration: Request payments using intuitive, lightweight APIs without dealing with complex data structures.
  • Printer Support: Effortlessly generate receipts or invoices, building documents line-by-line using an easy-to-use printer API.
  • Service Control: Manage essential Synqpay configurations directly from your application.

Getting Started

Adding Synqpay to Your Project

The Synqpay SDK is hosted on Maven Central. Add the following dependency to your Gradle file to include it in your project:

implementation("com.synqpay:synqpay-sdk:1.0")  

To explore a working example, check out the demo code on GitHub.


Synqpay in 3 Simple Steps

Step 1: Initialize the SDK

Call the init() method in your Activity or during application creation:

SynqpaySDK.get().init(this);

Step 2: Bind and Unbind the SDK

Register and unregister the SDK binding listeners in your activity’s lifecycle methods:

@Override  
public void onStart() {  
    super.onStart();  
    SynqpaySDK.get().setListener(this);  
    SynqpaySDK.get().bindService();  
}

@Override  
public void onStop() {  
    super.onStop();  
    SynqpaySDK.get().unbindService();  
    SynqpaySDK.get().setListener(null);  
} 

Step 3: Use the Desired Submodules

Once connected, access and use the required submodules (API, Manager, or Printer):

1
2
3
4
5
6
@Override
public void onSynqpayConnected() {  
    this.api = SynqpaySDK.get().getSynqpayAPI();  
    this.manager = SynqpaySDK.get().getSynqpayManager();  
    this.printer = SynqpaySDK.get().getSynqpayPrinter();  
}

For example, to send a request using the API module:

public void sendRequest() {  
    JSONObject jsonObject = new JSONObject();
    try {
        jsonObject
            .put("jsonrpc", "2.0")
            .put("id", "1234")
            .put("method", "getTerminalStatus")
            .put("params", null);
    } catch (JSONException e) {
        e.printStackTrace();
    }

    try {
        api.sendRequest(jsonObject.toString(), responseCallback);
    } catch (RemoteException ignored) {
    }
}

Notes

  • Ensure you manage your activity lifecycle properly to bind and unbind the SDK as needed.
  • Submodules like API, Manager, and Printer each provide specialized functionality tailored for integration.
  • Synqpay SDK is built for ease of use and reliability, making it ideal for payment-related application development.