Commit 1b85d4b8 authored by Nastuzzi Samy's avatar Nastuzzi Samy
Browse files

Merge branch 'release/v0.11.8'

parents 233f68fb 933b8dcf
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="fr.utc.simde.jessy"
android:versionCode="40"
android:versionName="0.11.7">
android:versionCode="41"
android:versionName="0.11.8">
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.INTERNET" />
......
......@@ -135,90 +135,110 @@ public class BuyerInfoActivity extends BaseActivity {
.setCancelable(true)
.setPositiveButton(R.string.cancel, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialogInterface, int id) {
new Thread() {
hasRights(getString(R.string.cancel_transaction), new String[]{
"GESSALES"
}, new Runnable() {
@Override
public void run() {
try {
hasRights(getString(R.string.configurate), new String[]{
"GESSALES"
}, new Runnable() {
@Override
public void run() {
new Thread() {
@Override
public void run() {
try {
nemopaySession.cancelTransaction(article.get("fundation_id").intValue(), article.get("purchase_id").intValue(), true);
Thread.sleep(100);
} catch (final Exception e) {
Log.e(LOG_TAG, "error: " + e.getMessage());
try {
nemopaySession.cancelTransaction(article.get("fundation_id").intValue(), article.get("purchase_id").intValue(), true);
} catch (Exception e) {
Log.e(LOG_TAG, "error: " + e.getMessage());
final JsonNode response = nemopaySession.getRequest().getJSONResponse();
if (response.has("error") && response.get("error").has("message")) {
runOnUiThread(new Runnable() {
@Override
public void run() {
dialog.stopLoading();
dialog.errorDialog(BuyerInfoActivity.this, getString(R.string.cancel_transaction), response.get("error").get("message").textValue());
}
});
} else
throw new Exception("");
} catch (Exception e1) {
runOnUiThread(new Runnable() {
@Override
public void run() {
dialog.stopLoading();
dialog.errorDialog(BuyerInfoActivity.this, getString(R.string.cancel_transaction), e.getMessage());
}
});
}
}
}, new Runnable() {
@Override
public void run() {
}
}.start();
}
}, new Runnable() {
@Override
public void run() {
new Thread() {
@Override
public void run() {
try {
nemopaySession.cancelTransaction(article.get("fundation_id").intValue(), article.get("purchase_id").intValue(), false);
Thread.sleep(100);
} catch (final Exception e) {
Log.e(LOG_TAG, "error: " + e.getMessage());
try {
nemopaySession.cancelTransaction(article.get("fundation_id").intValue(), article.get("purchase_id").intValue(), false);
} catch (Exception e) {
Log.e(LOG_TAG, "error: " + e.getMessage());
}
}
});
Thread.sleep(100);
runOnUiThread(new Runnable() {
@Override
public void run() {
dialog.stopLoading();
final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(BuyerInfoActivity.this);
alertDialogBuilder
.setTitle(R.string.cancel_transaction)
.setMessage(getString(R.string.transaction_canceled))
.setCancelable(true)
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialogInterface, int id) {
try {
startBuyerInfoActivity(BuyerInfoActivity.this, badgeId);
} catch (Exception e) {
Log.e(LOG_TAG, "error: " + e.getMessage());
dialog.errorDialog(BuyerInfoActivity.this, getResources().getString(R.string.information_collection), getResources().getString(R.string.error_view), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int id) {
finish();
}
});
}
final JsonNode response = nemopaySession.getRequest().getJSONResponse();
if (response.has("error") && response.get("error").has("message")) {
runOnUiThread(new Runnable() {
@Override
public void run() {
dialog.stopLoading();
dialog.errorDialog(BuyerInfoActivity.this, getString(R.string.cancel_transaction), response.get("error").get("message").textValue());
}
});
dialog.createDialog(alertDialogBuilder);
} else
throw new Exception("");
} catch (Exception e1) {
runOnUiThread(new Runnable() {
@Override
public void run() {
dialog.stopLoading();
dialog.errorDialog(BuyerInfoActivity.this, getString(R.string.cancel_transaction), e.getMessage());
}
});
}
}
});
} catch (final Exception e) {
Log.e(LOG_TAG, "error: " + e.getMessage());
try {
final JsonNode response = nemopaySession.getRequest().getJSONResponse();
if (response.has("error") && response.get("error").has("message")) {
runOnUiThread(new Runnable() {
}
}.start();
}
});
dialog.stopLoading();
final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(BuyerInfoActivity.this);
alertDialogBuilder
.setTitle(R.string.cancel_transaction)
.setMessage(getString(R.string.transaction_canceled))
.setCancelable(true)
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialogInterface, int id) {
try {
startBuyerInfoActivity(BuyerInfoActivity.this, badgeId);
} catch (Exception e) {
Log.e(LOG_TAG, "error: " + e.getMessage());
dialog.errorDialog(BuyerInfoActivity.this, getResources().getString(R.string.information_collection), getResources().getString(R.string.error_view), new DialogInterface.OnClickListener() {
@Override
public void run() {
dialog.stopLoading();
dialog.errorDialog(BuyerInfoActivity.this, getString(R.string.cancel_transaction), response.get("error").get("message").textValue());
public void onClick(DialogInterface dialogInterface, int id) {
finish();
}
});
} else
throw new Exception("");
} catch (Exception e1) {
runOnUiThread(new Runnable() {
@Override
public void run() {
dialog.stopLoading();
dialog.errorDialog(BuyerInfoActivity.this, getString(R.string.cancel_transaction), e.getMessage());
}
});
}
}
}
}
}.start();
});
dialog.createDialog(alertDialogBuilder);
}
})
.setNegativeButton(R.string.do_nothing, null);
......
......@@ -223,27 +223,27 @@ public class NemopaySession {
if (hasSalesRights)
return request(
"POSS3",
"cancel",
"GESSALES",
"cancelTransactionRow",
new HashMap<String, Object>() {{
put("fun_id", foundationId);
put("pur_id", purchaseId);
put("id", purchaseId);
}},
new String[]{
"POSS3"
"POSS3",
"GESSALES"
}
);
else
return request(
"GESSALES",
"cancelTransactionRow",
"POSS3",
"cancel",
new HashMap<String, Object>() {{
put("fun_id", foundationId);
put("pur_id", purchaseId);
}},
new String[]{
"POSS3",
"GESSALES"
"POSS3"
}
);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment