Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/android/com/handpoint/cordova/HandpointHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -846,12 +846,13 @@ public void dependantRefundReceived(BigInteger amount, Currency currency, String
}

@Override
public void dependantReversalReceived(String originalTransactionId, ResumeDependantOperation resumeDependantOperation) {
public void dependantReversalReceived(String originalTransactionId, ResumeDependantOperation resumeDependantOperation, boolean cardPresent) {
this.resumeDependantOperationCallback = resumeDependantOperation;
this.logger.info("***[APP] -> Dependant Reversal Serialization start");
SDKEvent event = new SDKEvent("dependantReversalReceived");
event.put("originalTransactionId", originalTransactionId);
event.put("resumeDependantOperation", resumeDependantOperation);
event.put("cardPresent", cardPresent);
PluginResult result = new PluginResult(PluginResult.Status.OK, event.toJSONObject());
result.setKeepCallback(true);
if (this.callbackContext != null) {
Expand All @@ -866,6 +867,7 @@ public void executeDependantOperation(CallbackContext callbackContext, JSONObjec
Currency currency = Currency.parse(params.getInt("currency"));
String originalTransactionId = params.getString("originalTransactionId");
String operation = params.getString("operation");
boolean cardPresent = params.optString("cardPresent", "false").equalsIgnoreCase("true");

if (this.resumeDependantOperationCallback != null) {
if (operation != null) {
Expand All @@ -877,7 +879,7 @@ public void executeDependantOperation(CallbackContext callbackContext, JSONObjec
break;
case "saleReversal":
case "refundReversal":
DependantOperationDTO.Reversal operationReversal = new DependantOperationDTO.Reversal(new DependantOperationAmount(amount), currency, originalTransactionId);
DependantOperationDTO.Reversal operationReversal = new DependantOperationDTO.Reversal(new DependantOperationAmount(amount), currency, originalTransactionId, cardPresent);
this.resumeDependantOperationCallback.executeDependantOperation(operationReversal);
callbackContext.success("ok");
break;
Expand Down