Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public final class TapToPayCallbacks

  1. Object
  2. TapToPayCallbacks

The entry points a port’s TapToPayBridge calls back into. Not for applications.

Every method may be called from any thread; each moves to the EDT before touching state. On iOS these are reached from native code by their C names, which is also what keeps them in a translated build.

Fields

public static final int STATUS_APPROVED = 0The card was charged.
public static final int STATUS_DECLINED = 1The card was declined.
public static final int STATUS_CANCELED = 2The payment was canceled.
public static final int STATUS_FAILED = 3The reader reported an error that is not a decline.
public static final int STATUS_ERROR = 4The payment could not be attempted (SDK setup, connection, the PaymentIntent could not be retrieved); completes the request with an error rather than a result.
public static final int STATUS_UNKNOWN = 5The card may have been charged and the SDK could not say: completes the request with a TerminalOutcomeUnknownException carrying the transaction ID.

Methods

public static void fetchConnectionToken(int tokenRequestId)The SDK needs a connection token.
public static void deliverResult(int requestId, int status, String transactionId, String message)The outcome of TapToPayBridge.collect.

Inherited methods

Field details

STATUS_APPROVED

public static final int STATUS_APPROVED = 0
The card was charged.

STATUS_DECLINED

public static final int STATUS_DECLINED = 1
The card was declined.

STATUS_CANCELED

public static final int STATUS_CANCELED = 2
The payment was canceled.

STATUS_FAILED

public static final int STATUS_FAILED = 3
The reader reported an error that is not a decline.

STATUS_ERROR

public static final int STATUS_ERROR = 4
The payment could not be attempted (SDK setup, connection, the PaymentIntent could not be retrieved); completes the request with an error rather than a result.

STATUS_UNKNOWN

public static final int STATUS_UNKNOWN = 5
The card may have been charged and the SDK could not say: completes the request with a TerminalOutcomeUnknownException carrying the transaction ID.

Method details

fetchConnectionToken

public static void fetchConnectionToken(int tokenRequestId)
The SDK needs a connection token. Asks the ConnectionTokenProvider of the most recent payment and answers with TapToPayBridge.connectionTokenReady(int, String, String).

Parameters

tokenRequestId int
the port’s ID for this request, echoed back

deliverResult

public static void deliverResult(int requestId, int status, String transactionId, String message)
The outcome of TapToPayBridge.collect.

Parameters

requestId int
the request’s ID
status int
one of the STATUS_ constants
transactionId String
the PaymentIntent ID, or null
message String
the SDK’s explanation, or null