Initialization
Last updated: August 1, 2026 | Guide version: 1.0.8
Initialize the SDK before calling any operation, such as Register or Payment.
Setup
App2AppInfo class is used to get working parameters from the merchant (sales) app.
Set the payment app package name before creating App2AppService:
App2AppInfo.setPaymentAppPackageName("com.softpos.app"); // payment app application id
app2AppService = new App2AppService(getApplicationContext());
App2AppInfo fields
| Field | Description | Example |
|---|---|---|
paymentPackageName |
Package name for the payment app which app2app SDK will connect to. Must be set before creating App2AppService. | com.softpos.app |
App2AppEventListener
Informs the merchant app about events occurring in the app2app SDK.
| Method | Description |
|---|---|
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 |
Return types
App2AppError is an enum object used to pass information about SDK-internal errors to the merchant app. The first letter of each ID shows which callback delivers it:
E: Error returnType, provided by onError callback of App2AppEventListenerI: Info returnType, provided by onInfo callback of App2AppEventListener
| ID | Type | Description |
|---|---|---|
E500 |
Error | Internal Error |
E501 |
Error | Register Parameters are required |
E502 |
Error | Payment App not installed |
E503 |
Error | Payment App not enabled |
E1002 |
Error | Internal Error: Unexpected error in app |
E1003 |
Error | Register error: error encountered during registration. Backend message can be added to the continuation. e.g. "Register error : Server Error please contact with your administrator" |
E1004 |
Error | unregister ERROR, please try again: If registerParameter is sent, softpos app unregisters then registers. Message during unregistration. |
E1005 |
Error | Initialize error: If an error is received during initialize, this code and message are returned. Backend message can be added to the continuation. |
E1006 |
Error | JsonParse error: If the message from Merchant application is not suitable for the json structure, this message and code will return. |
E1007 |
Error | Amount cannot be alphanumeric characters, null, 0: Relates to the submitted amount. |
E1008 |
Error | transaction size = 0: If there is no transaction and you want to see the last transaction (appLastTxn), this message returns. |
I1009 |
Info | Registration Successful |
I1010 |
Info | SoftposApp Stopped |
E1011 |
Error | The application was closed because application was opened standalone: In app2app there is a standalone mode feature which allows the application to get payment independent from merchant app. If this feature is disabled and payment app started, this error is returned. |
E1012 |
Error | Connection Error: returned when there is a problem with the connection |
I1013 |
Info | Manual Settlement Successful: returned when manual settlement process is completed |
E1014 |
Error | Registration Needed: returned if required registration does not exist |
ConfigParameters
ConfigParameters object can be used to configure behavior or features of the application.
| Parameter | Description | Values |
|---|---|---|
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 |
workingMode |
Ensures the application remains active in the background and prepared to process payment data immediately when required | STANDARD_MODE = 0AUTOMATIC_BACKGROUND = 1 |
orientation |
Parameter for landscape mode or portrait | Landscape_Mode = 1Portrait_Mode = 0 |
ReceiptOptions |
Parameter of receipt buttons visibility | ReceiptButtonFlag[] (see Receipt options) |
timeout |
Time in seconds the payment app waits. A value lower than zero means no timeout; a value greater than zero makes SoftPOS wait for that many seconds. | integer, e.g. -1 |
Receipt options
Parameter of receipt buttons visibility. Provide an array with any of these flags:
ReceiptButtonFlag.NONEReceiptButtonFlag.DISPLAYReceiptButtonFlag.SMSReceiptButtonFlag.QRReceiptButtonFlag.ALL
// only SMS and QR button going to show on
ReceiptButtonFlag[] selectedFlags = new ReceiptButtonFlag[] {
ReceiptButtonFlag.SMS,
ReceiptButtonFlag.QR
};
RegisterParameters
RegisterParameters object can be used to register credentials of the application.
| Parameter | Description | Example |
|---|---|---|
terminalId |
Terminal Identification | TERMINAL1 |
merchantId |
Merchant Identification | MERCHANT12345 |
activationCode |
Pass code to validate on backend systems (OTP or pre-defined) | 123456 |
See also
- Yazara Android App2App SDK Integration Guide
- About App2App SDK
- Register
- Payment
- Last Transaction Query
- Transaction List
- Manual Settlement
- Custom Tags
- Unregister