Skip to content

Commit

Permalink
chore: adding logs EFTCLIENT-4791 (#148)
Browse files Browse the repository at this point in the history
* chore: adding logs

* chore: 4.1.7-RC.0

* chore: keep the import statements
  • Loading branch information
ecunado committed Jun 2, 2023
1 parent 3ce1a2a commit 9e41152
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-handpoint",
"version": "4.1.6-RC.0",
"version": "4.1.7-RC.0",
"description": "Cordova Handpoint SDK Plugin",
"cordova": {
"id": "cordova-plugin-handpoint",
Expand Down
21 changes: 14 additions & 7 deletions src/android/com/handpoint/cordova/HandpointHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -495,12 +495,18 @@ public void setLocale(CallbackContext callbackContext, JSONObject params) throws
@Override
public void endOfTransaction(TransactionResult transactionResult, Device device) {
SDKEvent event = new SDKEvent("endOfTransaction");
event.put("transactionResult", transactionResult);
event.put("device", device);
PluginResult result = new PluginResult(PluginResult.Status.OK, event.toJSONObject());
result.setKeepCallback(true);
if (this.callbackContext != null) {
this.callbackContext.sendPluginResult(result);
// print transaction result before serializing it
if (transactionResult != null) {
Logger.getLogger("App-Detailed-Logger").warning("***[APP] -> endOfTransaction received: " + transactionResult.toJSON());
event.put("transactionResult", transactionResult);
event.put("device", device);
PluginResult result = new PluginResult(PluginResult.Status.OK, event.toJSONObject());
result.setKeepCallback(true);
if (this.callbackContext != null) {
this.callbackContext.sendPluginResult(result);
}
} else {
Logger.getLogger("App-Detailed-Logger").warning("***[APP] -> endOfTransaction received: null");
}
}

Expand Down Expand Up @@ -887,6 +893,7 @@ public void getPaxModel(CallbackContext callbackContext, JSONObject params) thro
}
}

@Override
protected void finalize() {
this.api.unregisterEventsDelegate(this);
}
Expand All @@ -896,4 +903,4 @@ private void setEventsHandler() {
this.api.registerEventsDelegate(this);
}

}
}

0 comments on commit 9e41152

Please sign in to comment.