cordova-plugin-netcontroll-integration 1.0.65 → 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 CHANGED
@@ -1,4 +1,4 @@
1
- Versao 1.0.64
1
+ Versao 1.0.65
2
2
 
3
3
  Funções internas de integração XMenu / NetControll
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-netcontroll-integration",
3
- "version": "1.0.65",
3
+ "version": "1.0.66",
4
4
  "description": "Plugin cordova de integracao para uso interno (NetControll/ XMenu)",
5
5
  "cordova": {
6
6
  "id": "cordova-plugin-netcontroll-integration",
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.65"
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
 
@@ -406,12 +408,25 @@ public class StoneSumni {
406
408
  cancellationProvider.setDialogMessage("Cancelando...");
407
409
  cancellationProvider.setConnectionCallback(new StoneCallbackInterface() { // chamada de retorno.
408
410
  public void onSuccess() {
409
- callbackContext.success(cancellationProvider.getMessageFromAuthorize());
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
+
410
426
  }
411
427
 
412
428
  public void onError() {
413
- String teste2 = "";
414
- callbackContext.error(cancellationProvider.getMessageFromAuthorize());
429
+ callbackContext.error(cancellationProvider.getListOfErrors().toString());
415
430
  }
416
431
  });
417
432
  cancellationProvider.execute();
@@ -421,6 +436,57 @@ public class StoneSumni {
421
436
  }
422
437
  return false;
423
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
+ }
424
490
  return false;
425
491
  }
426
492
 
@@ -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