Skip to content

Commit

Permalink
#425 Show failReason for FAILED status.
Browse files Browse the repository at this point in the history
  • Loading branch information
criske committed Apr 24, 2021
1 parent fbc4140 commit e2be15c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/main/resources/public/js/getContributor.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,10 @@ function invoiceAsTableRow(contract) {
status = "Active";
} else {
var timestamp = latestPayment.timestamp;
var failMessage = "Something went wrong, please try again.";
var status = latestPayment.status;
var failMessage = (status === "FAILED")
? latestPayment.failReason.replaceAll('"', '\'')
: "Something went wrong, please try again.";
if(timestamp.length > 0) {
timestamp = timestamp.split('T')[0];
failMessage = timestamp + ": " + failMessage;
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/public/js/wallets.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,10 @@ function payInvoice(invoice, contract, payButton) {
function (index, row) {
if ($(row).find("td:eq(0)").text() == json.paid) {
var timestamp = json.payment.timestamp;
var failMessage = "Something went wrong, please try again.";
var status = json.payment.status;
var failMessage = (status === "FAILED")
? json.payment.failReason.replaceAll('"', '\'')
: "Something went wrong, please try again.";
if(timestamp.length > 0) {
timestamp = timestamp.split('T')[0];
failMessage = timestamp + ": " + failMessage;
Expand Down

0 comments on commit e2be15c

Please sign in to comment.