cordova-plugin-netcontroll-integration 1.0.59 → 1.0.63

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.9
1
+ Versao 1.0.62
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.59",
3
+ "version": "1.0.63",
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.59"
2
+ <plugin id="cordova-plugin-netcontroll-integration" version="1.0.63"
3
3
  xmlns="http://apache.org/cordova/ns/plugins/1.0"
4
4
  xmlns:android="http://schemas.android.com/apk/res/android">
5
5
 
@@ -27,6 +27,10 @@
27
27
  <clobbers target="cordova.plugins.NetControllCordovaPluginsIntegration.StoneSumni" />
28
28
  </js-module>
29
29
 
30
+ <js-module name="RedeGPos700" src="www/Rede/RedeGpos700.js">
31
+ <clobbers target="cordova.plugins.NetControllCordovaPluginsIntegration.RedeGPos700" />
32
+ </js-module>
33
+
30
34
  <js-module src="www/alice.js" name="alice">
31
35
  <clobbers target="cordova.plugins.NetControllCordovaPluginsIntegration.alice" />
32
36
  <!-- <runs/> -->
@@ -57,6 +61,7 @@
57
61
  <source-file src="src/android/Elgin/ElginSmartPay.java" target-dir="src/cordova-plugin-m8/cordova-plugin-m8" />
58
62
  <source-file src="src/android/Cielo/CieloLioLocal.java" target-dir="src/cordova-plugin-m8/cordova-plugin-m8" />
59
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" />
60
65
  <!-- <source-file src="src/android/NetControllCordovaPluginsIntegration.java" target-dir="src/cordova/plugin/netcontroll/integration/NetControllCordovaPluginsIntegration" />
61
66
  <source-file src="src/android/Elgin/ElginM10Terminal.java" target-dir="src/cordova-plugin-m8/cordova-plugin-m8" /> -->
62
67
 
@@ -70,6 +75,14 @@
70
75
  <resource-file src="src/libs/cloudpossdk-s-1.0.2.aar" target="libs/cloudpossdk-s-1.0.2.aar" />
71
76
  <resource-file src="src/libs/InterfaceAutomacao-v2.0.0.9.aar" target="libs/InterfaceAutomacao-v2.0.0.9.aar" />
72
77
 
78
+ <!-- UseRede -->
79
+ <resource-file src="src/libs/sdk_3.0_release.aar" target="libs/sdk_3.0_release.aar" />
80
+ <resource-file src="src/libs/payment-1.14.10.181016.aar" target="libs/payment-1.14.10.181016.aar" />
81
+ <!-- <resource-file src="src/libs/libgedi-0.190121.gpos800.aar" target="libs/libgedi-0.190121.gpos800.aar" /> -->
82
+
83
+ <resource-file src="src/libs/Development_GertecDeveloper_CustomerAPP.jks" target="libs/Development_GertecDeveloper_CustomerAPP.jks" />
84
+ <resource-file src="src/libs/Development_GertecDeveloper_EnhancedAPP.jks" target="libs/Development_GertecDeveloper_EnhancedAPP.jks" />
85
+
73
86
  <!--
74
87
  <source-file src="src/android/NetControllCordovaPluginsIntegration.java" target-dir="src/cordova/plugin/netcontroll/integration/NetControllCordovaPluginsIntegration" />
75
88
  -->
@@ -344,12 +344,12 @@ public class ElginSmartPay {
344
344
  };
345
345
 
346
346
  switch (tipoTransacao) {
347
- case 0:
348
- pagamento.iniciaVendaDebito(valor, mActivity, handler);
349
- break;
350
347
  case 1:
351
348
  pagamento.iniciaVendaCredito(valor, tipoFinanciamento, numeroParcelas, mActivity, handler);
352
349
  break;
350
+ case 2:
351
+ pagamento.iniciaVendaDebito(valor, mActivity, handler);
352
+ break;
353
353
  default:
354
354
  throw new IllegalStateException("Unexpected value: " + tipoTransacao);
355
355
  }
@@ -392,9 +392,18 @@ public class ElginSmartPay {
392
392
  throw new IllegalStateException("Unexpected value: " + tipoImpressao);
393
393
  }
394
394
 
395
- pagamento.iniciaCancelamentoVenda(valorTransacao,nsuTransacao, dataTransacao, mActivity, handler);
396
395
 
397
- callbackContext.success("IniciarCancelamentoVenda");
396
+ //USADO PARA ENVIAR E PROCESSAR MENSAGENS
397
+ handler = new Handler(Looper.getMainLooper()) {
398
+ @Override
399
+ public void handleMessage(@NonNull Message msg) {
400
+ //super.handleMessage(msg);
401
+ String saida = (String) msg.obj;
402
+ callbackContext.success(saida);
403
+ }
404
+ };
405
+ pagamento.iniciaCancelamentoVenda(valorTransacao,nsuTransacao, dataTransacao, mActivity, handler);
406
+ //callbackContext.success("IniciarCancelamentoVenda");
398
407
  } catch (Exception e) {
399
408
  callbackContext.error("IniciarCancelamentoVenda error: " + e.toString());
400
409
  }
@@ -12,6 +12,8 @@ import org.json.JSONObject;
12
12
  import android.app.Activity;
13
13
  import android.graphics.Bitmap;
14
14
  import android.content.Context;
15
+ import android.os.AsyncTask;
16
+ import android.util.Base64;
15
17
  import android.util.Log;
16
18
  import android.widget.Toast;
17
19
  import android.net.Uri;
