cordova-plugin-netcontroll-integration 1.0.63 → 1.0.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/plugin.xml +1 -1
- package/src/android/Stone/StoneSumni.java +69 -4
- package/www/Stone/Sumni.js +4 -0
package/README.md
CHANGED
package/package.json
CHANGED
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
-
<plugin id="cordova-plugin-netcontroll-integration" version="1.0.
|
|
2
|
+
<plugin id="cordova-plugin-netcontroll-integration" version="1.0.66"
|
|
3
3
|
xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
|
4
4
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
|
5
5
|
|
|
@@ -56,6 +56,8 @@ import android.graphics.Matrix;
|
|
|
56
56
|
|
|
57
57
|
import android.util.Base64;
|
|
58
58
|
import java.io.ByteArrayOutputStream;
|
|
59
|
+
import java.util.Objects;
|
|
60
|
+
import java.util.stream.Collectors;
|
|
59
61
|
|
|
60
62
|
//Stone
|
|
61
63
|
|
|
@@ -188,7 +190,6 @@ public class StoneSumni {
|
|
|
188
190
|
String tipoTransacao = params.getString("tipoTransacao");
|
|
189
191
|
boolean capturar = params.getBoolean("capturar");
|
|
190
192
|
String valor = params.getString("valor");
|
|
191
|
-
valor = "159";
|
|
192
193
|
String statusChangeCallBack = params.getString("statusChangeCallBack");
|
|
193
194
|
|
|
194
195
|
final TransactionObject transactionObject = new TransactionObject();
|
|
@@ -407,12 +408,25 @@ public class StoneSumni {
|
|
|
407
408
|
cancellationProvider.setDialogMessage("Cancelando...");
|
|
408
409
|
cancellationProvider.setConnectionCallback(new StoneCallbackInterface() { // chamada de retorno.
|
|
409
410
|
public void onSuccess() {
|
|
410
|
-
|
|
411
|
+
switch (cancellationProvider.getResponseCodeEnum()) {
|
|
412
|
+
case Approved: case PartialApproved:
|
|
413
|
+
callbackContext.success(cancellationProvider.getMessageFromAuthorize());
|
|
414
|
+
break;
|
|
415
|
+
case Declined:
|
|
416
|
+
callbackContext.error(cancellationProvider.getMessageFromAuthorize());
|
|
417
|
+
break;
|
|
418
|
+
case TechnicalError:
|
|
419
|
+
callbackContext.error(cancellationProvider.getMessageFromAuthorize());
|
|
420
|
+
break;
|
|
421
|
+
case Default:
|
|
422
|
+
callbackContext.error(cancellationProvider.getMessageFromAuthorize());
|
|
423
|
+
break;
|
|
424
|
+
}
|
|
425
|
+
|
|
411
426
|
}
|
|
412
427
|
|
|
413
428
|
public void onError() {
|
|
414
|
-
|
|
415
|
-
callbackContext.error(cancellationProvider.getMessageFromAuthorize());
|
|
429
|
+
callbackContext.error(cancellationProvider.getListOfErrors().toString());
|
|
416
430
|
}
|
|
417
431
|
});
|
|
418
432
|
cancellationProvider.execute();
|
|
@@ -422,6 +436,57 @@ public class StoneSumni {
|
|
|
422
436
|
}
|
|
423
437
|
return false;
|
|
424
438
|
}
|
|
439
|
+
|
|
440
|
+
else if (action.equals("CancelarTransacaoCompleto")) {
|
|
441
|
+
JSONObject params = args.getJSONObject(0);
|
|
442
|
+
try {
|
|
443
|
+
String transactionObjectStr = params.getString("transactionObject");
|
|
444
|
+
TransactionObject transactionObject = parseJsonStringToObj(transactionObjectStr,TransactionObject.class);
|
|
445
|
+
|
|
446
|
+
final CancellationProvider cancellationProvider = new CancellationProvider(this.mContext, transactionObject);
|
|
447
|
+
cancellationProvider.useDefaultUI(false); // para dar feedback ao usuario ou nao.
|
|
448
|
+
cancellationProvider.setDialogMessage("Cancelando...");
|
|
449
|
+
cancellationProvider.setConnectionCallback(new StoneCallbackInterface() { // chamada de retorno.
|
|
450
|
+
public void onSuccess() {
|
|
451
|
+
|
|
452
|
+
TransactionDAO transactionDAO = new TransactionDAO(mContext);
|
|
453
|
+
List<TransactionObject> transactionObjects = transactionDAO.getAllTransactionsOrderByIdDesc();
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
switch (cancellationProvider.getResponseCodeEnum()) {
|
|
458
|
+
case Approved: case PartialApproved:
|
|
459
|
+
for (TransactionObject item : transactionObjects) {
|
|
460
|
+
if (transactionObject.getTransactionReference().equals((item.getTransactionReference()))) {
|
|
461
|
+
callbackContext.success(parseObjToJsonSrtring(item));
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
break;
|
|
466
|
+
|
|
467
|
+
case Declined:
|
|
468
|
+
callbackContext.error(cancellationProvider.getMessageFromAuthorize());
|
|
469
|
+
break;
|
|
470
|
+
case TechnicalError:
|
|
471
|
+
callbackContext.error(cancellationProvider.getMessageFromAuthorize());
|
|
472
|
+
break;
|
|
473
|
+
case Default:
|
|
474
|
+
callbackContext.error(cancellationProvider.getMessageFromAuthorize());
|
|
475
|
+
break;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
public void onError() {
|
|
480
|
+
callbackContext.error(cancellationProvider.getListOfErrors().toString());
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
cancellationProvider.execute();
|
|
484
|
+
return true;
|
|
485
|
+
} catch (Exception error1) {
|
|
486
|
+
callbackContext.error("Result - Stone - Sumni - CancelarTransacao: " + "Error Detail: " + error1);
|
|
487
|
+
}
|
|
488
|
+
return false;
|
|
489
|
+
}
|
|
425
490
|
return false;
|
|
426
491
|
}
|
|
427
492
|
|
package/www/Stone/Sumni.js
CHANGED
|
@@ -30,6 +30,10 @@ exports.CancelarTransacao = function (params, success, error) {
|
|
|
30
30
|
exec(success, error, 'NetControllCordovaPluginsIntegration', 'Stone.Sumni.CancelarTransacao', [params]);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
exports.CancelarTransacaoCompleto = function (params, success, error) {
|
|
34
|
+
exec(success, error, 'NetControllCordovaPluginsIntegration', 'Stone.Sumni.CancelarTransacaoCompleto', [params]);
|
|
35
|
+
}
|
|
36
|
+
|
|
33
37
|
|
|
34
38
|
|
|
35
39
|
|