aboutsummaryrefslogtreecommitdiff
path: root/content_scripts
diff options
context:
space:
mode:
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,