cordova-plugin-netcontroll-integration 1.0.66 → 1.0.69
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 +6 -3
- package/src/android/Elgin/ElginSmartPay.java +22 -0
- package/src/android/Stone/StoneSumni.java +69 -29
- package/src/build.gradle +7 -0
- package/src/libs/barcodescanner-release-2.1.5.aar +0 -0
- package/www/Cielo/LioLocal.js +1 -1
- package/www/Stone/Sumni.js +8 -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.69"
|
|
3
3
|
xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
|
4
4
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
|
5
5
|
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
<source-file src="src/android/Elgin/ElginM10Terminal.java" target-dir="src/cordova-plugin-m8/cordova-plugin-m8" />
|
|
61
61
|
<source-file src="src/android/Elgin/ElginSmartPay.java" target-dir="src/cordova-plugin-m8/cordova-plugin-m8" />
|
|
62
62
|
<source-file src="src/android/Cielo/CieloLioLocal.java" target-dir="src/cordova-plugin-m8/cordova-plugin-m8" />
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
<source-file src="src/android/Stone/StoneSumni.java" target-dir="src/cordova-plugin-m8/cordova-plugin-m8" />
|
|
64
|
+
<source-file src="src/android/Rede/RedeGPos700.java" target-dir="src/cordova-plugin-m8/cordova-plugin-m8" />
|
|
65
65
|
<!-- <source-file src="src/android/NetControllCordovaPluginsIntegration.java" target-dir="src/cordova/plugin/netcontroll/integration/NetControllCordovaPluginsIntegration" />
|
|
66
66
|
<source-file src="src/android/Elgin/ElginM10Terminal.java" target-dir="src/cordova-plugin-m8/cordova-plugin-m8" /> -->
|
|
67
67
|
|
|
@@ -75,6 +75,9 @@
|
|
|
75
75
|
<resource-file src="src/libs/cloudpossdk-s-1.0.2.aar" target="libs/cloudpossdk-s-1.0.2.aar" />
|
|
76
76
|
<resource-file src="src/libs/InterfaceAutomacao-v2.0.0.9.aar" target="libs/InterfaceAutomacao-v2.0.0.9.aar" />
|
|
77
77
|
|
|
78
|
+
<!-- BarcodeScanner -->
|
|
79
|
+
<!-- <resource-file src="src/libs/barcodescanner-release-2.1.5.aar" target="libs/barcodescanner-release-2.1.5.aar" /> -->
|
|
80
|
+
|
|
78
81
|
<!-- UseRede -->
|
|
79
82
|
<resource-file src="src/libs/sdk_3.0_release.aar" target="libs/sdk_3.0_release.aar" />
|
|
80
83
|
<resource-file src="src/libs/payment-1.14.10.181016.aar" target="libs/payment-1.14.10.181016.aar" />
|
|
@@ -47,6 +47,8 @@ import com.elgin.e1.Impressora.Termica;
|
|
|
47
47
|
import com.elgin.e1.Pagamento.Controller.TipoImpressao;
|
|
48
48
|
import com.elgin.e1.Pagamento.ElginPay;
|
|
49
49
|
|
|
50
|
+
import br.com.setis.interfaceautomacao.Personalizacao;
|
|
51
|
+
|
|
50
52
|
import javax.security.auth.callback.Callback;
|
|
51
53
|
|
|
52
54
|
/**
|
|
@@ -279,7 +281,27 @@ public class ElginSmartPay {
|
|
|
279
281
|
return true;
|
|
280
282
|
} else if (action.equals("IniciarPagamento")) {
|
|
281
283
|
try {
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
282
287
|
ElginPay pagamento = new ElginPay();
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
Personalizacao.Builder pb = new Personalizacao.Builder();
|
|
291
|
+
// pb.informaIconeToolbar(new File("/sdcard/ic_launcher_round.png")); // Altera o ícone
|
|
292
|
+
// pb.informaFonte(new File("/system/fonts/Clockopia.ttf")); // Altera a fonte
|
|
293
|
+
// pb.informaCorFonte("#FC9F00"); // Altera a cor da fonte
|
|
294
|
+
// pb.informaCorFonteTeclado("#FC9F00"); // Altera a cor da fonte do teclado
|
|
295
|
+
// pb.informaCorFundoToolbar("#FC9F00"); // Altera a cor do fundo da barra superior
|
|
296
|
+
// pb.informaCorFundoTela("#0C0807"); // Altera a cor do fundo da tela
|
|
297
|
+
// pb.informaCorTeclaLiberadaTeclado("#464B4E"); // Altera a cor da tecla liberada do teclado
|
|
298
|
+
// pb.informaCorFundoTeclado("#1B1A1C"); // Altera a cor do fundo do teclado
|
|
299
|
+
// pb.informaCorTextoCaixaEdicao("#464B4E"); // Altera a cor do texto da caixa de edição
|
|
300
|
+
// pb.informaCorSeparadorMenu("#FC9F00"); // Altera a cor dos separadores do menu
|
|
301
|
+
Personalizacao personalizacao = pb.build(); // Cria o objeto de personalização
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
pagamento.setPersonalizacao(personalizacao);
|
|
283
305
|
|
|
284
306
|
JSONObject params = args.getJSONObject(0);
|
|
285
307
|
int tipoTransacao = params.getInt("tipoTransacao");
|
|
@@ -66,6 +66,7 @@ import stone.providers.ActiveApplicationProvider;
|
|
|
66
66
|
import stone.providers.BaseTransactionProvider;
|
|
67
67
|
import stone.providers.TransactionProvider;
|
|
68
68
|
import stone.providers.CancellationProvider;
|
|
69
|
+
import stone.providers.ReversalProvider;
|
|
69
70
|
|
|
70
71
|
import stone.application.StoneStart;
|
|
71
72
|
|
|
@@ -90,7 +91,6 @@ import com.google.zxing.BarcodeFormat;
|
|
|
90
91
|
import com.google.zxing.WriterException;
|
|
91
92
|
import com.google.zxing.qrcode.QRCodeWriter;
|
|
92
93
|
import com.google.zxing.common.BitMatrix;
|
|
93
|
-
//import com.google.zxing.client.j2se.MatrixToImageWriter;
|
|
94
94
|
|
|
95
95
|
|
|
96
96
|
import stone.user.UserModel;
|
|
@@ -99,7 +99,7 @@ import stone.utils.Stone;
|
|
|
99
99
|
|
|
100
100
|
public class StoneSumni {
|
|
101
101
|
private BaseTransactionProvider transactionProvider;
|
|
102
|
-
|
|
102
|
+
|
|
103
103
|
//Cordova/Java Params
|
|
104
104
|
private Activity mActivity;
|
|
105
105
|
private Context mContext;
|
|
@@ -203,7 +203,7 @@ public class StoneSumni {
|
|
|
203
203
|
transactionObject.setCapture(capturar);
|
|
204
204
|
transactionObject.setAmount(valor);
|
|
205
205
|
|
|
206
|
-
|
|
206
|
+
transactionProvider = new PosTransactionProvider(this.mContext, transactionObject, GetSelectedUserModel(0));
|
|
207
207
|
transactionProvider.useDefaultUI(true);
|
|
208
208
|
transactionProvider.setDialogTitle("Aguarde"); // Título do Dialog
|
|
209
209
|
transactionProvider.setDialogMessage("Enviando..."); // Mensagem do Dialog
|
|
@@ -217,19 +217,24 @@ public class StoneSumni {
|
|
|
217
217
|
executeGlobalJavascript(statusChangeCallBack + "('" + transactionStatus + "')");
|
|
218
218
|
}
|
|
219
219
|
});
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
220
|
+
callbackContext.success(parseObjToJsonSrtring(transactionObject));
|
|
221
|
+
// if (transactionObject.getTransactionStatus() == TransactionStatusEnum.APPROVED) {
|
|
222
|
+
// callbackContext.success(parseObjToJsonSrtring(transactionObject));
|
|
223
|
+
// } else {
|
|
224
|
+
// String msg = "Erro na transação";
|
|
225
|
+
// if (transactionProvider.getMessageFromAuthorize() != null) {
|
|
226
|
+
// msg += ":" + transactionProvider.getMessageFromAuthorize();
|
|
227
|
+
// } else {
|
|
228
|
+
// msg += "!";
|
|
229
|
+
// }
|
|
230
|
+
// callbackContext.error(msg);
|
|
231
|
+
// }
|
|
226
232
|
}
|
|
227
233
|
|
|
228
234
|
@Override
|
|
229
235
|
public void onError() {
|
|
230
|
-
Object teste2 = transactionObject;
|
|
231
|
-
callbackContext.error("Erro na transação");
|
|
232
236
|
// Erro na transação
|
|
237
|
+
callbackContext.error(transactionProvider.getListOfErrors().toString());
|
|
233
238
|
}
|
|
234
239
|
|
|
235
240
|
@Override
|
|
@@ -243,7 +248,9 @@ public class StoneSumni {
|
|
|
243
248
|
});
|
|
244
249
|
}
|
|
245
250
|
});
|
|
246
|
-
|
|
251
|
+
new Thread(() -> {
|
|
252
|
+
transactionProvider.execute();
|
|
253
|
+
}).start();
|
|
247
254
|
return true;
|
|
248
255
|
} catch (Exception error1) {
|
|
249
256
|
callbackContext.error("Result - Stone - Sumni - IniciarTransacao: " + "Error Detail: " + error1);
|
|
@@ -251,6 +258,50 @@ public class StoneSumni {
|
|
|
251
258
|
return false;
|
|
252
259
|
}
|
|
253
260
|
|
|
261
|
+
else if (action.equals("AbortarTransacao")) {
|
|
262
|
+
try {
|
|
263
|
+
new Thread(() -> {
|
|
264
|
+
try {
|
|
265
|
+
transactionProvider.abortPayment();
|
|
266
|
+
callbackContext.success("Stone - Sumni - AbortarTransacao - onSuccess");
|
|
267
|
+
} catch (Exception e) {
|
|
268
|
+
callbackContext.error("Result - Stone - Sumni - AbortarTransacao: " + "Error Detail: " + e.toString());
|
|
269
|
+
}
|
|
270
|
+
}).start();
|
|
271
|
+
return true;
|
|
272
|
+
} catch (Exception error1) {
|
|
273
|
+
callbackContext.error("Result - Stone - Sumni - AbortarTransacao: " + "Error Detail: " + error1);
|
|
274
|
+
}
|
|
275
|
+
return false;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
else if (action.equals("ReverterTransacaoComErro")) {
|
|
279
|
+
try {
|
|
280
|
+
|
|
281
|
+
ReversalProvider reversalProvider = new ReversalProvider(this.mContext);
|
|
282
|
+
reversalProvider.setDialogMessage("Cancelando transação com erro");
|
|
283
|
+
reversalProvider.isDefaultUI();
|
|
284
|
+
reversalProvider.setConnectionCallback(new StoneCallbackInterface() {
|
|
285
|
+
@Override
|
|
286
|
+
public void onSuccess() {
|
|
287
|
+
callbackContext.success("Result - Stone - Sumni - ReverterTransacaoComErro: OK");
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
@Override
|
|
291
|
+
public void onError() {
|
|
292
|
+
callbackContext.success("Result - Stone - Sumni - ReverterTransacaoComErro: Error");
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
new Thread(() -> {
|
|
296
|
+
reversalProvider.execute();
|
|
297
|
+
}).start();
|
|
298
|
+
return true;
|
|
299
|
+
} catch (Exception error1) {
|
|
300
|
+
callbackContext.error("Result - Stone - Sumni - ReverterTransacaoComErro: " + "Error Detail: " + error1);
|
|
301
|
+
}
|
|
302
|
+
return false;
|
|
303
|
+
}
|
|
304
|
+
|
|
254
305
|
else if (action.equals("ImprimirComprovanteTransacao")) {
|
|
255
306
|
JSONObject params = args.getJSONObject(0);
|
|
256
307
|
try {
|
|
@@ -637,22 +688,9 @@ public class StoneSumni {
|
|
|
637
688
|
AsyncTask<Void, Void, Bitmap> taskBitMap = new AsyncTask<Void, Void, Bitmap>() {
|
|
638
689
|
@Override
|
|
639
690
|
protected Bitmap doInBackground(Void... voids) {
|
|
640
|
-
|
|
641
|
-
//
|
|
642
|
-
// @Override
|
|
643
|
-
// public void configureWebView(WebView webview) {
|
|
644
|
-
// webview.setBackgroundColor(Color.MAGENTA);
|
|
645
|
-
// webview.getSettings().setTextZoom(150);
|
|
646
|
-
// }
|
|
647
|
-
// };
|
|
648
|
-
//Html2Bitmap build = new Html2Bitmap.Builder().setContext(mContext).setContent(WebViewContent.html(htmlString)).setBitmapWidth(380).setMeasureDelay(10).setScreenshotDelay(10).setStrictMode(true).setTimeout(5).setTextZoom(150).setConfigurator(html2BitmapConfigurator).build();
|
|
649
|
-
Html2Bitmap build = new Html2Bitmap.Builder().setContext(mContext).setContent(WebViewContent.html(htmlString)).setBitmapWidth(380).setMeasureDelay(300).setScreenshotDelay(300).setStrictMode(true).setTimeout(15).setTextZoom(100).build();
|
|
691
|
+
Html2Bitmap build = new Html2Bitmap.Builder().setContext(mContext).setContent(WebViewContent.html(htmlString)).setBitmapWidth(380).setMeasureDelay(300).setScreenshotDelay(300).setStrictMode(true).setTimeout(15).setTextZoom(96).build();
|
|
650
692
|
Bitmap bitmapResult = build.getBitmap();
|
|
651
693
|
return bitmapResult;
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
// Bitmap bitmapResult = new Html2Bitmap.Builder().setContext(mContext).setContent(WebViewContent.html(htmlString)).build().getBitmap();
|
|
655
|
-
// return bitmapResult;
|
|
656
694
|
}
|
|
657
695
|
|
|
658
696
|
@Override
|
|
@@ -738,10 +776,10 @@ public class StoneSumni {
|
|
|
738
776
|
"\n" +
|
|
739
777
|
"\n" +
|
|
740
778
|
" .printer-ticket {\n" +
|
|
779
|
+
" /*border: solid 1px black;*/\n" +
|
|
741
780
|
" /* background-color: #ffffcc; */\n" +
|
|
742
781
|
" background-color: white;\n" +
|
|
743
782
|
" font-size: 16px;\n" +
|
|
744
|
-
|
|
745
783
|
" /* padding: 10px; */\n" +
|
|
746
784
|
" max-width: 380px;\n" +
|
|
747
785
|
" /* border: solid 1px black; */\n" +
|
|
@@ -763,6 +801,8 @@ public class StoneSumni {
|
|
|
763
801
|
" }\n" +
|
|
764
802
|
"\n" +
|
|
765
803
|
" .printer-ticket * {\n" +
|
|
804
|
+
" /*border-left: 1px solid black;*/\n" +
|
|
805
|
+
" /*border-right: 1px solid black;*/\n" +
|
|
766
806
|
" font-family: monospace;\n" +
|
|
767
807
|
" /* font-family: Consolas, Regular;*/\n" +
|
|
768
808
|
" /* font-size: 100%; */\n" +
|
|
@@ -859,7 +899,7 @@ public class StoneSumni {
|
|
|
859
899
|
" body {\n" +
|
|
860
900
|
" margin: 0px;\n" +
|
|
861
901
|
" width: 380px;\n" +
|
|
862
|
-
" border: 1px solid black
|
|
902
|
+
" /*border: 1px solid black;*/\n" +
|
|
863
903
|
" }\n" +
|
|
864
904
|
"\n" +
|
|
865
905
|
"\n" +
|
|
@@ -887,7 +927,7 @@ public class StoneSumni {
|
|
|
887
927
|
"\n" +
|
|
888
928
|
" }\n" +
|
|
889
929
|
"\n" +
|
|
890
|
-
|
|
930
|
+
" .printer-ticket * {\n" +
|
|
891
931
|
" font-family: monospace;\n" +
|
|
892
932
|
" /* font-size: 100%; */\n" +
|
|
893
933
|
" color: black;\n" +
|
package/src/build.gradle
CHANGED
|
@@ -22,6 +22,10 @@ dependencies {
|
|
|
22
22
|
implementation(name: 'InterfaceAutomacao-v2.0.0.9', ext: 'aar')
|
|
23
23
|
implementation(name: 'cloudpossdk-s-1.0.2', ext: 'aar')
|
|
24
24
|
implementation(name: 'minipdvm8', ext: 'aar')
|
|
25
|
+
// implementation(name: 'barcodescanner-release-2.1.5', ext: 'aar') {
|
|
26
|
+
// exclude group: 'com.google.zxing', module: 'android-core'
|
|
27
|
+
// transitive = false
|
|
28
|
+
// }
|
|
25
29
|
|
|
26
30
|
|
|
27
31
|
//UseRede
|
|
@@ -55,4 +59,7 @@ dependencies {
|
|
|
55
59
|
implementation "br.com.stone:stone-sdk-posandroid-sunmi:4.0.6"
|
|
56
60
|
|
|
57
61
|
implementation 'com.izettle:html2bitmap:1.9'
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
// implementation 'cordova-plugin-screen-orientation:3.0.2'
|
|
58
65
|
}
|
|
Binary file
|
package/www/Cielo/LioLocal.js
CHANGED
|
@@ -164,7 +164,7 @@ function ImpressaoTextoNetPrintHelper(textoImpresso, success, onError) {
|
|
|
164
164
|
case "drawer":
|
|
165
165
|
break;
|
|
166
166
|
case "qrcode":
|
|
167
|
-
ImpressaoTextoNetPrintHelper_PrintQrCode(linha, 1,
|
|
167
|
+
ImpressaoTextoNetPrintHelper_PrintQrCode(linha, 1, 400);
|
|
168
168
|
ImpressaoTextoNetPrintHelper_PrintSimpleText("\n", 0, 18, 8);
|
|
169
169
|
break;
|
|
170
170
|
case "barcode128":
|
package/www/Stone/Sumni.js
CHANGED
|
@@ -18,6 +18,14 @@ exports.IniciarTransacao = function (params, success, error) {
|
|
|
18
18
|
exec(success, error, 'NetControllCordovaPluginsIntegration', 'Stone.Sumni.IniciarTransacao', [params]);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
exports.AbortarTransacao = function (params, success, error) {
|
|
22
|
+
exec(success, error, 'NetControllCordovaPluginsIntegration', 'Stone.Sumni.AbortarTransacao', [params]);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
exports.ReverterTransacaoComErro = function (success, error) {
|
|
26
|
+
exec(success, error, 'NetControllCordovaPluginsIntegration', 'Stone.Sumni.ReverterTransacaoComErro');
|
|
27
|
+
}
|
|
28
|
+
|
|
21
29
|
exports.ImprimirComprovanteTransacao = function (params, success, error) {
|
|
22
30
|
exec(success, error, 'NetControllCordovaPluginsIntegration', 'Stone.Sumni.ImprimirComprovanteTransacao', [params]);
|
|
23
31
|
}
|