macOS AnyPay SDK 1.90.4

Version 1.90.4

Support System

AnywhereCommerce introduces a new toolset to its list of products that would help the developers and the users of the AnywhereCommerce's AnyPay platform in debugging and analysing any errors or odd behaviours. The new toolset named Support System features:

  • Realtime Log Viewer
  • Realtime Transaction Sequence Viewer
  • Historical Log Viewer
  • Historical Transaction Viewer

AnyPay platform's latest SDK v1.90.4 finely collaborates with this tool and enables some enhanced features like real-time logging which displays all the terminal configured logs for any debugging purpose.

Support System is designed to help developers and users debug a situation. With proper terminal logging configuration, apps using AnyPay SDKs could benefit highly. Developers can now focus on their business model without a need for investing into a logging solution.
To login to a support system, you need a support key of your application which is provided by the AnyPay SDK. Developers need to set their own passphrase for their support keys using the SDK apis in order to login to the Support System. Detailed description on how to get your support key and set a passphrase is provided in the AnyPay's SDK respective documentations.

Important: User should select the Use Support / Passphrase key option to login with their support key and passphrase. Login via Username/password is intended to be used only by AnywhereComerce admins and support team.

Support Key

AnyPay's latest SDK release provides every application with a unique Support Key. Refer to SDK documentation on how to get the support key and how to set its passphrase.


Features

Realtime Log Viewer

This tool can be used to view AnyPay SDK's logs online in real time. Before using this tool make sure remoteLoggingEnabled is enabled in the logging configuration.

Realtime Transaction Sequence Viewer

This tool imitates the ongoing transaction events in your application and displays it in realtime. This is a visual tool to display a transaction's state with an animated sequence of events as they occur.

Important: To work properly this feature requires remoteLoggingEnabled set to true and logLevel set to DEBUG or VERBOSE in terminal logging configuration

As new transactions are created, the tool would display their processing states and errors if any.

Historical Transaction Viewer

Using this feature you can view any existing transaction's state with an animated sequence of events by passing in the transaction'a id. It will display whether the mentioned transaction approved or failed and any errors related to it. It needs a transaction's UUID in case it was a cloud based transaction.

Transaction Sequence States

  1. TERMINAL_CONNECTION_STATE - Marks a terminal's connection state change
  2. CLOUD_TRANSACTION_MESSAGE_RECEIVED - State when a new transaction is created on the cloud server and is received on the terminal
  3. CLOUD_TRANSACTION_MESSAGE_UPDATE - State when the terminal responds to a new transaction request whether it accepts it or rejects it
  4. TRANSACTION_PROCESSING_STARTED - State when a transaction processing starts after terminal accepts it
  5. READER_INITIALIZING - Reader initialization event in case of ongoing transaction
  6. READER_CONNECTION_STATE - Reader connection state event in case of ongoing transaction
  7. READER_EVENT - Any reader event like "PIN entry required"
  8. READER_ERROR_OR_CANCELLATION - States a reader error or cancellation on reader
  9. ENDPOINT_AUTHENTICATION_REQUEST - States the endpoint authentication request
  10. ENDPOINT_AUTHENTICATION_RESPONSE - States the endpoint authentication response
  11. ENDPOINT_SUBMIT_TRANSACTION_REQUEST - States the transaction submission request to endpoint server
  12. ENDPOINT_SUBMIT_TRANSACTION_RESPONSE - States the submitted transaction's response from endpoint server
  13. READER_TRANSACTION_RESULT - States the result from the reader
  14. TRANSACTION_ERROR_OR_CANCELLATION - Event in case there was a transaction error or user cancellation
  15. CLOUD_TRANSACTION_UPDATE - State when the existing transaction is updated on the cloud

Historical Log Viewer

Unlike Realtime Log Viewer, this tool focuses on displaying the historical raw logs. Its comes with a date filtering option which allows user to view historical logs generated between a specific period of time

Terminal Logging Configuration

Log Levels

Terminals can be configured to log events with different levels. Below are the different log levels AnyPay provides

  • VERBOSE
  • DEBUG
  • INFO
  • WARN
  • ERROR

By default ERROR is used if no level is set explicitly.

LevelUsageIdentifier
VERBOSETraces all the log events including requests/responses with payload data and headersv
DEBUGTraces all non-logging requests/responses with payload data and headersd
INFOTraces all requests/responses without payload data and headersi
WARNLogs events that are important but are not errors or fatal i.e. odd circumstances and contract violation assertion errors.w
ERRORTraces only errors and exceptions. If request fails it would log URL, status code, and failure reason.e

Effective Log Level

alt-text

Log Properties

AnyPay features following properties to log events as per your requirement

