diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/shopApi.ts | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/shopApi.ts b/lib/shopApi.ts index 7cc37a9db..bd0993068 100644 --- a/lib/shopApi.ts +++ b/lib/shopApi.ts @@ -22,7 +22,9 @@ * @author Florian Dold */ +"use strict"; +declare var cloneInto: any; function subst(url: string, H_contract: string) { url = url.replace("${H_contract}", H_contract); @@ -122,13 +124,17 @@ export function fetchPayment(H_contract: any, offering_url: any) { // 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", { + let opts = { detail: { H_contract: H_contract, contract: resp.contract, payment: resp.payReq, } - }); + }; + if ("function" == typeof cloneInto) { + opts = cloneInto(opts, document.defaultView); + } + let evt = new CustomEvent("taler-notify-payment", opts); document.dispatchEvent(evt); }); } @@ -166,4 +172,4 @@ function offerContractFrom(url: string) { + contract_request.statusText); }; contract_request.send(); -}
\ No newline at end of file +} |