Enable or disable the VENDER app
This document explains how to enable or disable the VENDER app for making sales through external applications.
Overview
- Integration via Android Intent (
startActivityForResult). - Support for automatic mode (no UI) and manual mode (with UI).
- Sales state is returned via
onActivityResult.
Prerequisites
- Compatible POS device with the Vender app installed.
- Android 4.4 (KitKat) or higher.
- Permission to use
startActivityForResult. - Permission to integrate with the merchant app. This is a process/business requirement (not technical) — confirm with your contact.
Integration Contract
Action
| Parameter | Value |
|---|---|
| Action | com.sopague.TOGGLE_SALES |
Optional Extras
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Controls sales state automatically. If omitted, a UI is shown for the user to choose manually. |
Values for enabled:
true: enables sales automatically (no user interaction)false: disables sales automatically (no user interaction)- If omitted: shows a UI for the user to choose manually
Expected behavior
- Automatic mode (with
enabledextra): the app processes the request immediately, saves the state, and returns the result without displaying UI - Manual mode (without
enabledextra): the system opens the sales toggle screen where the user chooses to enable or disable
Activity response
The Activity returns a result via setResult() with the following extras:
| Parameter | Type | Description |
|---|---|---|
SALES_ENABLED | boolean | Final sales state (true = enabled, false = disabled) |
SUCCESS | boolean | Indicates whether the operation succeeded |
CANCELLED | boolean | Present only if the user canceled the operation (manual mode) |
Integration examples
Manual mode (with UI)
A confirmation screen is displayed for the merchant to choose whether to enable or disable the VENDER app:
Intent intent = new Intent("com.sopague.TOGGLE_SALES");
startActivityForResult(intent, 1002);
Automatic mode (no UI)
To enable or disable sales automatically, without showing a screen to the user:
Enable sales:
Intent intent = new Intent("com.sopague.TOGGLE_SALES");
intent.putExtra("enabled", true);
startActivityForResult(intent, 1002);
Disable sales:
Intent intent = new Intent("com.sopague.TOGGLE_SALES");
intent.putExtra("enabled", false);
startActivityForResult(intent, 1002);
Handling the response
The operation result will be returned via onActivityResult:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 1002 && resultCode == RESULT_OK && data != null) {
boolean success = data.getBooleanExtra("SUCCESS", false);
boolean salesEnabled = data.getBooleanExtra("SALES_ENABLED", false);
if (success) {
String status = salesEnabled ? "enabled" : "disabled";
Log.d(TAG, "Sales " + status + " successfully!");
}
} else if (requestCode == 1002 && resultCode == RESULT_CANCELED) {
Log.d(TAG, "Operation canceled by the user");
}
}
Final Notes
- The Vender app must be installed on the POS device.
- In automatic mode, the operation is processed immediately without user interaction.
- In manual mode, the user can cancel the operation;
CANCELLEDwill betrue. - Possible return extras:
SALES_ENABLED→ Final sales state (true = enabled, false = disabled).SUCCESS→ Indicates whether the operation succeeded.CANCELLED→ Present only if the user canceled the operation (manual mode).
For questions or issues, see the support section on