Skip to content

Commit

Permalink
Merge pull request #10 from Gamboster/feat/handleSimplexSell
Browse files Browse the repository at this point in the history
Feat: handle returnUrl from SimplexSell
  • Loading branch information
cmgustavo authored Nov 19, 2024
2 parents 4c508e1 + ccd4fa5 commit ca1450c
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions simplex/end.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,21 @@ <h3 id="success"></h3>
}

function setParams() {
var success = querySt("success");
document.getElementById('success').innerHTML = success == 'true' ? 'Success!' : 'Operation failed';
var returnApp = querySt("returnApp") ?? 'bitpay';
var flow = querySt("flow");

var paymentId = querySt("paymentId");
var quoteId = querySt("quoteId");
var userId = querySt("userId");
var returnApp = querySt("returnApp");
if (flow === 'sell') {
url = returnApp + '://simplex' + window.location.search;
} else {
var success = querySt("success");
document.getElementById('success').innerHTML = success == 'true' ? 'Success!' : 'Operation failed';

url = returnApp + '://simplex?success=' + success + '&paymentId=' + paymentId + '&quoteId=' + quoteId + '&userId=' + userId;
var paymentId = querySt("paymentId");
var quoteId = querySt("quoteId");
var userId = querySt("userId");

url = returnApp + '://simplex?success=' + success + '&paymentId=' + paymentId + '&quoteId=' + quoteId + '&userId=' + userId;
}
}

function redir() {
Expand Down

0 comments on commit ca1450c

Please sign in to comment.