@@ -20,6 +22,10 @@ import android.provider.MediaStore;
20
22
 
21
23
  import static android.app.Activity.RESULT_OK;
22
24
 
25
+ import com.izettle.html2bitmap.Html2Bitmap;
26
+ import com.izettle.html2bitmap.content.WebViewContent;
27
+
28
+ import java.io.ByteArrayOutputStream;
23
29
  import java.util.HashMap;
24
30
  import java.util.Map;
25
31
 
@@ -39,9 +45,22 @@ public class NetControllCordovaPluginsIntegration extends CordovaPlugin {
39
45
  //Stone
40
46
  public StoneSumni stoneSumni;
41
47
 
48
+ //Rede
49
+ public RedeGPos700 redeGPos700;
50
+
51
+ //Cordova/Java Params
52
+ private Activity mActivity;
53
+ private Context mContext;
54
+ private CordovaWebView webView;
55
+
42
56
  @Override
43
57
  public void initialize(CordovaInterface cordova, CordovaWebView webView) {
44
58
  super.initialize(cordova, webView);
59
+
60
+ this.webView = webView;
61
+ mActivity = cordova.getActivity();
62
+ mContext = cordova.getActivity().getApplicationContext();
63
+
45
64
  }
46
65
 
47
66
  private void initializeElginM10Terminal() {
@@ -72,6 +91,13 @@ public class NetControllCordovaPluginsIntegration extends CordovaPlugin {
72
91
  }
73
92
  }
74
93
 
94
+ private void initializeRedeGpos700() {
95
+ if (this.redeGPos700 == null) {
96
+ this.redeGPos700 = new RedeGPos700();
97
+ this.redeGPos700.initialize(this.cordova, this.webView);
98
+ }
99
+ }
100
+
75
101
  @Override
76
102
  public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
77
103
  try {
@@ -79,7 +105,25 @@ public class NetControllCordovaPluginsIntegration extends CordovaPlugin {
79
105
  String[] actionProviderList = action.split("\\.");
80
106
  String provider = actionProviderList[0];
81
107
 
108
+ // if (action.equals("GerarImagemImpresso")) {
109
+ // JSONObject params = args.getJSONObject(0);
110
+ // String htmlString = params.getString("dados");
111
+
112
+
113
+ // //String html = "<html><body><p>Hello world!</p><br/>Html bitmap</body><html>";
114
+
115
+
116
+ // //callbackContext.success("Result GerarImagemImpresso");
117
+ // return true;
118
+ // }
119
+
120
+
82
121
  switch (provider.toLowerCase()) {
122
+ case "helpers":
123
+ String helpersAction = actionProviderList[1];
124
+ boolean resultHelperExecute = this.myExecute(helpersAction, args, callbackContext);
125
+ return resultHelperExecute;
126
+
83
127
  case "elgin":
84
128
  String elginProduct = actionProviderList[1];
85
129
  switch (elginProduct.toLowerCase()) {
@@ -118,6 +162,17 @@ public class NetControllCordovaPluginsIntegration extends CordovaPlugin {
118
162
  default:
119
163
  break;
120
164
  }
165
+ case "rede":
166
+ String redeProduct = actionProviderList[1];
167
+ switch (redeProduct.toLowerCase()) {
168
+ case "gpos700":
169
+ this.initializeRedeGpos700();
170
+ String redeGPos700Action = actionProviderList[2];
171
+ boolean resultRedeGpos700Execute = this.redeGPos700.execute(redeGPos700Action, args, callbackContext);
172
+ return resultRedeGpos700Execute;
173
+ default:
174
+ break;
175
+ }
121
176
  default:
122
177
  break;
123
178
  }
@@ -128,4 +183,56 @@ public class NetControllCordovaPluginsIntegration extends CordovaPlugin {
128
183
  }
129
184
  return false;
130
185
  }
186
+
187
+ public boolean myExecute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
188
+ if (action.equals("ConverterHtmlToBitmap")) {
189
+ JSONObject params = args.getJSONObject(0);
190
+ try {
191
+ String htmlString = params.getString("htmlStr");
192
+ new AsyncTask<Void, Void, Bitmap>() {
193
+ @Override
194
+ protected Bitmap doInBackground(Void... voids) {
195
+ Bitmap bitmapResult = new Html2Bitmap.Builder().setContext(mContext).setContent(WebViewContent.html(htmlString)).build().getBitmap();
196
+ return bitmapResult;
197
+ }
198
+
199
+ @Override
200
+ protected void onPostExecute(Bitmap bitmap) {
201
+ // if (bitmap != null) {
202
+
203
+ // ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
204
+ // //bitmap.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream);
205
+ // bitmap.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream);
206
+
207
+ // byte[] byteArray = byteArrayOutputStream .toByteArray();
208
+ // String encoded = Base64.encodeToString(byteArray, Base64.DEFAULT);
209
+
210
+ // callbackContext.success(encoded);
211
+ // //imageView.setImageBitmap(bitmap);
212
+ // }
213
+
214
+ if (bitmap != null) {
215
+
216
+
217
+
218
+
219
+
220
+ }
221
+ }
222
+ }.execute();
223
+ return true;
224
+ } catch (Exception error1) {
225
+ callbackContext.error("Result - ConverterHtmlToBitmap: " + "Error Detail: " + error1);
226
+ }
227
+ return false;
228
+ }
229
+ return false;
230
+ }
231
+
232
+
233
+ // public static Bitmap ParseHtmlToBitmap(string htmlString) {
234
+
235
+ // }
236
+
237
+
131
238
  }