Android SDK - Appendix A - Custom Logging Utility

The Android SDK exposes core and UI package methods that can be used to implement a custom logging utility that conforms to the Logging Format Specification provided.

Developers are cautioned to implement a custom solution only if specific requirements are not met by the standard Paydiant Logging Utility implementation.

Item Description
UI Package com.paydiant.android.ui.service.logging.PaydiantLoggingService exposes the following service methods.
Send Log Messages public void sendLogMessages(Map<String, String> logEntries)

This method sends the messages provided in the logEntries Map to the server. Each key in the logEntries Map is an application event such as successful login, failed login, etc.

The value is the event status along with any exceptions or other relevant information. In addition to the events, information related to the user device also needs to be sent to uniquely identify the device log entry and should contain other useful troubleshooting information. Keys related to some of the device information are available on the com.paydiant.android.core.enums.PaydiantLoggingEntryKey enum and the keys related to some application events are available on com.paydiant.android.core.enums.PaydiantLoggingEventType enum.

UI Implementation

Item Description
Applicable Listener Callbacks void onSendLogMessageSuccess();
Called when the log entries are successfully sent to the mobile gateway.

void onSendLogMessageFail(PaydiantException exception);
Called when the log messages could not be sent due to an error.
Set Logging Service Listener public void setLoggingServiceListener(IPaydiantLoggingServiceListener loggingServiceListener)

Sets an implementation of com.paydiant.android.ui.service.logging.IPaydiantLoggingServiceListener
or an overridden instance of com.paydiant.android.ui.service.logging.PaydiantLoggingServiceListenerAdapter to handle callbacks.
Remove Listener void removeListener();
Call this method to remove the logging service listener and set it to null.

Core Package Methods

com.paydiant.android.core.facade.PaydiantLoggingManagerFacade exposes the following facade methods.

Item Description
Send Log Messages public void sendLogMessages(Map < String, String > logEntries)

Similar to the UI package method, this sends the messages provided in the logEntries map to the server.

Paydiant Logging Format Specification

This section defines the logging format required by the Core and UI package methods for custom logging implementations. This section also lists the applicable event types and their relevant parameter entries.

Log message format

Each log message must comply with the format and sequence specifications defined here. In addition, the following rules must be observed for all entries:

  1. Any entry given in the format key=value is considered a Map entry to be passed to the Core/UI package methods.
  2. Any entry prefixed with a $ (for example $application_version) is considered a variable to be set during runtime.
  3. Any entry surrounded with < and > is an expanded/extended format, which will be defined below the current content. For example:
Log message:=
    appVersion=$application_version
    < Device_Details >
    lastSucceessfulHeartbeat= $last_succeessful_heartbeat
    lastFailedHeartbeat=$last_failed_heartbeat
    < Event_Information >

Device Details:=
    appVersionName=$appVersionName
    appVersionCode=4appVersionCode
    rooter=$rooted
    deviceId=$device_id
    deviceOS=$OS_version
    deviceManufacturer=$device_manufacturer
    deviceBrand=$device_brand
    deviceModel=$device_model
    deviceNumberOfProcesses=$number_of_processes_running
    deviceAvailableMemory=$available_memory

Event Information:=
    event-001= < Event-1_Details >
    event-002= < Event-2_Details >
...
    event-n= < Event-n_Details >

Event-x details

The Event Details format can vary based on whether the event occurred while network connectivity was cellular or Wi-Fi.

If the event was triggered during cellular network connectivity:

date:$date_time_timezone|network:$cellular_network_name| < event_syntax >

If the event was triggered during Wi-Fi network connectivity:

date:$date_time_timezone|ssid:$wifi_ssid_name|macAddress:$wifi_mac_address| < event_syntax >

Logging Event Syntax and Parameters

The following index specifies the event syntax along with additional event parameters required for each use case.

