Android Intents
The Android Intent API lets third-party Android apps running on yetipay devices initiate a payment on the device and receive the result. Your app hands off to the Yeti payment app via an Intent; the customer completes the payment on the same device; your app gets the outcome back.
Use this when you're building custom apps on yetipay hardware — kiosks, self-service terminals, or integrated POS experiences where your app controls the flow and triggers the payment.
This integration requires provisioning, device configuration, and technical onboarding that we manage with you. Reach out to your account manager and we'll pair you with an implementation manager to guide you through setup, testing, and go-live.
How it works
Your Android app Yeti payment app
│ │
│──── Intent (INIT) ────────────────►│
│◄─── INIT_COMPLETE ─────────────────│
│ │
│──── Intent (SALE, amount) ────────►│
│ │ Customer taps/inserts card
│ │
│◄─── TX_COMPLETE (result) ──────────│
│ │
- Initialise — Your app sends an
INITIntent to ensure the Yeti app is ready. - Start payment — Your app sends a
SALEIntent with the amount. The Yeti app takes over the screen and handles the card flow. - Receive result — When the customer completes (or cancels), you get a
TX_COMPLETEIntent with the outcome.
Before you begin
- Account setup: Contact your account manager to get paired with an implementation manager. They'll handle provisioning and ensure your app can communicate with the Yeti payment app.
- Device requirement: Your app must run on a yetipay Android device. This integration is not available for generic Android hardware.
- Android APIs: You'll use
startActivityForResult(or the Activity Result API) to launch Intents and receive responses. - APK requirements: Your app must meet APK requirements (file size, SDK version, permissions, restrictions) to run on terminals.
API Reference
Initialise API
Call this before processing payments. Ensures the Yeti payment app is ready.
Action: me.yetipay.app.action.INIT
val intent = Intent("me.yetipay.app.action.INIT")
startActivityForResult(intent, REQUEST_CODE)
Response: me.yetipay.app.action.INIT_COMPLETE
| Extra | Type | Values |
|---|---|---|
me.yetipay.app.extra.INIT_RESULT | Boolean | true = success, false = failure |
me.yetipay.app.extra.INIT_RESULT_DETAIL | String | OK, COMPLETED, E1, A10, T1 |
Result details:
| Code | Meaning |
|---|---|
OK | Successfully initialised |
COMPLETED | Already initialised |
E1 | Failed to start |
A10 | Provisioning error |
T1 | Timeout |
Initialise API is idempotent.
Start Payment
Action: me.yetipay.app.action.SALE
| Extra | Type | Required | Description |
|---|---|---|---|
me.yetipay.app.extra.BASE_AMOUNT | Int | Yes | Amount to charge (minor units) |
val intent = Intent("me.yetipay.app.action.SALE")
intent.putExtra("me.yetipay.app.extra.BASE_AMOUNT", amountInMinorUnits)
startActivityForResult(intent, REQUEST_CODE)
Response: me.yetipay.app.action.TX_COMPLETE
| Extra | Type | Description |
|---|---|---|
me.yetipay.app.extra.BASE_AMOUNT | Int | Total amount paid (minor units) |
me.yetipay.app.extra.GRATUITY_AMOUNT | Int | Total tip amount (minor units) |
me.yetipay.app.extra.TRANSACTION_RESULT | String | AUTHORISED, FAILED, DECLINED, CANCELLED |
me.yetipay.app.extra.CARD_SCHEME | String | Card scheme (e.g. visa, mastercard, amex) — optional |
Transaction results:
| Result | Meaning |
|---|---|
AUTHORISED | Payment successful |
DECLINED | Payment declined by issuer |
FAILED | Payment failed |
CANCELLED | User cancelled payment |
Complete example
class MainActivity : AppCompatActivity() {
companion object {
const val REQUEST_PAYMENT = 1001
}
fun startPayment(amountPence: Int) {
val intent = Intent("me.yetipay.app.action.SALE")
intent.putExtra("me.yetipay.app.extra.BASE_AMOUNT", amountPence)
startActivityForResult(intent, REQUEST_PAYMENT)
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == REQUEST_PAYMENT && resultCode == RESULT_OK) {
val result = data?.getStringExtra("me.yetipay.app.extra.TRANSACTION_RESULT")
val amount = data?.getIntExtra("me.yetipay.app.extra.BASE_AMOUNT", 0)
val tip = data?.getIntExtra("me.yetipay.app.extra.GRATUITY_AMOUNT", 0)
val cardScheme = data?.getStringExtra("me.yetipay.app.extra.CARD_SCHEME")
when (result) {
"AUTHORISED" -> handleSuccess(amount, tip, cardScheme)
"DECLINED" -> handleDeclined()
"FAILED" -> handleFailure()
"CANCELLED" -> handleCancelled()
}
}
}
}
Notes
- Result code
RESULT_CANCELEDindicates the user backed out without completing the flow. - Initialise first: The device must be initialised (
INIT) before processing payments (SALE). CARD_SCHEMEis only present on successful payments and may be null.- Amounts are in minor units (e.g. pence, cents).
Need help?
Contact your account manager or the Support Center to get paired with an implementation manager.