Public Member Functions | |
abstract String | getName () |
abstract String | getMessageType () |
final String | getHandle () |
final boolean | isTypeOfMessage (@NonNull final String type) |
boolean | put (String key, Object value) |
Object | get (String key) |
List< String > | getKeys () |
Status | send (@NonNull final Context context) |
Static Public Member Functions | |
static Intent | createIntentWithName (final String name) |
static Intent | createIntentForMessage (final CommerceMessage message) |
static int | getNumberOfReceivers (Context context, final CommerceMessage message) |
static boolean | isResponseMessage (String name) |
static boolean | isRequestMessage (String name) |
static boolean | isMessageFromCPAndroid (String name) |
Static Public Attributes | |
static final String | MESSAGE_TYPE_INTERAPP = "INTERAPP" |
static final String | MESSAGE_TYPE_PAYMENTTRIGGER = "PAYMENTTRIGGER" |
static final String | MESSAGE_TYPE_NONPAYMENTTRIGGER = "NONPAYMENTTRIGGER" |
static final String | MESSAGE_TYPE_PAYMENTAPI = "PAYMENTAPI" |
static final String | MESSAGE_TYPE_UNKNOWN = "UNKNOWN" |
static final String | INTENT_ACTION_PREFIX = "com.verifone.commerce.intent.action." |
static final String | INTENT_CATEGORY = "com.verifone.commerce.intent.category.CP_MESSAGE" |
static final String | INTENT_EXTRA_HANDLE = "com.verifone.commerce.intent.extra.HANDLE" |
static final String | INTENT_EXTRA_PAYLOAD = "com.verifone.commerce.intent.extra.PAYLOAD" |
static final String | CP_JSON_KEY_TRANS_AMOUNT = "Trans_Amount" |
static final String | CP_JSON_KEY_CURRENCY = "Currency" |
Protected Member Functions | |
void | populateMessageFromJson (@NonNull final JSONObject jsonObject) |
void | setHandle (@NonNull final String handle) |
JSONObject | getJsonObject () |
void | setJsonObject (@NonNull final JSONObject jsonObject) |
abstract String | getAsJsonString () |
String | getCpAppId () |
void | setCpAppId (String cpAppId) |
String | getCpAppVersion () |
void | setCpAppVersion (String cpAppVersion) |
This message provides the foundation for all messages sent between Android applications and the Terminal applications.
The SDK provides a Builder class, as described below, which builds the appropriate Message class from the Intent. Any extra key/value pairs in the payload that are not a part of the defined message must still be included, and are only exposed through the free-form functions described in Commerce Message.
Definition at line 36 of file CommerceMessage.java.
Object get | ( | String | key | ) |
Retrieves a specific object from the payload. This is primarily useful when storing custom values in the messages.
key | The key to refer to the information. This should be developer-specific to avoid possible data conflicts. |
Definition at line 316 of file CommerceMessage.java.
final String getHandle | ( | ) |
A unique identifier for a sequence of messages, allowing a response to be linked to a request.
Definition at line 245 of file CommerceMessage.java.
List<String> getKeys | ( | ) |
Retrieves all custom keys from the payload. This is primarily useful when storing extra context in the messages.
Definition at line 333 of file CommerceMessage.java.
|
abstract |
Indicates the type of message to better enable message routing within a receiving application. This will only be set by the Builder, and readable afterwards. This is derived from the name/notification ID.
|
abstract |
The name of the message, useful for routing the message within an application.
|
static |
Detects if message goes from android CP app outside: responses for triggers and requests for APIs
Definition at line 280 of file CommerceMessage.java.
final boolean isTypeOfMessage | ( | @NonNull final String | type | ) |
Another way of handling message types. Refer to getMessageType() for more information.
Definition at line 253 of file CommerceMessage.java.
|
protected |
Optional method, called when building the message from an intent.
Definition at line 389 of file CommerceMessage.java.
boolean put | ( | String | key, |
Object | value | ||
) |
Allows putting custom values in the payload, which can provide additional context.
key | The key to refer to the information. This should be developer-specific to avoid possible data conflicts. |
value | The value to transmit. This value must be able to be added to a JSON object. |
Definition at line 294 of file CommerceMessage.java.
Status send | ( | @NonNull final Context | context | ) |
Sends the message.
Definition at line 348 of file CommerceMessage.java.
|
static |
Messages communicating with a companion application and the corresponding responses.
Definition at line 41 of file CommerceMessage.java.
|
static |
Triggers created by the Terminal Payment application outside of the context of a transaction and the corresponding responses.
Definition at line 51 of file CommerceMessage.java.
|
static |
Messages created by an Android application and sent to the Terminal Payment application within the context of a transaction and the corresponding responses.
Definition at line 56 of file CommerceMessage.java.
|
static |
Triggers created by the Terminal Payment application within the context of a transaction and the corresponding responses.
Definition at line 46 of file CommerceMessage.java.
|
static |
Allows for future extensions.
Definition at line 60 of file CommerceMessage.java.
This document is the confidential property of Verifone, Inc. Any reproduction or distribution of this document, in whole or in part, or the disclosure of any of the information contained herein, without the prior written consent of Verifone, Inc. is prohibited. This document and any supplemental material supplied as part of any review must be returned to Verifone, Inc. upon request. Notice: This document may go through material revisions over time. While the Company will make every effort to keep readers updated as changes occur, care must be taken by the reader to make sure they are reading the latest version. Version numbers appear in the title page and revision history page of this document. All rights reserved. Verifone, the Verifone logo are either trademarks or registered trademarks of Verifone in the United States and/or other countries. All other trademarks or brand names are properties of their respective holders.