PropertyUsageDefault Value
remoteLoggingEnabledIf set to true, sends all the configured logs to the cloud serverfalse
logToFileWrites all the logs to a local text filetrue
logToConsoleWrites all the logs to the console. Used for development using AnyPay SDKfalse
batchingIntervalTime interval in seconds to send the log batch to cloud server15 seconds
logLevelLog level for the eventsERROR
realtimeLoggingEnabledIf true, sends the log batch to cloud every 5 seconds with realtime set to truefalse
streamLogTo (beta)Set your own server url to send the logs to instead of sending it to cloud server

Loggers

Loggers log events. AnyPay segments them into three separate loggers. Each logger has a single character unique identifier which it marks a log event with.

LoggerDescriptionIdentifier
defaultLogs regular events including requests/responses to cloud servera
deviceOnly logs events related to card reader. If not configured separately, it inherits its configuration properties from default logger configurationd
endpointOnly logs requests/responses from endpoint api calls. If not configured separately, it inherits its configuration properties from default logger configuratione

Each logger can have its own set of configuration properties. For example device logger may be set to DEBUG level whereas endpoint logger can be configured to log ERROR events only. If device and endpoint properties are not set in the terminal JSON, default configuration is inherited and used. Configuration section below describes in detail how to set separate configurations in terminal JSON.

Logs from different loggers can be identified by its unique identifier. Each log event is prefixed with a timestamp, logger identifier, log level and event context.

timestamp [terminalMode | logger unique identifier | logger log level] Context ..LOG MESSAGE..

Transaction specific logs are prefixed with additional parameters
timestamp [terminalMode | logger unique identifier | logger log level | Transaction Sequence State | Transaction UUID] Context ..LOG MESSAGE..

For example:

2020-07-09T12:01:33.2449057+05:30 [c|d|d] BBPOSEventDispatchControllerListener.onWaitingForCard [BBPOSDeviceEventDispatch]
checkCardMode: SWIPE_OR_INSERT_OR_TAP

Here c stands for terminalMode cloud. If terminalMode is app, a is used. All cloudbridge applications should have terminalMode set to cloud in terminal configuration

'd' in middle is the unique identifier for device logger

'd' is for debug log level

alt-text

alt-text

alt-text

Configuration

This section explains how to configure terminal JSON to log desired events for debugging and testing.

JSON Structure

"configuration": {
  "logging": {
    "remoteLoggingEnabled": true,
    "logLevel": "DEBUG",
    "logToFile": true
  }
}

You can configure the default logging inside the configuration object of terminal. If device and endpoint logging configuration are not provided, configuration set for default logger would be used as their logger configuration.

endpoint logger configuration should be set inside the endpoint object as shown below:

