aboutsummaryrefslogtreecommitdiff
path: root/content_scripts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-05-24 17:30:27 +0200
committerFlorian Dold <florian.dold@gmail.com>2016-05-24 17:30:27 +0200
commit27a42f92572abfdb2e60f3f212e4f0fcc71a6961 (patch)
treecb07ba11b01b05baccbbec0d58b231d1d8c237f7 /content_scripts
parentce7f7b8321c89f9bdd62e9b148181865f8834871 (diff)
downloadwallet-core-27a42f92572abfdb2e60f3f212e4f0fcc71a6961.tar.xz
respond to failed payments
Diffstat (limited to 'content_scripts')
-rw-r--r--content_scripts/notify.ts18
1 files changed, 17 insertions, 1 deletions
diff --git a/content_scripts/notify.ts b/content_scripts/notify.ts
index 8e70b44c4..4a65434af 100644
--- a/content_scripts/notify.ts
+++ b/content_scripts/notify.ts
@@ -165,9 +165,22 @@ namespace TalerNotify {
});
});
+ addHandler("taler-payment-failed", (e: CustomEvent) => {
+ const msg = {
+ type: "payment-failed",
+ detail: {},
+ };
+ chrome.runtime.sendMessage(msg, (resp) => {
+ let evt = new CustomEvent("taler-payment-failed-ok", {
+ detail: {}
+ });
+ document.dispatchEvent(evt);
+ });
+ });
+
// Should be: taler-request-payment, taler-result-payment
- addHandler("taler-execute-contract", function(e: CustomEvent) {
+ addHandler("taler-execute-contract", (e: CustomEvent) => {
console.log("got taler-execute-contract in content page");
const msg = {
type: "execute-payment",
@@ -195,6 +208,9 @@ namespace TalerNotify {
throw Error("contract missing");
}
+ // We have the details for then payment, the merchant page
+ // is responsible to give it to the merchant.
+
let evt = new CustomEvent("taler-notify-payment", {
detail: {
H_contract: e.detail.H_contract,