Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EFTCLIENT-4791 #148

Merged
merged 3 commits into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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);
}

}
}