Initialization

App2AppInfo class is used to get working parameters from the merchant (sales) app.

NameAvailability
paymentPackageNamePackage name for the payment app which app2app SDK will connect to.
This should be set before creating App2AppService!
“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.

MethodDescriptionValue
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.

FieldDescriptionValue
codecode field to specify error as number501
descdescription for errorRegister 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.

FieldCodeValue
E500500Internal Error
E501501Register Parameters are required
E502502Payment App not installed
E503503Payment App not enabled
E1002Internal ErrorUnexpected error in app
E1003Register errorError encountered during registration.
Backend message can be added to the continuation. For example:
Register error : Server Error please contact with your administrator
E1004unregister ERROR, please try againIf registerParameter is sent, softpos app unregister then registers. Message during unregisteration
E1005Initialize errorIf an error is received during initialize, this code and message are returned. Backend message can be added to the continuation.
E1006JsonParse errorIf the message from Merchant application is not suitable for the json structure, this message and code will return.
E1008transaction size = 0If there is no transaction and you want to see the last transaction (appLastTxn), this message returns.
I1009Registration Successful
I1010SoftposApp Stoped
E1011The application was closed because application was opened standaloneIn 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.
E1012Connection ErrorThis error is returned when there is a problem with the connection
I1013Manual Settlement SuccessfulThis response is returned when manual settlement process is completed
E1014Registration NeededThis 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:

FieldDescriptionValue
drawerMenuEnabledParameter for payment App side menu enable/disableboolean : true / false
salesButtonEnabledParameter for “sale” button on payment App side menu enable/disableboolean : true / false
voidButtonEnabledParameter for “void“ button on payment App side menu enable/disableboolean : true / false
refundButtonEnabledParameter for “refund” button on payment App side menu enable/disableboolean : true / false
historyButtonEnabledParameter for “history” button on payment App side menu enable/disableboolean : true / false
settingsButtonEnabledParameter for “settings” button on payment App side menu header enable/disableboolean : true / false
tipScreenEnabledParameter for payment app tip feature(ask tip) enable/disableboolean : true / false
settlementButtonEnabledParameter for “settlement” button on payment App side menu enable/disableboolean : true / false
userPhotoEnabledParameter for showing userPhoto on payment app side menu enable/disableboolean : true / false

Register parameters

RegisterParameters object can be used to register credentials of the application as explained below:

FieldDescriptionValue
terminalIdTerminal Identification"TERMINAL1"
merchantIdMerchant Identification“MERCHANT12345”
activationCodePass code to validate on backend systems (OTP or pre-defined)“123456”