Initialization
App2AppInfo class is used to get working parameters from the merchant (sales) app.
Name | Availability | |
---|---|---|
paymentPackageName |
Package name for the payment app which app2app SDK will connect to. |
“com.softpos.app” |
App2AppInfo.setPaymentAppPackageName("com.softpos.app");
app2AppService = new App2AppService(getApplicationContext());
App2AppEventListener
The listener has the methods below to inform the merchant app about events occurred in app2app SDK.
Method | Description | Value |
---|---|---|
onError(App2AppReturnType) | Called on error case in app2app SDK which will break the flow | |
onInfo(App2AppReturnType) | Called on information case in app2app SDK which will not break the flow. | |
onSuccess(App2AppReturnType) | Called on successful response of the request |
App2AppError
Enum error object to pass information to the merchant app for SDK internal error.
Field | Description | Value |
---|---|---|
code | code field to specify error as number | 501 |
desc | description for error | Register Parameters are required! |
App2AppReturnType List
E: Stands for Error returnType and this will be provided by onError callback of App2AppEventListener
I: Stands for Info returnType and this will be provided by onInfo callback of App2AppEventListener.
Field | Code | Value |
---|---|---|
E500 |
500 |
Internal Error |
E501 |
501 |
Register Parameters are required |
E502 |
502 |
Payment App not installed |
E503 |
503 |
Payment App not enabled |
E1002 |
Internal Error |
Unexpected error in app |
E1003 |
Register error |
Error encountered during registration. |
E1004 |
unregister ERROR, please try again |
If registerParameter is sent, softpos app unregister then registers. Message during unregisteration |
E1005 |
Initialize error |
If an error is received during initialize, this code and message are returned. Backend message can be added to the continuation. |
E1006 |
JsonParse error |
If the message from Merchant application is not suitable for the json structure, this message and code will return. |
E1008 |
transaction size = 0 |
If there is no transaction and you want to see the last transaction (appLastTxn), this message returns. |
I1009 |
Registration Successful |
|
I1010 |
SoftposApp Stoped |
|
E1011 |
The application was closed because application was opened standalone |
In app2app there is a feature as standalone mode which allows application gets payment independent from merchant app. If this feature is disabled and payment app started this error is returned. |
E1012 |
Connection Error |
This error is returned when there is a problem with the connection |
I1013 |
Manual Settlement Successful |
This response is returned when manual settlement process is completed |
E1014 |
Registration Needed |
This error is returned if required registration does not exist. |
Configuration parameters
ConfigParameters object can be used to configure behavior or features of the application as explained below:
Field | Description | Value |
---|---|---|
drawerMenuEnabled | Parameter for payment App side menu enable/disable | boolean : true / false |
salesButtonEnabled | Parameter for “sale” button on payment App side menu enable/disable | boolean : true / false |
voidButtonEnabled | Parameter for “void“ button on payment App side menu enable/disable | boolean : true / false |
refundButtonEnabled | Parameter for “refund” button on payment App side menu enable/disable | boolean : true / false |
historyButtonEnabled | Parameter for “history” button on payment App side menu enable/disable | boolean : true / false |
settingsButtonEnabled | Parameter for “settings” button on payment App side menu header enable/disable | boolean : true / false |
tipScreenEnabled | Parameter for payment app tip feature(ask tip) enable/disable | boolean : true / false |
settlementButtonEnabled | Parameter for “settlement” button on payment App side menu enable/disable | boolean : true / false |
userPhotoEnabled | Parameter for showing userPhoto on payment app side menu enable/disable | boolean : true / false |
Register parameters
RegisterParameters object can be used to register credentials of the application as explained below:
Field | Description | Value |
---|---|---|
terminalId | Terminal Identification | "TERMINAL1" |
merchantId | Merchant Identification | “MERCHANT12345” |
activationCode | Pass code to validate on backend systems (OTP or pre-defined) | “123456” |
Updated 5 days ago