Skip to content

codeblocks-demo/synqpay-sdk-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

synqpay-sdk-demo

Demo code that uses Synqpay SDK. Includes examples of

  • Use Synqpay API to invoke Synqpay JSON-RPC API over IPC
  • Manage Synqpay Service
  • Synqpay PAL (Print Abstract Layer) to use integrated printer

Add Synqpay to your project

The Synqpay SDK is publicly available and hosted on the Maven Central repository. This ensures that developers can easily access and integrate the SDK into their applications, facilitating streamlined development processes.

Android projects:

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

Synqpay in 3 steps

  1. Init from your Activity/Application creation

    SynqpaySDK.get().init(this);
  2. Bind

    Register and unregister binding listeners

    @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); 
     } 
  3. Use the desired module

    @Override
        public void onSynqpayConnected() {  
        this.api = SynqpaySDK.get().getSynqpayApi(); 
        this.manager = SynqpaySDK.get().getSynqpayManager(); 
        this.printer = SynqpaySDK.get().getSynqpayPrinter();
        this.device = SynqpaySDK.get().getSynqpayDevice();
    } 
    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) {}
        try {
            api.sendRequest(jsonObject.toString(),responseCallback);
        } catch (RemoteException ignored) {}
    } 

About

Demo code that uses Synqpay SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages