New payment

This section explains how POS applications can trigger a payment flow in honei Terminal using Android Intents and receive a result back once the payment is completed.


Integration flow

Intent Action

To start a payment, you must create an Intent with the following action and extras:

Intent intent = new Intent("app.honei.terminal.INIT_PAYMENT");
intent.putExtra("amount", "25.00");
// Start the intent as task
startActivityForResult(intent, 1001);

Parameters

Key
Type
Description

amount

Double

Amount to charge (e.g. "25.00")

Receiving Results

When honei Terminal finishes, the result is delivered back to your app:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode != 1001 || data != null) return;
    
    if (resultCode == RESULT_OK) {
        String status = data.getStringExtra("status");
        double amount = data.getDoubleExtra("amount", 0.0);
        double tip = data.getDoubleExtra("tip", 0.0);
        String paymentId = data.getStringExtra("paymentId");
        // Handle success
    } else {
        // Handle declined
    }
    
}

Result Data

Key
Type
Description

status

String

Final state of the payment (see below)

amount

Double

Charged amount (without tip)

tip

Double

Tip amount selected by the customer (if any)

paymentId

String

Payment ID

Possible status values

  • completed → Payment successfully completed.

  • declined → Payment declined by terminal/bank.

  • cancelled → User cancelled the payment flow.

  • timed_out → Payment flow expired due to timeout.

  • not_completed → Payment was started but not finalized.

Result Codes

  • RESULT_OK → Usually returned for completed.

  • RESULT_CANCELED → Returned for declined, cancelled, timed_out, or not_completed.

Last updated