"configuration": {
  "endpoint": {
      "provider": "propay",
      "xmlApiBaseUrl": "https://xmltest.propay.com/api/",
      "jsonApiBaseUrl": "https://mobileapitest.propay.com/merchant.svc/json/",
      "x509Cert": "****",
      "certStr": "****",
      "splitfundingAccountNum": "",
      "flavor": "test",
      "gatewayUrl": "https://mobileapitest.propay.com/merchant.svc/json/",
      "serverDateFormat": "dd-MM-yyyy HH:mm:ss:SSS",
      "terminalID": "****",
      "terminalId": "****",
      "logging": {
        "remoteLoggingEnabled": false,
        "logLevel": "DEBUG"
      }
}

device logger configuration should be set inside the cardReader object as shown below:

{
"configuration": {
  "cardReader": {
      "logging": {
        "remoteLoggingEnabled": true,
        "logLevel": "VERBOSE"
      }
    }
}
}

Below is the complete sample terminal json for reference.

{
  "activationCode": "******",
  "status": "ACTIVE",
  "uuid": "*****",
  "id": "****",
  "portfolio": "mycompany",
  "dateCreated": "2020-07-09T08:17:00.3693473+00:00",
  "dateModified": "2019-06-26T15:59:13.7509031+00:00",
  "configuration": {
    "requireDigestAuthentication": "false",
    "endpoint": {
      "provider": "propay",
      "xmlApiBaseUrl": "https://xmltest.propay.com/api/",
      "jsonApiBaseUrl": "https://mobileapitest.propay.com/merchant.svc/json/",
      "x509Cert": "****",
      "certStr": "****",
      "splitfundingAccountNum": "",
      "flavor": "test",
      "gatewayUrl": "https://mobileapitest.propay.com/merchant.svc/json/",
      "serverDateFormat": "dd-MM-yyyy HH:mm:ss:SSS",
      "terminalID": "****",
      "terminalId": "****",
      "logging": {
        "remoteLoggingEnabled": true,
        "logLevel": "DEBUG"
      }
    },
    "cardReader": {
      "logging": {
        "remoteLoggingEnabled": true,
        "logLevel": "VERBOSE"
      }
    },
    "defaultDateFormat": "dd-MM-yyyy HH:mm:ss:SSS",
    "registerCardReaderWhenConnected": true,
    "cloudSyncEnabled": true,
    "allowDynamicTerminalCreation": true,
    "terminalMode": "Cloud",
    "allowAnonymousUsers": true,
    "allowClearTransactions": true,
    "allowPartialAuthorizations": true,
    "allowPartialRefunds": true,
    "allowReferencedRefunds": true,
    "allowUnreferencedRefunds": true,
    "chequeColorFormat": "Color",
    "chequeColorFormatEditable": true,
    "chequeFileFormat": "PNG",
    "chequeFileFormatEditable": true,
    "customFieldsEnabled": false,
    "customFieldsEnabledEditable": false,
    "defaultCardReader": "Sherpa",
    "defaultCardReaderEditable": true,
    "defaultCurrency": "USD",
    "driversLicenseRequired": false,
    "driversLicenseRequiredEditable": false,
    "driversLicenseStateRequired": false,
    "driversLicenseStateRequiredEditable": false,
    "enableAvs": true,
    "enableCvv": true,
    "enableFirmwareUpdate": false,
    "enableForgotPasswordUrl": false,
    "enabledCurrency": "USD",
    "enabledCurrencyEditable": false,
    "enabledEntryModes": "SWIPE INSERT TAP PINPAD",
    "enabledEntryModesEditable": false,
    "enabledPaymentMethods": "CREDIT",
    "enabledPaymentMethodsEditable": true,
    "enabledReceiptOptions": "Default",
    "enabledReceiptOptionsEditable": false,
    "enforce": true,
    "enforceFirmwareCompliance": false,
    "forgotPasswordUrl": "https://payments.anywherecommerce.com/merchant/selfcare",
    "geofencingEnabled": false,
    "geofencingEnabledEditable": false,
    "geolocationEnabled": true,
    "geolocationEnabledEditable": false,
    "id": "default",
    "requireAvs": false,
    "requireCardPresentRefunds": false,
    "requireCardPresentSales": false,
    "requireCvv": false,
    "requireTermsAndConditions": false,
    "sessionTimeoutEnabled": false,
    "sessionTimeoutEnabledEditable": true,
    "sessionTimeoutInterval": "Never",
    "supportedCurrencies": "ALL",
    "supportedEntryModes": "SWIPE INSERT TAP PINPAD",
    "supportedPaymentMethods": "CREDIT DEBIT CHEQUE",
    "supportedReceiptOptions": "Default",
    "surchargeEnabled": false,
    "surchargeEnabledEditable": true,
    "surchargeOptionsEditable": true,
    "suspendAndResumeEnabled": false,
    "suspendAndResumeEnabledEditable": false,
    "suspendAndResumeSupportedEntryModes": "SWIPE PINPAD",
    "suspendAndResumeSupportedPaymentMethods": "CREDIT",
    "taxEnabled": true,
    "taxEnabledEditable": true,
    "taxRatesEditable": true,
    "terminalEnabled": true,
    "termsAndConditionsUrl": "",
    "timestamp": "2018-01-01",
    "tipEnabled": true,
    "tipEnabledEditable": true,
    "tipOptionsEditable": true,
    "transactionReportingMode": "ALL_USERS",
    "transactionReportingModeEditable": true,
    "unreferencedRefundLimit": 99999,
    "userAuthenticationMode": "DEFER_UNTIL_REQUIRED",
    "verifyCardPresentForKeyedTransactions": false,
    "version": "default1",
    "dateModified": "10-09-2018 18:45:43:227",
    "allowKeyedTransactions": true,
    "cloudPOSURL": "https://cloud-sandbox.payments.ac/",
    "logging": {
      "remoteLoggingEnabled": true,
      "logLevel": "DEBUG",
      "logToFile": true
    }
  }
}

Accessing File Logs

Log files are saved per platform specification and can be access as below:

Windows

Stored in Common Application Data folder.

C://ProgramData/AnyPay/Logs

macOS

Stored inside Container Library

~/Library/Containers/com.netsecure.CloudBridge/Data/Documents/Logs

iOS

Stored inside Application container Documents folder

Android

Stored inside /data directory of the app

Frequently asked questions

1. How to access support key on CloudBridge applications?

All AnywhereCommerce whitelabel applications and CloudBridge apps use a common support key passphrase QK7vhfspqEdU@vHK

2. Empty or null support key

This is usually due to the SDKs losing internet connection while making a call to the logging server. Restart the app once you regain the connectivity.

3. Transaction Sequence Viewer (Historical or State), now imitating transaction events?

Make sure DEBUG logs are enabled for terminal logging configuation