diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-08-16 16:17:40 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-08-16 16:17:40 +0200 |
commit | 33b19347ec672a7940add522e8344a2d97ba4211 (patch) | |
tree | 7686e5ba25f49957ce5e3d680c4f104a9753b01b /contrib | |
parent | 19bc7db44155ed9ed930586bde5f2319a8a6e673 (diff) | |
download | merchant-33b19347ec672a7940add522e8344a2d97ba4211.tar.gz merchant-33b19347ec672a7940add522e8344a2d97ba4211.tar.bz2 merchant-33b19347ec672a7940add522e8344a2d97ba4211.zip |
adapt to new API
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/request_payment.en.must | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/request_payment.en.must b/contrib/request_payment.en.must index 048f6de2..560714c0 100644 --- a/contrib/request_payment.en.must +++ b/contrib/request_payment.en.must @@ -98,17 +98,17 @@ body { if (req.readyState === XMLHttpRequest.DONE) { if (req.status === 200) { try { - let resp = JSON.parse(req.responseText); - if (resp.paid) { - document.location.reload(true); - } + document.location.reload(true); } catch (e) { console.error("could not parse response:", e); } } - if (req.status === 302) { + if (req.status === 202) { try { - document.location.reload(true); + let resp = JSON.parse(req.responseText); + if (resp.fulfillment_url) { + window.location = resp.fulfillment_url; + } } catch (e) { console.error("could not parse response:", e); } |