Skip to content

Commit

Permalink
[dev] correcao nas classes
Browse files Browse the repository at this point in the history
  • Loading branch information
williaanlopes committed Oct 22, 2020
1 parent a9b801f commit 533c03b
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ private void connectPinPad(JSONArray jsonArray, CallbackContext callbackContext)
pinPadObject.put("macAddress", pinPad.getAddress());
jsonObject.put("pinPad", pinPadObject);

PluginResult pluginResult = PluginResultHelper.makePluginResult(PluginResult.Status.OK, jsonObject);
PluginResult pluginResult = ResultHelper.makePluginResult(PluginResult.Status.OK, jsonObject);
pluginResult.setKeepCallback(false);
connectPinPadCallback.sendPluginResult(pluginResult);
openConnection(jsonArray, callbackContext);
Expand Down Expand Up @@ -405,7 +405,7 @@ public void receiveInitialization() {
jsonObject.put("code", Constants.INITIALIZED_SUCCESSFULLY);
jsonObject.put("message", "initialized");

PluginResult pluginResult = PluginResultHelper.makePluginResult(PluginResult.Status.OK, jsonObject);
PluginResult pluginResult = ResultHelper.makePluginResult(PluginResult.Status.OK, jsonObject);
pluginResult.setKeepCallback(false);
openConnectionCallback.sendPluginResult(pluginResult);

Expand All @@ -432,7 +432,7 @@ public void receiveNotification(String notification) {
jsonObject.put("code", Constants.PIN_PAD_CANCELED);
jsonObject.put("message", "pin pad by canceled");

PluginResult pluginResult = PluginResultHelper.makePluginResult(PluginResult.Status.OK, jsonObject);
PluginResult pluginResult = ResultHelper.makePluginResult(PluginResult.Status.OK, jsonObject);
pluginResult.setKeepCallback(false);
callbackContext.error(jsonObject);
} catch (JSONException e) {
Expand All @@ -447,7 +447,7 @@ public void receiveOperationCompleted() {
jsonObject.put("code", 20);
jsonObject.put("message", "done");

PluginResult pluginResult = PluginResultHelper.makePluginResult(PluginResult.Status.OK, jsonObject);
PluginResult pluginResult = ResultHelper.makePluginResult(PluginResult.Status.OK, jsonObject);
pluginResult.setKeepCallback(false);
callbackContext.sendPluginResult(pluginResult);
} catch (JSONException e) {
Expand All @@ -465,7 +465,7 @@ public void receiveTableUpdated(boolean loaded) {
jsonObject.put("message", "received table updated");
jsonObject.put("loaded", loaded);

PluginResult pluginResult = PluginResultHelper.makePluginResult(PluginResult.Status.OK, jsonObject);
PluginResult pluginResult = ResultHelper.makePluginResult(PluginResult.Status.OK, jsonObject);
pluginResult.setKeepCallback(false);
downloadTablesCallback.sendPluginResult(pluginResult);
} catch (JSONException e) {
Expand All @@ -484,7 +484,7 @@ public void receiveFinishTransaction() {
jsonObject.put("code", 20);
jsonObject.put("message", "transaction approved");

PluginResult pluginResult = PluginResultHelper.makePluginResult(PluginResult.Status.OK, jsonObject);
PluginResult pluginResult = ResultHelper.makePluginResult(PluginResult.Status.OK, jsonObject);
pluginResult.setKeepCallback(false);
payCallback.sendPluginResult(pluginResult);
} catch (JSONException e) {
Expand All @@ -501,7 +501,7 @@ public void receiveClose() {
jsonObject.put("code", 20);
jsonObject.put("message", "close connection");

PluginResult pluginResult = PluginResultHelper.makePluginResult(PluginResult.Status.OK, jsonObject);
PluginResult pluginResult = ResultHelper.makePluginResult(PluginResult.Status.OK, jsonObject);
pluginResult.setKeepCallback(false);
callbackContext.sendPluginResult(pluginResult);
} catch (JSONException e) {
Expand All @@ -525,7 +525,7 @@ public void receiveCardHash(String cardHash, MposPaymentResult result) {
jsonObject.put("message", "delegate remote api");
jsonObject.put("data", charge.toJson());

PluginResult pluginResult = PluginResultHelper.makePluginResult(PluginResult.Status.OK, jsonObject);
PluginResult pluginResult = ResultHelper.makePluginResult(PluginResult.Status.OK, jsonObject);
pluginResult.setKeepCallback(false);
callbackContext.sendPluginResult(pluginResult);
} catch (JSONException e) {
Expand Down Expand Up @@ -701,7 +701,7 @@ private void pay(JSONArray jsonArray, CallbackContext callbackContext) throws JS
jsonObject.put("code", Constants.PAYMENT_ERROR_PARAMETERS);
jsonObject.put("message", "wrong parameters");

PluginResult pluginResult = PluginResultHelper.makePluginResult(PluginResult.Status.OK, jsonObject);
PluginResult pluginResult = ResultHelper.makePluginResult(PluginResult.Status.OK, jsonObject);
pluginResult.setKeepCallback(false);
payCallback.error(jsonObject);
} catch (JSONException ex) {
Expand All @@ -721,7 +721,7 @@ private void pay(JSONArray jsonArray, CallbackContext callbackContext) throws JS
jsonObject.put("code", Constants.PAYMENT_ERROR_PARAMETERS);
jsonObject.put("message", "wrong parameters");

PluginResult pluginResult = PluginResultHelper.makePluginResult(PluginResult.Status.OK, jsonObject);
PluginResult pluginResult = ResultHelper.makePluginResult(PluginResult.Status.OK, jsonObject);
pluginResult.setKeepCallback(false);
payCallback.error(jsonObject);
} catch (JSONException ex) {
Expand Down Expand Up @@ -811,7 +811,7 @@ private void close(String message) {

private void callRemoteServer(Charge charg) {

AndroidNetworking.post(configParameter.getRemoteApi())
/*AndroidNetworking.post(configParameter.getRemoteApi())
.addHeaders("X-Api-Key", charge.getApiKey())
.addHeaders("Authorization", charge.getToken())
.addJSONObjectBody(charge.toJson())
Expand Down Expand Up @@ -877,7 +877,7 @@ public void onError(ANError error) {
} catch (JSONException e) {
}
}
});
});*?
}
public PluginResult makePluginResult(PluginResult.Status status, Object... args) {
Expand Down

0 comments on commit 533c03b

Please sign in to comment.