Use Case App Log Event
(Append to "result:" in syntax)
Event Syntax
Login login_success result:login_success
login_fail result:login_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Logoff logoff_success result:logoff_success
logoff_fail result:logoff_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Scan scan_success result:scan_success | token:$token
scan_fail result:scan_fail | userMsg:$prompted_message
Get Transaction Information tx_info_retrieve_success result:tx_info_retrieve_success | txType:$transaction_type | txRefId:$transaction_ref_id|apName:$merchant_name | alName:$merchant_location_name
tx_info_retrieve_fail result:tx_info_retrieve_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Payment payment_success result:payment_success | txRefId:$transaction_ref_id | total:$total
payment_fail result:payment_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Cash Access cash_access_success result:cash_access_success | txRefId:$transaction_ref_id | total:$total
cash_access_fail result:cash_access_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Refund refund_success result:refund_success | txRefId:$transaction_ref_id | total:$total
refund_fail result:refund_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Cancel Payment payment_cancel_success result:payment_cancel_success | txRefId:$transaction_ref_id
payment_cancel_fail result:payment_cancel_fail |userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Cancel Cash Access cash_access_cancel_success result:cash_access_cancel_success | txRefId:$transaction_ref_id
cash_access_cancel_fail result:cash_access_cancel_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Cancel Refund refund_cancel_success result:refund_cancel_success | txRefId:$transaction_ref_id
refund_cancel_fail result:refund_cancel_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Retrieve Accounts accounts_retrieve_success result:accounts_retrieve_success
accounts_retrieve_fail result:accounts_retrieve_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Refresh All Accounts accounts_refresh_success result:accounts_refresh_success
accounts_refresh_fail result:accounts_refresh_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Refresh One Account account_refresh_success result:account_refresh_success
account_refresh_fail result:account_refresh_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Retrieve Receipts receipts_retrieve_success result:receipts_retrieve_success | numberOfReceipts:$receipt_count
receipts_retrieve_fail result:receipts_retrieve_fail
Refresh Receipts receipts_refresh_success result:receipts_refresh_success
receipts_refresh_fail result:receipts_refresh_fail
NFC Scan nfc_scan_success result:nfc_scan_success | token:$token
nfc_scan_failed result:nfc_scan_fail
Connection Lost (Heartbeat Failed) connection_lost result:connection_lost | userMsg:$prompted_message
Check Device Status device_status_check_success result:device_status_check_success | active: YES_or_NO | registered: YES_or_NO
device_status_check_fail result:device_status_check_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Retrieve MFA Questions mfa_questions_retrieve_success result:mfa_questions_retrieve_success
mfa_questions_retrieve_fail result:mfa_questions_retrieve_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Check User ID Availability user_id_availability_check_success result:user_id_availability_check_success
user_id_availability_check_fail result:user_id_availability_check_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Register New Wallet user_registration_success result:user_registration_success
user_registration_fail result:user_registration_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Update User Profile user_profile_update_success result:user_profile_update_success
user_profile_update_fail result:user_profile_update_fail
Update Password password_update_success result:password_update_success
password_update_fail result:password_update_fail
Update Passcode passcode_update_success result:passcode_update_success
passcode_update_fail result:passcode_update_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Update MFA Answers mfa_answers_update_success result:mfa_answers_update_success
mfa_answers_update_fail result:mfa_answers_update_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Update Expired Password expired_password_reset_success result:expired_password_reset_success
expired_password_reset_fail result:expired_password_reset_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Reset Forgotten Password password_reset_success result:password_reset_success
password_reset_fail result:password_reset_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Reset Forgotten Passcode passcode_reset_success result:passcode_reset_success
passcode_reset_fail result:passcode_reset_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Request Forgotten Username username_request_success result:username_request_success
username_request_fail result:username_request_fail
Submit MFA Responses mfa_answers_submit_success result:mfa_answers_submit_success
mfa_answers_submit_fail result:mfa_answers_submit_fail
Retrieve Account Configurations account_config_retrieve_success result:account_config_retrieve_success
account_config_retrieve_fail result:account_config_retrieve_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Add Payment Account account_add_success result:account_add_success
account_add_fail result:account_add_fail
Update Payment Account account_update_success result:account_update_success
account_update_fail result:account_update_fail
Delete Payment Account account_delete_success result:account_delete_success
account_delete_fail result:account_delete_fail
Activate Payment Account account_activation_success result:account_activation_success
account_activation_fail result:account_activation_fail
Unlink Device device_unlink_success result:device_unlink_success
device_unlink_fail result:device_unlink_fail
Install Wi-Fi Profile wifi_profile_installation_success result:wifi_profile_installation_success
wifi_profile_installation_fail result:wifi_profile_installation_fail | userMsg:$prompted_message
Retrieve Available Offers available_offer_retrieve_success result:available_offer_retrieve_success
available_offer_retrieve_fail result:available_offer_retrieve_fail
Activate Offer available_offer_activate_success result:available_offer_activate_success
available_offer_activate_fail result:available_offer_activate_fail
Retrieve Activated Offers my_offer_retrieve_success result:my_offer_retrieve_success
my_offer_retrieve_fail result:my_offer_retrieve_fail
Deactivate an Offer my_offer_remove_success result:my_offer_remove_success
my_offer_remove_fail result:my_offer_remove_fail
Retrieve Password Policy password_policy_retrieve_success result:password_policy_retrieve_success
password_policy_retrieve_fail result:password_policy_retrieve_fail
Retrieve Billing Address billing_address_retrieve_success result:billing_address_retrieve_success
billing_address_retrieve_fail result:billing_address_retrieve_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Retrieve User Information user_info_retrieve_success result:user_info_retrieve_success
user_info_retrieve_fail result:user_info_retrieve_fail | userMsg:$prompted_message | errCode:$error_code | errDesc:$error_description
Device Session Expired device_session_expired result:device_session_expired
Update Device Description device_description_update_success result:device_description_update_success
device_description_update_fail result:device_description_update_fail

Paydiant Android javadocs

Feedback

Have feedback?

Let us know.