From defbf625bdef0f8a666b72b8ce99de5e01af6b91 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 29 Aug 2019 23:12:55 +0200 Subject: [PATCH] url-based pay/withdraw, use react hooks --- gulpfile.js | 1 + package.json | 6 +- src/headless/taler-wallet-cli.ts | 7 +- src/http.ts | 50 +- src/i18n.tsx | 4 +- src/i18n/de.po | 273 ++-- src/i18n/en-US.po | 273 ++-- src/i18n/fr.po | 273 ++-- src/i18n/it.po | 273 ++-- src/i18n/strings.ts | 840 ++++++------ src/i18n/sv.po | 277 ++-- src/i18n/taler-wallet-webex.pot | 273 ++-- src/wallet.ts | 143 +- src/walletTypes.ts | 78 +- src/webex/messages.ts | 68 +- src/webex/pages/confirm-contract.tsx | 417 ------ src/webex/pages/confirm-create-reserve.tsx | 526 ------- .../pages/{confirm-contract.html => pay.html} | 2 +- src/webex/pages/pay.tsx | 173 +++ ...firm-create-reserve.html => withdraw.html} | 2 +- src/webex/pages/withdraw.tsx | 231 ++++ src/webex/style/wallet.css | 5 + src/webex/wxApi.ts | 23 + src/webex/wxBackend.ts | 262 +--- tsconfig.json | 7 +- webpack.config.js | 4 +- yarn.lock | 1214 +++++++++++------ 27 files changed, 2751 insertions(+), 2954 deletions(-) delete mode 100644 src/webex/pages/confirm-contract.tsx delete mode 100644 src/webex/pages/confirm-create-reserve.tsx rename src/webex/pages/{confirm-contract.html => pay.html} (96%) create mode 100644 src/webex/pages/pay.tsx rename src/webex/pages/{confirm-create-reserve.html => withdraw.html} (88%) create mode 100644 src/webex/pages/withdraw.tsx diff --git a/gulpfile.js b/gulpfile.js index 63965e7ea..698944b29 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -104,6 +104,7 @@ const tsBaseArgs = { allowJs: true, checkJs: true, incremental: true, + esModuleInterop: true, }; diff --git a/package.json b/package.json index 6bb1caf7e..184230a7c 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "devDependencies": { "@types/react": "^16.4.0", "@types/react-dom": "^16.0.0", - "ava": "^1.4.1", + "ava": "^2.3.0", "awesome-typescript-loader": "^5.2.1", "glob": "^7.1.1", "gulp": "^4.0.0", @@ -44,10 +44,10 @@ "uglify-js": "^3.0.27", "vinyl": "^2.2.0", "vinyl-fs": "^3.0.3", - "webpack": "^4.29.6", + "webpack": "^4.39.3", "webpack-bundle-analyzer": "^3.0.2", "webpack-cli": "^3.1.0", - "webpack-merge": "^4.1.0" + "webpack-merge": "^4.2.2" }, "dependencies": { "@types/chrome": "^0.0.88", diff --git a/src/headless/taler-wallet-cli.ts b/src/headless/taler-wallet-cli.ts index 65b2a0297..659cffe67 100644 --- a/src/headless/taler-wallet-cli.ts +++ b/src/headless/taler-wallet-cli.ts @@ -149,7 +149,7 @@ program const { reservePub, confirmTransferUrl, - } = await wallet.createReserveFromWithdrawUrl( + } = await wallet.acceptWithdrawal( withdrawUrl, selectedExchange, ); @@ -191,11 +191,6 @@ program process.exit(0); return; } - if (result.status === "session-replayed") { - console.log("already paid! (replayed in different session)"); - process.exit(0); - return; - } if (result.status === "payment-possible") { console.log("paying ..."); } else { diff --git a/src/http.ts b/src/http.ts index f450d8479..8c1f772d8 100644 --- a/src/http.ts +++ b/src/http.ts @@ -27,7 +27,6 @@ export interface HttpResponse { responseJson: object & any; } - /** * The request library is bundled into an interface to make mocking easy. */ @@ -37,15 +36,16 @@ export interface HttpRequestLibrary { postJson(url: string, body: any): Promise; } - /** * An implementation of the [[HttpRequestLibrary]] using the * browser's XMLHttpRequest. */ export class BrowserHttpLib implements HttpRequestLibrary { - private req(method: string, - url: string, - options?: any): Promise { + private req( + method: string, + url: string, + options?: any, + ): Promise { return new Promise((resolve, reject) => { const myRequest = new XMLHttpRequest(); myRequest.open(method, url); @@ -54,11 +54,36 @@ export class BrowserHttpLib implements HttpRequestLibrary { } else { myRequest.send(); } - myRequest.addEventListener("readystatechange", (e) => { + + myRequest.onerror = e => { + console.error("http request error"); + reject(Error("could not make XMLHttpRequest")); + }; + + myRequest.addEventListener("readystatechange", e => { if (myRequest.readyState === XMLHttpRequest.DONE) { - const responseJson = JSON.parse(myRequest.responseText); + if (myRequest.status === 0) { + reject(Error("HTTP Request failed (status code 0, maybe URI scheme is wrong?)")) + return; + } + if (myRequest.status != 200) { + reject( + Error( + `HTTP Response with unexpected status code ${myRequest.status}: ${myRequest.statusText}`, + ), + ); + return; + } + let responseJson; + try { + responseJson = JSON.parse(myRequest.responseText); + } catch (e) { + reject(Error("Invalid JSON from HTTP response")); + return; + } if (responseJson === null || typeof responseJson !== "object") { reject(Error("Invalid JSON from HTTP response")); + return; } const resp = { responseJson: responseJson, @@ -70,27 +95,22 @@ export class BrowserHttpLib implements HttpRequestLibrary { }); } - get(url: string) { return this.req("get", url); } - postJson(url: string, body: any) { - return this.req("post", url, {req: JSON.stringify(body)}); + return this.req("post", url, { req: JSON.stringify(body) }); } - postForm(url: string, form: any) { - return this.req("post", url, {req: form}); + return this.req("post", url, { req: form }); } } - /** * Exception thrown on request errors. */ export class RequestException { - constructor(public detail: any) { - } + constructor(public detail: any) {} } diff --git a/src/i18n.tsx b/src/i18n.tsx index 29df1c5af..67df6c516 100644 --- a/src/i18n.tsx +++ b/src/i18n.tsx @@ -31,6 +31,8 @@ import * as React from "react"; const jed = setupJed(); +let enableTracing = false; + /** * Set up jed library for internationalization, @@ -94,7 +96,7 @@ function stringifyChildren(children: any): string { return `%${n++}$s`; }); const s = ss.join("").replace(/ +/g, " ").trim(); - console.log("translation lookup", JSON.stringify(s)); + enableTracing && console.log("translation lookup", JSON.stringify(s)); return s; } diff --git a/src/i18n/de.po b/src/i18n/de.po index 6bfda6706..fa55b7e9e 100644 --- a/src/i18n/de.po +++ b/src/i18n/de.po @@ -37,28 +37,28 @@ msgstr "" msgid "time (ms/op)" msgstr "" -#: src/webex/pages/confirm-contract.tsx:78 +#: src/webex/pages/pay.tsx:78 #, c-format msgid "show more details" msgstr "" -#: src/webex/pages/confirm-contract.tsx:92 +#: src/webex/pages/pay.tsx:92 #, c-format msgid "Accepted exchanges:" msgstr "" -#: src/webex/pages/confirm-contract.tsx:97 +#: src/webex/pages/pay.tsx:97 #, c-format msgid "Exchanges in the wallet:" msgstr "" -#: src/webex/pages/confirm-contract.tsx:219 +#: src/webex/pages/pay.tsx:219 #, c-format msgid "You have insufficient funds of the requested currency in your wallet." msgstr "" #. tslint:disable-next-line:max-line-length -#: src/webex/pages/confirm-contract.tsx:221 +#: src/webex/pages/pay.tsx:221 #, c-format msgid "" "You do not have any funds from an exchange that is accepted by this " @@ -66,180 +66,58 @@ msgid "" "wallet." msgstr "" -#: src/webex/pages/confirm-contract.tsx:322 +#: src/webex/pages/pay.tsx:322 #, fuzzy, c-format msgid "Confirm payment" msgstr "Bezahlung bestätigen" -#: src/webex/pages/confirm-contract.tsx:332 +#: src/webex/pages/pay.tsx:332 #, fuzzy, c-format msgid "Submitting payment" msgstr "Bezahlung bestätigen" -#: src/webex/pages/confirm-contract.tsx:343 +#: src/webex/pages/pay.tsx:343 #, c-format msgid "" "You already paid for this, clicking \"Confirm payment\" will not cost money " "again." msgstr "" -#: src/webex/pages/confirm-contract.tsx:357 +#: src/webex/pages/pay.tsx:357 #, fuzzy, c-format msgid "Aborting payment ..." msgstr "Bezahlung bestätigen" -#: src/webex/pages/confirm-contract.tsx:359 +#: src/webex/pages/pay.tsx:359 #, c-format msgid "Payment aborted!" msgstr "" -#: src/webex/pages/confirm-contract.tsx:362 +#: src/webex/pages/pay.tsx:362 #, fuzzy, c-format msgid "Retry Payment" msgstr "Bezahlung bestätigen" -#: src/webex/pages/confirm-contract.tsx:365 +#: src/webex/pages/pay.tsx:365 #, fuzzy, c-format msgid "Abort Payment" msgstr "Bezahlung bestätigen" -#: src/webex/pages/confirm-contract.tsx:374 +#: src/webex/pages/pay.tsx:374 #, fuzzy, c-format msgid "The merchant %1$s offers you to purchase:" msgstr "Der Händler %1$s möchte einen Vertrag über %2$s mit Ihnen abschließen." -#: src/webex/pages/confirm-contract.tsx:383 +#: src/webex/pages/pay.tsx:383 #, c-format msgid "The total price is %1$s (plus %2$s fees)." msgstr "" -#: src/webex/pages/confirm-contract.tsx:387 +#: src/webex/pages/pay.tsx:387 #, c-format msgid "The total price is %1$s." msgstr "" -#: src/webex/pages/confirm-create-reserve.tsx:128 -#, c-format -msgid "Select" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:145 -#, c-format -msgid "Error: URL may not be relative" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:160 -#, c-format -msgid "Invalid exchange URL (%1$s)" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:210 -#, c-format -msgid "The exchange is trusted by the wallet." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:216 -#, c-format -msgid "The exchange is audited by a trusted auditor." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:222 -#, c-format -msgid "" -"Warning: The exchange is neither directly trusted nor audited by a trusted " -"auditor. If you withdraw from this exchange, it will be trusted in the " -"future." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:231 -#, c-format -msgid "" -"Using exchange provider %1$s. The exchange provider will charge %2$s in fees." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:243 -#, c-format -msgid "Waiting for a response from %1$s %2$s" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:260 -#, c-format -msgid "" -"Information about fees will be available when an exchange provider is " -"selected." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:279 -#, c-format -msgid "" -"Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has " -"a higher, incompatible protocol version (%3$s)." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:290 -#, c-format -msgid "" -"The chosen exchange (protocol version %1$s might be outdated.%2$s The " -"exchange has a lower, incompatible protocol version than your wallet " -"(protocol version %3$s)." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:309 -#, c-format -msgid "Accept fees and withdraw" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:314 -#, c-format -msgid "Change Exchange Provider" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:335 -#, c-format -msgid "" -"Please select an exchange. You can review the details before after your " -"selection." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:341 -#: src/webex/pages/confirm-create-reserve.tsx:353 -#, c-format -msgid "Select %1$s" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:370 -#, c-format -msgid "You are about to withdraw %1$s from your bank account into your wallet." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:459 -#, c-format -msgid "" -"Oops, something went wrong. The wallet responded with error status (%1$s)." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:468 -#, c-format -msgid "Checking URL, please wait ..." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:482 -#, c-format -msgid "Can't parse amount: %1$s" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:489 -#, c-format -msgid "Can't parse wire_types: %1$s" -msgstr "" - -#. #-#-#-#-# - (PACKAGE VERSION) #-#-#-#-# -#. TODO:generic error reporting function or component. -#: src/webex/pages/confirm-create-reserve.tsx:519 src/webex/pages/tip.tsx:180 -#, c-format -msgid "Fatal error: \"%1$s\"." -msgstr "" - #: src/webex/pages/popup.tsx:165 #, c-format msgid "Balance" @@ -379,6 +257,127 @@ msgstr "Bezahlung bestätigen" msgid "Cancel" msgstr "Saldo" +#. #-#-#-#-# - (PACKAGE VERSION) #-#-#-#-# +#. TODO:generic error reporting function or component. +#: src/webex/pages/tip.tsx:180 src/webex/pages/withdraw.tsx:519 +#, c-format +msgid "Fatal error: \"%1$s\"." +msgstr "" + +#: src/webex/pages/withdraw.tsx:128 +#, c-format +msgid "Select" +msgstr "" + +#: src/webex/pages/withdraw.tsx:145 +#, c-format +msgid "Error: URL may not be relative" +msgstr "" + +#: src/webex/pages/withdraw.tsx:160 +#, c-format +msgid "Invalid exchange URL (%1$s)" +msgstr "" + +#: src/webex/pages/withdraw.tsx:210 +#, c-format +msgid "The exchange is trusted by the wallet." +msgstr "" + +#: src/webex/pages/withdraw.tsx:216 +#, c-format +msgid "The exchange is audited by a trusted auditor." +msgstr "" + +#: src/webex/pages/withdraw.tsx:222 +#, c-format +msgid "" +"Warning: The exchange is neither directly trusted nor audited by a trusted " +"auditor. If you withdraw from this exchange, it will be trusted in the " +"future." +msgstr "" + +#: src/webex/pages/withdraw.tsx:231 +#, c-format +msgid "" +"Using exchange provider %1$s. The exchange provider will charge %2$s in fees." +msgstr "" + +#: src/webex/pages/withdraw.tsx:243 +#, c-format +msgid "Waiting for a response from %1$s %2$s" +msgstr "" + +#: src/webex/pages/withdraw.tsx:260 +#, c-format +msgid "" +"Information about fees will be available when an exchange provider is " +"selected." +msgstr "" + +#: src/webex/pages/withdraw.tsx:279 +#, c-format +msgid "" +"Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has " +"a higher, incompatible protocol version (%3$s)." +msgstr "" + +#: src/webex/pages/withdraw.tsx:290 +#, c-format +msgid "" +"The chosen exchange (protocol version %1$s might be outdated.%2$s The " +"exchange has a lower, incompatible protocol version than your wallet " +"(protocol version %3$s)." +msgstr "" + +#: src/webex/pages/withdraw.tsx:309 +#, c-format +msgid "Accept fees and withdraw" +msgstr "" + +#: src/webex/pages/withdraw.tsx:314 +#, c-format +msgid "Change Exchange Provider" +msgstr "" + +#: src/webex/pages/withdraw.tsx:335 +#, c-format +msgid "" +"Please select an exchange. You can review the details before after your " +"selection." +msgstr "" + +#: src/webex/pages/withdraw.tsx:341 src/webex/pages/withdraw.tsx:353 +#, c-format +msgid "Select %1$s" +msgstr "" + +#: src/webex/pages/withdraw.tsx:370 +#, c-format +msgid "You are about to withdraw %1$s from your bank account into your wallet." +msgstr "" + +#: src/webex/pages/withdraw.tsx:459 +#, c-format +msgid "" +"Oops, something went wrong. The wallet responded with error status (%1$s)." +msgstr "" + +#: src/webex/pages/withdraw.tsx:468 +#, c-format +msgid "Checking URL, please wait ..." +msgstr "" + +#: src/webex/pages/withdraw.tsx:482 +#, c-format +msgid "Can't parse amount: %1$s" +msgstr "" + +#: src/webex/pages/withdraw.tsx:489 +#, c-format +msgid "Can't parse wire_types: %1$s" +msgstr "" + #: src/webex/renderHtml.tsx:225 #, fuzzy, c-format msgid "Withdrawal fees:" diff --git a/src/i18n/en-US.po b/src/i18n/en-US.po index 6d57e0ea2..83f25dd3e 100644 --- a/src/i18n/en-US.po +++ b/src/i18n/en-US.po @@ -37,28 +37,28 @@ msgstr "" msgid "time (ms/op)" msgstr "" -#: src/webex/pages/confirm-contract.tsx:78 +#: src/webex/pages/pay.tsx:78 #, c-format msgid "show more details" msgstr "" -#: src/webex/pages/confirm-contract.tsx:92 +#: src/webex/pages/pay.tsx:92 #, c-format msgid "Accepted exchanges:" msgstr "" -#: src/webex/pages/confirm-contract.tsx:97 +#: src/webex/pages/pay.tsx:97 #, c-format msgid "Exchanges in the wallet:" msgstr "" -#: src/webex/pages/confirm-contract.tsx:219 +#: src/webex/pages/pay.tsx:219 #, c-format msgid "You have insufficient funds of the requested currency in your wallet." msgstr "" #. tslint:disable-next-line:max-line-length -#: src/webex/pages/confirm-contract.tsx:221 +#: src/webex/pages/pay.tsx:221 #, c-format msgid "" "You do not have any funds from an exchange that is accepted by this " @@ -66,180 +66,58 @@ msgid "" "wallet." msgstr "" -#: src/webex/pages/confirm-contract.tsx:322 +#: src/webex/pages/pay.tsx:322 #, c-format msgid "Confirm payment" msgstr "" -#: src/webex/pages/confirm-contract.tsx:332 +#: src/webex/pages/pay.tsx:332 #, c-format msgid "Submitting payment" msgstr "" -#: src/webex/pages/confirm-contract.tsx:343 +#: src/webex/pages/pay.tsx:343 #, c-format msgid "" "You already paid for this, clicking \"Confirm payment\" will not cost money " "again." msgstr "" -#: src/webex/pages/confirm-contract.tsx:357 +#: src/webex/pages/pay.tsx:357 #, c-format msgid "Aborting payment ..." msgstr "" -#: src/webex/pages/confirm-contract.tsx:359 +#: src/webex/pages/pay.tsx:359 #, c-format msgid "Payment aborted!" msgstr "" -#: src/webex/pages/confirm-contract.tsx:362 +#: src/webex/pages/pay.tsx:362 #, c-format msgid "Retry Payment" msgstr "" -#: src/webex/pages/confirm-contract.tsx:365 +#: src/webex/pages/pay.tsx:365 #, c-format msgid "Abort Payment" msgstr "" -#: src/webex/pages/confirm-contract.tsx:374 +#: src/webex/pages/pay.tsx:374 #, c-format msgid "The merchant %1$s offers you to purchase:" msgstr "" -#: src/webex/pages/confirm-contract.tsx:383 +#: src/webex/pages/pay.tsx:383 #, c-format msgid "The total price is %1$s (plus %2$s fees)." msgstr "" -#: src/webex/pages/confirm-contract.tsx:387 +#: src/webex/pages/pay.tsx:387 #, c-format msgid "The total price is %1$s." msgstr "" -#: src/webex/pages/confirm-create-reserve.tsx:128 -#, c-format -msgid "Select" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:145 -#, c-format -msgid "Error: URL may not be relative" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:160 -#, c-format -msgid "Invalid exchange URL (%1$s)" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:210 -#, c-format -msgid "The exchange is trusted by the wallet." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:216 -#, c-format -msgid "The exchange is audited by a trusted auditor." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:222 -#, c-format -msgid "" -"Warning: The exchange is neither directly trusted nor audited by a trusted " -"auditor. If you withdraw from this exchange, it will be trusted in the " -"future." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:231 -#, c-format -msgid "" -"Using exchange provider %1$s. The exchange provider will charge %2$s in fees." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:243 -#, c-format -msgid "Waiting for a response from %1$s %2$s" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:260 -#, c-format -msgid "" -"Information about fees will be available when an exchange provider is " -"selected." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:279 -#, c-format -msgid "" -"Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has " -"a higher, incompatible protocol version (%3$s)." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:290 -#, c-format -msgid "" -"The chosen exchange (protocol version %1$s might be outdated.%2$s The " -"exchange has a lower, incompatible protocol version than your wallet " -"(protocol version %3$s)." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:309 -#, c-format -msgid "Accept fees and withdraw" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:314 -#, c-format -msgid "Change Exchange Provider" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:335 -#, c-format -msgid "" -"Please select an exchange. You can review the details before after your " -"selection." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:341 -#: src/webex/pages/confirm-create-reserve.tsx:353 -#, c-format -msgid "Select %1$s" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:370 -#, c-format -msgid "You are about to withdraw %1$s from your bank account into your wallet." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:459 -#, c-format -msgid "" -"Oops, something went wrong. The wallet responded with error status (%1$s)." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:468 -#, c-format -msgid "Checking URL, please wait ..." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:482 -#, c-format -msgid "Can't parse amount: %1$s" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:489 -#, c-format -msgid "Can't parse wire_types: %1$s" -msgstr "" - -#. #-#-#-#-# - (PACKAGE VERSION) #-#-#-#-# -#. TODO:generic error reporting function or component. -#: src/webex/pages/confirm-create-reserve.tsx:519 src/webex/pages/tip.tsx:180 -#, c-format -msgid "Fatal error: \"%1$s\"." -msgstr "" - #: src/webex/pages/popup.tsx:165 #, c-format msgid "Balance" @@ -370,6 +248,127 @@ msgstr "" msgid "Cancel" msgstr "" +#. #-#-#-#-# - (PACKAGE VERSION) #-#-#-#-# +#. TODO:generic error reporting function or component. +#: src/webex/pages/tip.tsx:180 src/webex/pages/withdraw.tsx:519 +#, c-format +msgid "Fatal error: \"%1$s\"." +msgstr "" + +#: src/webex/pages/withdraw.tsx:128 +#, c-format +msgid "Select" +msgstr "" + +#: src/webex/pages/withdraw.tsx:145 +#, c-format +msgid "Error: URL may not be relative" +msgstr "" + +#: src/webex/pages/withdraw.tsx:160 +#, c-format +msgid "Invalid exchange URL (%1$s)" +msgstr "" + +#: src/webex/pages/withdraw.tsx:210 +#, c-format +msgid "The exchange is trusted by the wallet." +msgstr "" + +#: src/webex/pages/withdraw.tsx:216 +#, c-format +msgid "The exchange is audited by a trusted auditor." +msgstr "" + +#: src/webex/pages/withdraw.tsx:222 +#, c-format +msgid "" +"Warning: The exchange is neither directly trusted nor audited by a trusted " +"auditor. If you withdraw from this exchange, it will be trusted in the " +"future." +msgstr "" + +#: src/webex/pages/withdraw.tsx:231 +#, c-format +msgid "" +"Using exchange provider %1$s. The exchange provider will charge %2$s in fees." +msgstr "" + +#: src/webex/pages/withdraw.tsx:243 +#, c-format +msgid "Waiting for a response from %1$s %2$s" +msgstr "" + +#: src/webex/pages/withdraw.tsx:260 +#, c-format +msgid "" +"Information about fees will be available when an exchange provider is " +"selected." +msgstr "" + +#: src/webex/pages/withdraw.tsx:279 +#, c-format +msgid "" +"Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has " +"a higher, incompatible protocol version (%3$s)." +msgstr "" + +#: src/webex/pages/withdraw.tsx:290 +#, c-format +msgid "" +"The chosen exchange (protocol version %1$s might be outdated.%2$s The " +"exchange has a lower, incompatible protocol version than your wallet " +"(protocol version %3$s)." +msgstr "" + +#: src/webex/pages/withdraw.tsx:309 +#, c-format +msgid "Accept fees and withdraw" +msgstr "" + +#: src/webex/pages/withdraw.tsx:314 +#, c-format +msgid "Change Exchange Provider" +msgstr "" + +#: src/webex/pages/withdraw.tsx:335 +#, c-format +msgid "" +"Please select an exchange. You can review the details before after your " +"selection." +msgstr "" + +#: src/webex/pages/withdraw.tsx:341 src/webex/pages/withdraw.tsx:353 +#, c-format +msgid "Select %1$s" +msgstr "" + +#: src/webex/pages/withdraw.tsx:370 +#, c-format +msgid "You are about to withdraw %1$s from your bank account into your wallet." +msgstr "" + +#: src/webex/pages/withdraw.tsx:459 +#, c-format +msgid "" +"Oops, something went wrong. The wallet responded with error status (%1$s)." +msgstr "" + +#: src/webex/pages/withdraw.tsx:468 +#, c-format +msgid "Checking URL, please wait ..." +msgstr "" + +#: src/webex/pages/withdraw.tsx:482 +#, c-format +msgid "Can't parse amount: %1$s" +msgstr "" + +#: src/webex/pages/withdraw.tsx:489 +#, c-format +msgid "Can't parse wire_types: %1$s" +msgstr "" + #: src/webex/renderHtml.tsx:225 #, c-format msgid "Withdrawal fees:" diff --git a/src/i18n/fr.po b/src/i18n/fr.po index e7615e41c..1f0dc2a47 100644 --- a/src/i18n/fr.po +++ b/src/i18n/fr.po @@ -37,28 +37,28 @@ msgstr "" msgid "time (ms/op)" msgstr "" -#: src/webex/pages/confirm-contract.tsx:78 +#: src/webex/pages/pay.tsx:78 #, c-format msgid "show more details" msgstr "" -#: src/webex/pages/confirm-contract.tsx:92 +#: src/webex/pages/pay.tsx:92 #, c-format msgid "Accepted exchanges:" msgstr "" -#: src/webex/pages/confirm-contract.tsx:97 +#: src/webex/pages/pay.tsx:97 #, c-format msgid "Exchanges in the wallet:" msgstr "" -#: src/webex/pages/confirm-contract.tsx:219 +#: src/webex/pages/pay.tsx:219 #, c-format msgid "You have insufficient funds of the requested currency in your wallet." msgstr "" #. tslint:disable-next-line:max-line-length -#: src/webex/pages/confirm-contract.tsx:221 +#: src/webex/pages/pay.tsx:221 #, c-format msgid "" "You do not have any funds from an exchange that is accepted by this " @@ -66,180 +66,58 @@ msgid "" "wallet." msgstr "" -#: src/webex/pages/confirm-contract.tsx:322 +#: src/webex/pages/pay.tsx:322 #, c-format msgid "Confirm payment" msgstr "" -#: src/webex/pages/confirm-contract.tsx:332 +#: src/webex/pages/pay.tsx:332 #, c-format msgid "Submitting payment" msgstr "" -#: src/webex/pages/confirm-contract.tsx:343 +#: src/webex/pages/pay.tsx:343 #, c-format msgid "" "You already paid for this, clicking \"Confirm payment\" will not cost money " "again." msgstr "" -#: src/webex/pages/confirm-contract.tsx:357 +#: src/webex/pages/pay.tsx:357 #, c-format msgid "Aborting payment ..." msgstr "" -#: src/webex/pages/confirm-contract.tsx:359 +#: src/webex/pages/pay.tsx:359 #, c-format msgid "Payment aborted!" msgstr "" -#: src/webex/pages/confirm-contract.tsx:362 +#: src/webex/pages/pay.tsx:362 #, c-format msgid "Retry Payment" msgstr "" -#: src/webex/pages/confirm-contract.tsx:365 +#: src/webex/pages/pay.tsx:365 #, c-format msgid "Abort Payment" msgstr "" -#: src/webex/pages/confirm-contract.tsx:374 +#: src/webex/pages/pay.tsx:374 #, c-format msgid "The merchant %1$s offers you to purchase:" msgstr "" -#: src/webex/pages/confirm-contract.tsx:383 +#: src/webex/pages/pay.tsx:383 #, c-format msgid "The total price is %1$s (plus %2$s fees)." msgstr "" -#: src/webex/pages/confirm-contract.tsx:387 +#: src/webex/pages/pay.tsx:387 #, c-format msgid "The total price is %1$s." msgstr "" -#: src/webex/pages/confirm-create-reserve.tsx:128 -#, c-format -msgid "Select" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:145 -#, c-format -msgid "Error: URL may not be relative" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:160 -#, c-format -msgid "Invalid exchange URL (%1$s)" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:210 -#, c-format -msgid "The exchange is trusted by the wallet." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:216 -#, c-format -msgid "The exchange is audited by a trusted auditor." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:222 -#, c-format -msgid "" -"Warning: The exchange is neither directly trusted nor audited by a trusted " -"auditor. If you withdraw from this exchange, it will be trusted in the " -"future." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:231 -#, c-format -msgid "" -"Using exchange provider %1$s. The exchange provider will charge %2$s in fees." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:243 -#, c-format -msgid "Waiting for a response from %1$s %2$s" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:260 -#, c-format -msgid "" -"Information about fees will be available when an exchange provider is " -"selected." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:279 -#, c-format -msgid "" -"Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has " -"a higher, incompatible protocol version (%3$s)." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:290 -#, c-format -msgid "" -"The chosen exchange (protocol version %1$s might be outdated.%2$s The " -"exchange has a lower, incompatible protocol version than your wallet " -"(protocol version %3$s)." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:309 -#, c-format -msgid "Accept fees and withdraw" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:314 -#, c-format -msgid "Change Exchange Provider" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:335 -#, c-format -msgid "" -"Please select an exchange. You can review the details before after your " -"selection." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:341 -#: src/webex/pages/confirm-create-reserve.tsx:353 -#, c-format -msgid "Select %1$s" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:370 -#, c-format -msgid "You are about to withdraw %1$s from your bank account into your wallet." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:459 -#, c-format -msgid "" -"Oops, something went wrong. The wallet responded with error status (%1$s)." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:468 -#, c-format -msgid "Checking URL, please wait ..." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:482 -#, c-format -msgid "Can't parse amount: %1$s" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:489 -#, c-format -msgid "Can't parse wire_types: %1$s" -msgstr "" - -#. #-#-#-#-# - (PACKAGE VERSION) #-#-#-#-# -#. TODO:generic error reporting function or component. -#: src/webex/pages/confirm-create-reserve.tsx:519 src/webex/pages/tip.tsx:180 -#, c-format -msgid "Fatal error: \"%1$s\"." -msgstr "" - #: src/webex/pages/popup.tsx:165 #, c-format msgid "Balance" @@ -370,6 +248,127 @@ msgstr "" msgid "Cancel" msgstr "" +#. #-#-#-#-# - (PACKAGE VERSION) #-#-#-#-# +#. TODO:generic error reporting function or component. +#: src/webex/pages/tip.tsx:180 src/webex/pages/withdraw.tsx:519 +#, c-format +msgid "Fatal error: \"%1$s\"." +msgstr "" + +#: src/webex/pages/withdraw.tsx:128 +#, c-format +msgid "Select" +msgstr "" + +#: src/webex/pages/withdraw.tsx:145 +#, c-format +msgid "Error: URL may not be relative" +msgstr "" + +#: src/webex/pages/withdraw.tsx:160 +#, c-format +msgid "Invalid exchange URL (%1$s)" +msgstr "" + +#: src/webex/pages/withdraw.tsx:210 +#, c-format +msgid "The exchange is trusted by the wallet." +msgstr "" + +#: src/webex/pages/withdraw.tsx:216 +#, c-format +msgid "The exchange is audited by a trusted auditor." +msgstr "" + +#: src/webex/pages/withdraw.tsx:222 +#, c-format +msgid "" +"Warning: The exchange is neither directly trusted nor audited by a trusted " +"auditor. If you withdraw from this exchange, it will be trusted in the " +"future." +msgstr "" + +#: src/webex/pages/withdraw.tsx:231 +#, c-format +msgid "" +"Using exchange provider %1$s. The exchange provider will charge %2$s in fees." +msgstr "" + +#: src/webex/pages/withdraw.tsx:243 +#, c-format +msgid "Waiting for a response from %1$s %2$s" +msgstr "" + +#: src/webex/pages/withdraw.tsx:260 +#, c-format +msgid "" +"Information about fees will be available when an exchange provider is " +"selected." +msgstr "" + +#: src/webex/pages/withdraw.tsx:279 +#, c-format +msgid "" +"Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has " +"a higher, incompatible protocol version (%3$s)." +msgstr "" + +#: src/webex/pages/withdraw.tsx:290 +#, c-format +msgid "" +"The chosen exchange (protocol version %1$s might be outdated.%2$s The " +"exchange has a lower, incompatible protocol version than your wallet " +"(protocol version %3$s)." +msgstr "" + +#: src/webex/pages/withdraw.tsx:309 +#, c-format +msgid "Accept fees and withdraw" +msgstr "" + +#: src/webex/pages/withdraw.tsx:314 +#, c-format +msgid "Change Exchange Provider" +msgstr "" + +#: src/webex/pages/withdraw.tsx:335 +#, c-format +msgid "" +"Please select an exchange. You can review the details before after your " +"selection." +msgstr "" + +#: src/webex/pages/withdraw.tsx:341 src/webex/pages/withdraw.tsx:353 +#, c-format +msgid "Select %1$s" +msgstr "" + +#: src/webex/pages/withdraw.tsx:370 +#, c-format +msgid "You are about to withdraw %1$s from your bank account into your wallet." +msgstr "" + +#: src/webex/pages/withdraw.tsx:459 +#, c-format +msgid "" +"Oops, something went wrong. The wallet responded with error status (%1$s)." +msgstr "" + +#: src/webex/pages/withdraw.tsx:468 +#, c-format +msgid "Checking URL, please wait ..." +msgstr "" + +#: src/webex/pages/withdraw.tsx:482 +#, c-format +msgid "Can't parse amount: %1$s" +msgstr "" + +#: src/webex/pages/withdraw.tsx:489 +#, c-format +msgid "Can't parse wire_types: %1$s" +msgstr "" + #: src/webex/renderHtml.tsx:225 #, c-format msgid "Withdrawal fees:" diff --git a/src/i18n/it.po b/src/i18n/it.po index e7615e41c..1f0dc2a47 100644 --- a/src/i18n/it.po +++ b/src/i18n/it.po @@ -37,28 +37,28 @@ msgstr "" msgid "time (ms/op)" msgstr "" -#: src/webex/pages/confirm-contract.tsx:78 +#: src/webex/pages/pay.tsx:78 #, c-format msgid "show more details" msgstr "" -#: src/webex/pages/confirm-contract.tsx:92 +#: src/webex/pages/pay.tsx:92 #, c-format msgid "Accepted exchanges:" msgstr "" -#: src/webex/pages/confirm-contract.tsx:97 +#: src/webex/pages/pay.tsx:97 #, c-format msgid "Exchanges in the wallet:" msgstr "" -#: src/webex/pages/confirm-contract.tsx:219 +#: src/webex/pages/pay.tsx:219 #, c-format msgid "You have insufficient funds of the requested currency in your wallet." msgstr "" #. tslint:disable-next-line:max-line-length -#: src/webex/pages/confirm-contract.tsx:221 +#: src/webex/pages/pay.tsx:221 #, c-format msgid "" "You do not have any funds from an exchange that is accepted by this " @@ -66,180 +66,58 @@ msgid "" "wallet." msgstr "" -#: src/webex/pages/confirm-contract.tsx:322 +#: src/webex/pages/pay.tsx:322 #, c-format msgid "Confirm payment" msgstr "" -#: src/webex/pages/confirm-contract.tsx:332 +#: src/webex/pages/pay.tsx:332 #, c-format msgid "Submitting payment" msgstr "" -#: src/webex/pages/confirm-contract.tsx:343 +#: src/webex/pages/pay.tsx:343 #, c-format msgid "" "You already paid for this, clicking \"Confirm payment\" will not cost money " "again." msgstr "" -#: src/webex/pages/confirm-contract.tsx:357 +#: src/webex/pages/pay.tsx:357 #, c-format msgid "Aborting payment ..." msgstr "" -#: src/webex/pages/confirm-contract.tsx:359 +#: src/webex/pages/pay.tsx:359 #, c-format msgid "Payment aborted!" msgstr "" -#: src/webex/pages/confirm-contract.tsx:362 +#: src/webex/pages/pay.tsx:362 #, c-format msgid "Retry Payment" msgstr "" -#: src/webex/pages/confirm-contract.tsx:365 +#: src/webex/pages/pay.tsx:365 #, c-format msgid "Abort Payment" msgstr "" -#: src/webex/pages/confirm-contract.tsx:374 +#: src/webex/pages/pay.tsx:374 #, c-format msgid "The merchant %1$s offers you to purchase:" msgstr "" -#: src/webex/pages/confirm-contract.tsx:383 +#: src/webex/pages/pay.tsx:383 #, c-format msgid "The total price is %1$s (plus %2$s fees)." msgstr "" -#: src/webex/pages/confirm-contract.tsx:387 +#: src/webex/pages/pay.tsx:387 #, c-format msgid "The total price is %1$s." msgstr "" -#: src/webex/pages/confirm-create-reserve.tsx:128 -#, c-format -msgid "Select" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:145 -#, c-format -msgid "Error: URL may not be relative" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:160 -#, c-format -msgid "Invalid exchange URL (%1$s)" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:210 -#, c-format -msgid "The exchange is trusted by the wallet." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:216 -#, c-format -msgid "The exchange is audited by a trusted auditor." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:222 -#, c-format -msgid "" -"Warning: The exchange is neither directly trusted nor audited by a trusted " -"auditor. If you withdraw from this exchange, it will be trusted in the " -"future." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:231 -#, c-format -msgid "" -"Using exchange provider %1$s. The exchange provider will charge %2$s in fees." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:243 -#, c-format -msgid "Waiting for a response from %1$s %2$s" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:260 -#, c-format -msgid "" -"Information about fees will be available when an exchange provider is " -"selected." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:279 -#, c-format -msgid "" -"Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has " -"a higher, incompatible protocol version (%3$s)." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:290 -#, c-format -msgid "" -"The chosen exchange (protocol version %1$s might be outdated.%2$s The " -"exchange has a lower, incompatible protocol version than your wallet " -"(protocol version %3$s)." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:309 -#, c-format -msgid "Accept fees and withdraw" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:314 -#, c-format -msgid "Change Exchange Provider" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:335 -#, c-format -msgid "" -"Please select an exchange. You can review the details before after your " -"selection." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:341 -#: src/webex/pages/confirm-create-reserve.tsx:353 -#, c-format -msgid "Select %1$s" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:370 -#, c-format -msgid "You are about to withdraw %1$s from your bank account into your wallet." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:459 -#, c-format -msgid "" -"Oops, something went wrong. The wallet responded with error status (%1$s)." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:468 -#, c-format -msgid "Checking URL, please wait ..." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:482 -#, c-format -msgid "Can't parse amount: %1$s" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:489 -#, c-format -msgid "Can't parse wire_types: %1$s" -msgstr "" - -#. #-#-#-#-# - (PACKAGE VERSION) #-#-#-#-# -#. TODO:generic error reporting function or component. -#: src/webex/pages/confirm-create-reserve.tsx:519 src/webex/pages/tip.tsx:180 -#, c-format -msgid "Fatal error: \"%1$s\"." -msgstr "" - #: src/webex/pages/popup.tsx:165 #, c-format msgid "Balance" @@ -370,6 +248,127 @@ msgstr "" msgid "Cancel" msgstr "" +#. #-#-#-#-# - (PACKAGE VERSION) #-#-#-#-# +#. TODO:generic error reporting function or component. +#: src/webex/pages/tip.tsx:180 src/webex/pages/withdraw.tsx:519 +#, c-format +msgid "Fatal error: \"%1$s\"." +msgstr "" + +#: src/webex/pages/withdraw.tsx:128 +#, c-format +msgid "Select" +msgstr "" + +#: src/webex/pages/withdraw.tsx:145 +#, c-format +msgid "Error: URL may not be relative" +msgstr "" + +#: src/webex/pages/withdraw.tsx:160 +#, c-format +msgid "Invalid exchange URL (%1$s)" +msgstr "" + +#: src/webex/pages/withdraw.tsx:210 +#, c-format +msgid "The exchange is trusted by the wallet." +msgstr "" + +#: src/webex/pages/withdraw.tsx:216 +#, c-format +msgid "The exchange is audited by a trusted auditor." +msgstr "" + +#: src/webex/pages/withdraw.tsx:222 +#, c-format +msgid "" +"Warning: The exchange is neither directly trusted nor audited by a trusted " +"auditor. If you withdraw from this exchange, it will be trusted in the " +"future." +msgstr "" + +#: src/webex/pages/withdraw.tsx:231 +#, c-format +msgid "" +"Using exchange provider %1$s. The exchange provider will charge %2$s in fees." +msgstr "" + +#: src/webex/pages/withdraw.tsx:243 +#, c-format +msgid "Waiting for a response from %1$s %2$s" +msgstr "" + +#: src/webex/pages/withdraw.tsx:260 +#, c-format +msgid "" +"Information about fees will be available when an exchange provider is " +"selected." +msgstr "" + +#: src/webex/pages/withdraw.tsx:279 +#, c-format +msgid "" +"Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has " +"a higher, incompatible protocol version (%3$s)." +msgstr "" + +#: src/webex/pages/withdraw.tsx:290 +#, c-format +msgid "" +"The chosen exchange (protocol version %1$s might be outdated.%2$s The " +"exchange has a lower, incompatible protocol version than your wallet " +"(protocol version %3$s)." +msgstr "" + +#: src/webex/pages/withdraw.tsx:309 +#, c-format +msgid "Accept fees and withdraw" +msgstr "" + +#: src/webex/pages/withdraw.tsx:314 +#, c-format +msgid "Change Exchange Provider" +msgstr "" + +#: src/webex/pages/withdraw.tsx:335 +#, c-format +msgid "" +"Please select an exchange. You can review the details before after your " +"selection." +msgstr "" + +#: src/webex/pages/withdraw.tsx:341 src/webex/pages/withdraw.tsx:353 +#, c-format +msgid "Select %1$s" +msgstr "" + +#: src/webex/pages/withdraw.tsx:370 +#, c-format +msgid "You are about to withdraw %1$s from your bank account into your wallet." +msgstr "" + +#: src/webex/pages/withdraw.tsx:459 +#, c-format +msgid "" +"Oops, something went wrong. The wallet responded with error status (%1$s)." +msgstr "" + +#: src/webex/pages/withdraw.tsx:468 +#, c-format +msgid "Checking URL, please wait ..." +msgstr "" + +#: src/webex/pages/withdraw.tsx:482 +#, c-format +msgid "Can't parse amount: %1$s" +msgstr "" + +#: src/webex/pages/withdraw.tsx:489 +#, c-format +msgid "Can't parse wire_types: %1$s" +msgstr "" + #: src/webex/renderHtml.tsx:225 #, c-format msgid "Withdrawal fees:" diff --git a/src/i18n/strings.ts b/src/i18n/strings.ts index 9c2947c6c..066becf16 100644 --- a/src/i18n/strings.ts +++ b/src/i18n/strings.ts @@ -92,90 +92,6 @@ strings['de'] = { null, "" ], - "Select": [ - null, - "" - ], - "Error: URL may not be relative": [ - null, - "" - ], - "Invalid exchange URL (%1$s)": [ - null, - "" - ], - "The exchange is trusted by the wallet.": [ - null, - "" - ], - "The exchange is audited by a trusted auditor.": [ - null, - "" - ], - "Warning: The exchange is neither directly trusted nor audited by a trusted auditor. If you withdraw from this exchange, it will be trusted in the future.": [ - null, - "" - ], - "Using exchange provider %1$s. The exchange provider will charge %2$s in fees.": [ - null, - "" - ], - "Waiting for a response from %1$s %2$s": [ - null, - "" - ], - "Information about fees will be available when an exchange provider is selected.": [ - null, - "" - ], - "Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has a higher, incompatible protocol version (%3$s).": [ - null, - "" - ], - "The chosen exchange (protocol version %1$s might be outdated.%2$s The exchange has a lower, incompatible protocol version than your wallet (protocol version %3$s).": [ - null, - "" - ], - "Accept fees and withdraw": [ - null, - "" - ], - "Change Exchange Provider": [ - null, - "" - ], - "Please select an exchange. You can review the details before after your selection.": [ - null, - "" - ], - "Select %1$s": [ - null, - "" - ], - "You are about to withdraw %1$s from your bank account into your wallet.": [ - null, - "" - ], - "Oops, something went wrong. The wallet responded with error status (%1$s).": [ - null, - "" - ], - "Checking URL, please wait ...": [ - null, - "" - ], - "Can't parse amount: %1$s": [ - null, - "" - ], - "Can't parse wire_types: %1$s": [ - null, - "" - ], - "Fatal error: \"%1$s\".": [ - null, - "" - ], "Balance": [ null, "Saldo" @@ -280,6 +196,90 @@ strings['de'] = { null, "Saldo" ], + "Fatal error: \"%1$s\".": [ + null, + "" + ], + "Select": [ + null, + "" + ], + "Error: URL may not be relative": [ + null, + "" + ], + "Invalid exchange URL (%1$s)": [ + null, + "" + ], + "The exchange is trusted by the wallet.": [ + null, + "" + ], + "The exchange is audited by a trusted auditor.": [ + null, + "" + ], + "Warning: The exchange is neither directly trusted nor audited by a trusted auditor. If you withdraw from this exchange, it will be trusted in the future.": [ + null, + "" + ], + "Using exchange provider %1$s. The exchange provider will charge %2$s in fees.": [ + null, + "" + ], + "Waiting for a response from %1$s %2$s": [ + null, + "" + ], + "Information about fees will be available when an exchange provider is selected.": [ + null, + "" + ], + "Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has a higher, incompatible protocol version (%3$s).": [ + null, + "" + ], + "The chosen exchange (protocol version %1$s might be outdated.%2$s The exchange has a lower, incompatible protocol version than your wallet (protocol version %3$s).": [ + null, + "" + ], + "Accept fees and withdraw": [ + null, + "" + ], + "Change Exchange Provider": [ + null, + "" + ], + "Please select an exchange. You can review the details before after your selection.": [ + null, + "" + ], + "Select %1$s": [ + null, + "" + ], + "You are about to withdraw %1$s from your bank account into your wallet.": [ + null, + "" + ], + "Oops, something went wrong. The wallet responded with error status (%1$s).": [ + null, + "" + ], + "Checking URL, please wait ...": [ + null, + "" + ], + "Can't parse amount: %1$s": [ + null, + "" + ], + "Can't parse wire_types: %1$s": [ + null, + "" + ], "Withdrawal fees:": [ null, "Abheben bei" @@ -408,90 +408,6 @@ strings['en-US'] = { null, "" ], - "Select": [ - null, - "" - ], - "Error: URL may not be relative": [ - null, - "" - ], - "Invalid exchange URL (%1$s)": [ - null, - "" - ], - "The exchange is trusted by the wallet.": [ - null, - "" - ], - "The exchange is audited by a trusted auditor.": [ - null, - "" - ], - "Warning: The exchange is neither directly trusted nor audited by a trusted auditor. If you withdraw from this exchange, it will be trusted in the future.": [ - null, - "" - ], - "Using exchange provider %1$s. The exchange provider will charge %2$s in fees.": [ - null, - "" - ], - "Waiting for a response from %1$s %2$s": [ - null, - "" - ], - "Information about fees will be available when an exchange provider is selected.": [ - null, - "" - ], - "Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has a higher, incompatible protocol version (%3$s).": [ - null, - "" - ], - "The chosen exchange (protocol version %1$s might be outdated.%2$s The exchange has a lower, incompatible protocol version than your wallet (protocol version %3$s).": [ - null, - "" - ], - "Accept fees and withdraw": [ - null, - "" - ], - "Change Exchange Provider": [ - null, - "" - ], - "Please select an exchange. You can review the details before after your selection.": [ - null, - "" - ], - "Select %1$s": [ - null, - "" - ], - "You are about to withdraw %1$s from your bank account into your wallet.": [ - null, - "" - ], - "Oops, something went wrong. The wallet responded with error status (%1$s).": [ - null, - "" - ], - "Checking URL, please wait ...": [ - null, - "" - ], - "Can't parse amount: %1$s": [ - null, - "" - ], - "Can't parse wire_types: %1$s": [ - null, - "" - ], - "Fatal error: \"%1$s\".": [ - null, - "" - ], "Balance": [ null, "" @@ -596,6 +512,90 @@ strings['en-US'] = { null, "" ], + "Fatal error: \"%1$s\".": [ + null, + "" + ], + "Select": [ + null, + "" + ], + "Error: URL may not be relative": [ + null, + "" + ], + "Invalid exchange URL (%1$s)": [ + null, + "" + ], + "The exchange is trusted by the wallet.": [ + null, + "" + ], + "The exchange is audited by a trusted auditor.": [ + null, + "" + ], + "Warning: The exchange is neither directly trusted nor audited by a trusted auditor. If you withdraw from this exchange, it will be trusted in the future.": [ + null, + "" + ], + "Using exchange provider %1$s. The exchange provider will charge %2$s in fees.": [ + null, + "" + ], + "Waiting for a response from %1$s %2$s": [ + null, + "" + ], + "Information about fees will be available when an exchange provider is selected.": [ + null, + "" + ], + "Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has a higher, incompatible protocol version (%3$s).": [ + null, + "" + ], + "The chosen exchange (protocol version %1$s might be outdated.%2$s The exchange has a lower, incompatible protocol version than your wallet (protocol version %3$s).": [ + null, + "" + ], + "Accept fees and withdraw": [ + null, + "" + ], + "Change Exchange Provider": [ + null, + "" + ], + "Please select an exchange. You can review the details before after your selection.": [ + null, + "" + ], + "Select %1$s": [ + null, + "" + ], + "You are about to withdraw %1$s from your bank account into your wallet.": [ + null, + "" + ], + "Oops, something went wrong. The wallet responded with error status (%1$s).": [ + null, + "" + ], + "Checking URL, please wait ...": [ + null, + "" + ], + "Can't parse amount: %1$s": [ + null, + "" + ], + "Can't parse wire_types: %1$s": [ + null, + "" + ], "Withdrawal fees:": [ null, "" @@ -724,90 +724,6 @@ strings['fr'] = { null, "" ], - "Select": [ - null, - "" - ], - "Error: URL may not be relative": [ - null, - "" - ], - "Invalid exchange URL (%1$s)": [ - null, - "" - ], - "The exchange is trusted by the wallet.": [ - null, - "" - ], - "The exchange is audited by a trusted auditor.": [ - null, - "" - ], - "Warning: The exchange is neither directly trusted nor audited by a trusted auditor. If you withdraw from this exchange, it will be trusted in the future.": [ - null, - "" - ], - "Using exchange provider %1$s. The exchange provider will charge %2$s in fees.": [ - null, - "" - ], - "Waiting for a response from %1$s %2$s": [ - null, - "" - ], - "Information about fees will be available when an exchange provider is selected.": [ - null, - "" - ], - "Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has a higher, incompatible protocol version (%3$s).": [ - null, - "" - ], - "The chosen exchange (protocol version %1$s might be outdated.%2$s The exchange has a lower, incompatible protocol version than your wallet (protocol version %3$s).": [ - null, - "" - ], - "Accept fees and withdraw": [ - null, - "" - ], - "Change Exchange Provider": [ - null, - "" - ], - "Please select an exchange. You can review the details before after your selection.": [ - null, - "" - ], - "Select %1$s": [ - null, - "" - ], - "You are about to withdraw %1$s from your bank account into your wallet.": [ - null, - "" - ], - "Oops, something went wrong. The wallet responded with error status (%1$s).": [ - null, - "" - ], - "Checking URL, please wait ...": [ - null, - "" - ], - "Can't parse amount: %1$s": [ - null, - "" - ], - "Can't parse wire_types: %1$s": [ - null, - "" - ], - "Fatal error: \"%1$s\".": [ - null, - "" - ], "Balance": [ null, "" @@ -912,6 +828,90 @@ strings['fr'] = { null, "" ], + "Fatal error: \"%1$s\".": [ + null, + "" + ], + "Select": [ + null, + "" + ], + "Error: URL may not be relative": [ + null, + "" + ], + "Invalid exchange URL (%1$s)": [ + null, + "" + ], + "The exchange is trusted by the wallet.": [ + null, + "" + ], + "The exchange is audited by a trusted auditor.": [ + null, + "" + ], + "Warning: The exchange is neither directly trusted nor audited by a trusted auditor. If you withdraw from this exchange, it will be trusted in the future.": [ + null, + "" + ], + "Using exchange provider %1$s. The exchange provider will charge %2$s in fees.": [ + null, + "" + ], + "Waiting for a response from %1$s %2$s": [ + null, + "" + ], + "Information about fees will be available when an exchange provider is selected.": [ + null, + "" + ], + "Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has a higher, incompatible protocol version (%3$s).": [ + null, + "" + ], + "The chosen exchange (protocol version %1$s might be outdated.%2$s The exchange has a lower, incompatible protocol version than your wallet (protocol version %3$s).": [ + null, + "" + ], + "Accept fees and withdraw": [ + null, + "" + ], + "Change Exchange Provider": [ + null, + "" + ], + "Please select an exchange. You can review the details before after your selection.": [ + null, + "" + ], + "Select %1$s": [ + null, + "" + ], + "You are about to withdraw %1$s from your bank account into your wallet.": [ + null, + "" + ], + "Oops, something went wrong. The wallet responded with error status (%1$s).": [ + null, + "" + ], + "Checking URL, please wait ...": [ + null, + "" + ], + "Can't parse amount: %1$s": [ + null, + "" + ], + "Can't parse wire_types: %1$s": [ + null, + "" + ], "Withdrawal fees:": [ null, "" @@ -1040,90 +1040,6 @@ strings['it'] = { null, "" ], - "Select": [ - null, - "" - ], - "Error: URL may not be relative": [ - null, - "" - ], - "Invalid exchange URL (%1$s)": [ - null, - "" - ], - "The exchange is trusted by the wallet.": [ - null, - "" - ], - "The exchange is audited by a trusted auditor.": [ - null, - "" - ], - "Warning: The exchange is neither directly trusted nor audited by a trusted auditor. If you withdraw from this exchange, it will be trusted in the future.": [ - null, - "" - ], - "Using exchange provider %1$s. The exchange provider will charge %2$s in fees.": [ - null, - "" - ], - "Waiting for a response from %1$s %2$s": [ - null, - "" - ], - "Information about fees will be available when an exchange provider is selected.": [ - null, - "" - ], - "Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has a higher, incompatible protocol version (%3$s).": [ - null, - "" - ], - "The chosen exchange (protocol version %1$s might be outdated.%2$s The exchange has a lower, incompatible protocol version than your wallet (protocol version %3$s).": [ - null, - "" - ], - "Accept fees and withdraw": [ - null, - "" - ], - "Change Exchange Provider": [ - null, - "" - ], - "Please select an exchange. You can review the details before after your selection.": [ - null, - "" - ], - "Select %1$s": [ - null, - "" - ], - "You are about to withdraw %1$s from your bank account into your wallet.": [ - null, - "" - ], - "Oops, something went wrong. The wallet responded with error status (%1$s).": [ - null, - "" - ], - "Checking URL, please wait ...": [ - null, - "" - ], - "Can't parse amount: %1$s": [ - null, - "" - ], - "Can't parse wire_types: %1$s": [ - null, - "" - ], - "Fatal error: \"%1$s\".": [ - null, - "" - ], "Balance": [ null, "" @@ -1228,6 +1144,90 @@ strings['it'] = { null, "" ], + "Fatal error: \"%1$s\".": [ + null, + "" + ], + "Select": [ + null, + "" + ], + "Error: URL may not be relative": [ + null, + "" + ], + "Invalid exchange URL (%1$s)": [ + null, + "" + ], + "The exchange is trusted by the wallet.": [ + null, + "" + ], + "The exchange is audited by a trusted auditor.": [ + null, + "" + ], + "Warning: The exchange is neither directly trusted nor audited by a trusted auditor. If you withdraw from this exchange, it will be trusted in the future.": [ + null, + "" + ], + "Using exchange provider %1$s. The exchange provider will charge %2$s in fees.": [ + null, + "" + ], + "Waiting for a response from %1$s %2$s": [ + null, + "" + ], + "Information about fees will be available when an exchange provider is selected.": [ + null, + "" + ], + "Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has a higher, incompatible protocol version (%3$s).": [ + null, + "" + ], + "The chosen exchange (protocol version %1$s might be outdated.%2$s The exchange has a lower, incompatible protocol version than your wallet (protocol version %3$s).": [ + null, + "" + ], + "Accept fees and withdraw": [ + null, + "" + ], + "Change Exchange Provider": [ + null, + "" + ], + "Please select an exchange. You can review the details before after your selection.": [ + null, + "" + ], + "Select %1$s": [ + null, + "" + ], + "You are about to withdraw %1$s from your bank account into your wallet.": [ + null, + "" + ], + "Oops, something went wrong. The wallet responded with error status (%1$s).": [ + null, + "" + ], + "Checking URL, please wait ...": [ + null, + "" + ], + "Can't parse amount: %1$s": [ + null, + "" + ], + "Can't parse wire_types: %1$s": [ + null, + "" + ], "Withdrawal fees:": [ null, "" @@ -1356,90 +1356,6 @@ strings['sv'] = { null, "Det totala priset är %1$s." ], - "Select": [ - null, - "Välj" - ], - "Error: URL may not be relative": [ - null, - "" - ], - "Invalid exchange URL (%1$s)": [ - null, - "" - ], - "The exchange is trusted by the wallet.": [ - null, - "Tjänsteleverantörer i plånboken:" - ], - "The exchange is audited by a trusted auditor.": [ - null, - "" - ], - "Warning: The exchange is neither directly trusted nor audited by a trusted auditor. If you withdraw from this exchange, it will be trusted in the future.": [ - null, - "" - ], - "Using exchange provider %1$s. The exchange provider will charge %2$s in fees.": [ - null, - "" - ], - "Waiting for a response from %1$s %2$s": [ - null, - "" - ], - "Information about fees will be available when an exchange provider is selected.": [ - null, - "" - ], - "Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has a higher, incompatible protocol version (%3$s).": [ - null, - "tjänsteleverantörer plånboken" - ], - "The chosen exchange (protocol version %1$s might be outdated.%2$s The exchange has a lower, incompatible protocol version than your wallet (protocol version %3$s).": [ - null, - "tjänsteleverantörer plånboken" - ], - "Accept fees and withdraw": [ - null, - "Acceptera avgifter och utbetala" - ], - "Change Exchange Provider": [ - null, - "Ändra tjänsteleverantörer" - ], - "Please select an exchange. You can review the details before after your selection.": [ - null, - "" - ], - "Select %1$s": [ - null, - "Välj %1$s" - ], - "You are about to withdraw %1$s from your bank account into your wallet.": [ - null, - "Du är på väg att ta ut\n %1$s från ditt bankkonto till din plånbok.\n" - ], - "Oops, something went wrong. The wallet responded with error status (%1$s).": [ - null, - "plånboken" - ], - "Checking URL, please wait ...": [ - null, - "" - ], - "Can't parse amount: %1$s": [ - null, - "" - ], - "Can't parse wire_types: %1$s": [ - null, - "" - ], - "Fatal error: \"%1$s\".": [ - null, - "" - ], "Balance": [ null, "Balans" @@ -1544,6 +1460,90 @@ strings['sv'] = { null, "Avbryt" ], + "Fatal error: \"%1$s\".": [ + null, + "" + ], + "Select": [ + null, + "Välj" + ], + "Error: URL may not be relative": [ + null, + "" + ], + "Invalid exchange URL (%1$s)": [ + null, + "" + ], + "The exchange is trusted by the wallet.": [ + null, + "Tjänsteleverantörer i plånboken:" + ], + "The exchange is audited by a trusted auditor.": [ + null, + "" + ], + "Warning: The exchange is neither directly trusted nor audited by a trusted auditor. If you withdraw from this exchange, it will be trusted in the future.": [ + null, + "" + ], + "Using exchange provider %1$s. The exchange provider will charge %2$s in fees.": [ + null, + "" + ], + "Waiting for a response from %1$s %2$s": [ + null, + "" + ], + "Information about fees will be available when an exchange provider is selected.": [ + null, + "" + ], + "Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has a higher, incompatible protocol version (%3$s).": [ + null, + "tjänsteleverantörer plånboken" + ], + "The chosen exchange (protocol version %1$s might be outdated.%2$s The exchange has a lower, incompatible protocol version than your wallet (protocol version %3$s).": [ + null, + "tjänsteleverantörer plånboken" + ], + "Accept fees and withdraw": [ + null, + "Acceptera avgifter och utbetala" + ], + "Change Exchange Provider": [ + null, + "Ändra tjänsteleverantörer" + ], + "Please select an exchange. You can review the details before after your selection.": [ + null, + "" + ], + "Select %1$s": [ + null, + "Välj %1$s" + ], + "You are about to withdraw %1$s from your bank account into your wallet.": [ + null, + "Du är på väg att ta ut\n %1$s från ditt bankkonto till din plånbok.\n" + ], + "Oops, something went wrong. The wallet responded with error status (%1$s).": [ + null, + "plånboken" + ], + "Checking URL, please wait ...": [ + null, + "" + ], + "Can't parse amount: %1$s": [ + null, + "" + ], + "Can't parse wire_types: %1$s": [ + null, + "" + ], "Withdrawal fees:": [ null, "Utbetalnings avgifter:" diff --git a/src/i18n/sv.po b/src/i18n/sv.po index 1b99a13a0..7e3ec5165 100644 --- a/src/i18n/sv.po +++ b/src/i18n/sv.po @@ -37,28 +37,28 @@ msgstr "" msgid "time (ms/op)" msgstr "" -#: src/webex/pages/confirm-contract.tsx:78 +#: src/webex/pages/pay.tsx:78 #, fuzzy, c-format msgid "show more details" msgstr "visa mer" -#: src/webex/pages/confirm-contract.tsx:92 +#: src/webex/pages/pay.tsx:92 #, c-format msgid "Accepted exchanges:" msgstr "Accepterade tjänsteleverantörer:" -#: src/webex/pages/confirm-contract.tsx:97 +#: src/webex/pages/pay.tsx:97 #, c-format msgid "Exchanges in the wallet:" msgstr "Tjänsteleverantörer i plånboken:" -#: src/webex/pages/confirm-contract.tsx:219 +#: src/webex/pages/pay.tsx:219 #, c-format msgid "You have insufficient funds of the requested currency in your wallet." msgstr "plånboken" #. tslint:disable-next-line:max-line-length -#: src/webex/pages/confirm-contract.tsx:221 +#: src/webex/pages/pay.tsx:221 #, c-format msgid "" "You do not have any funds from an exchange that is accepted by this " @@ -66,17 +66,17 @@ msgid "" "wallet." msgstr "plånboken" -#: src/webex/pages/confirm-contract.tsx:322 +#: src/webex/pages/pay.tsx:322 #, c-format msgid "Confirm payment" msgstr "Godkän betalning" -#: src/webex/pages/confirm-contract.tsx:332 +#: src/webex/pages/pay.tsx:332 #, c-format msgid "Submitting payment" msgstr "Bekräftar betalning" -#: src/webex/pages/confirm-contract.tsx:343 +#: src/webex/pages/pay.tsx:343 #, c-format msgid "" "You already paid for this, clicking \"Confirm payment\" will not cost money " @@ -85,165 +85,41 @@ msgstr "" "Du har redan betalat för det här, om du trycker \"Godkän betalning\" " "debiteras du inte igen" -#: src/webex/pages/confirm-contract.tsx:357 +#: src/webex/pages/pay.tsx:357 #, fuzzy, c-format msgid "Aborting payment ..." msgstr "Bekräftar betalning" -#: src/webex/pages/confirm-contract.tsx:359 +#: src/webex/pages/pay.tsx:359 #, c-format msgid "Payment aborted!" msgstr "" -#: src/webex/pages/confirm-contract.tsx:362 +#: src/webex/pages/pay.tsx:362 #, c-format msgid "Retry Payment" msgstr "" -#: src/webex/pages/confirm-contract.tsx:365 +#: src/webex/pages/pay.tsx:365 #, fuzzy, c-format msgid "Abort Payment" msgstr "Godkän betalning" -#: src/webex/pages/confirm-contract.tsx:374 +#: src/webex/pages/pay.tsx:374 #, fuzzy, c-format msgid "The merchant %1$s offers you to purchase:" msgstr "Säljaren %1$s erbjuder följande:" -#: src/webex/pages/confirm-contract.tsx:383 +#: src/webex/pages/pay.tsx:383 #, fuzzy, c-format msgid "The total price is %1$s (plus %2$s fees)." msgstr "Det totala priset är %1$s (plus %2$s avgifter).\n" -#: src/webex/pages/confirm-contract.tsx:387 +#: src/webex/pages/pay.tsx:387 #, fuzzy, c-format msgid "The total price is %1$s." msgstr "Det totala priset är %1$s." -#: src/webex/pages/confirm-create-reserve.tsx:128 -#, c-format -msgid "Select" -msgstr "Välj" - -#: src/webex/pages/confirm-create-reserve.tsx:145 -#, c-format -msgid "Error: URL may not be relative" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:160 -#, c-format -msgid "Invalid exchange URL (%1$s)" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:210 -#, fuzzy, c-format -msgid "The exchange is trusted by the wallet." -msgstr "Tjänsteleverantörer i plånboken:" - -#: src/webex/pages/confirm-create-reserve.tsx:216 -#, c-format -msgid "The exchange is audited by a trusted auditor." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:222 -#, c-format -msgid "" -"Warning: The exchange is neither directly trusted nor audited by a trusted " -"auditor. If you withdraw from this exchange, it will be trusted in the " -"future." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:231 -#, c-format -msgid "" -"Using exchange provider %1$s. The exchange provider will charge %2$s in fees." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:243 -#, c-format -msgid "Waiting for a response from %1$s %2$s" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:260 -#, c-format -msgid "" -"Information about fees will be available when an exchange provider is " -"selected." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:279 -#, fuzzy, c-format -msgid "" -"Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has " -"a higher, incompatible protocol version (%3$s)." -msgstr "tjänsteleverantörer plånboken" - -#: src/webex/pages/confirm-create-reserve.tsx:290 -#, fuzzy, c-format -msgid "" -"The chosen exchange (protocol version %1$s might be outdated.%2$s The " -"exchange has a lower, incompatible protocol version than your wallet " -"(protocol version %3$s)." -msgstr "tjänsteleverantörer plånboken" - -#: src/webex/pages/confirm-create-reserve.tsx:309 -#, c-format -msgid "Accept fees and withdraw" -msgstr "Acceptera avgifter och utbetala" - -#: src/webex/pages/confirm-create-reserve.tsx:314 -#, c-format -msgid "Change Exchange Provider" -msgstr "Ändra tjänsteleverantörer" - -#: src/webex/pages/confirm-create-reserve.tsx:335 -#, c-format -msgid "" -"Please select an exchange. You can review the details before after your " -"selection." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:341 -#: src/webex/pages/confirm-create-reserve.tsx:353 -#, fuzzy, c-format -msgid "Select %1$s" -msgstr "Välj %1$s" - -#: src/webex/pages/confirm-create-reserve.tsx:370 -#, fuzzy, c-format -msgid "You are about to withdraw %1$s from your bank account into your wallet." -msgstr "" -"Du är på väg att ta ut\n" -" %1$s från ditt bankkonto till din plånbok.\n" - -#: src/webex/pages/confirm-create-reserve.tsx:459 -#, fuzzy, c-format -msgid "" -"Oops, something went wrong. The wallet responded with error status (%1$s)." -msgstr "plånboken" - -#: src/webex/pages/confirm-create-reserve.tsx:468 -#, c-format -msgid "Checking URL, please wait ..." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:482 -#, c-format -msgid "Can't parse amount: %1$s" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:489 -#, c-format -msgid "Can't parse wire_types: %1$s" -msgstr "" - -#. #-#-#-#-# - (PACKAGE VERSION) #-#-#-#-# -#. TODO:generic error reporting function or component. -#: src/webex/pages/confirm-create-reserve.tsx:519 src/webex/pages/tip.tsx:180 -#, c-format -msgid "Fatal error: \"%1$s\"." -msgstr "" - #: src/webex/pages/popup.tsx:165 #, c-format msgid "Balance" @@ -376,6 +252,129 @@ msgstr "Bekräfta" msgid "Cancel" msgstr "Avbryt" +#. #-#-#-#-# - (PACKAGE VERSION) #-#-#-#-# +#. TODO:generic error reporting function or component. +#: src/webex/pages/tip.tsx:180 src/webex/pages/withdraw.tsx:519 +#, c-format +msgid "Fatal error: \"%1$s\"." +msgstr "" + +#: src/webex/pages/withdraw.tsx:128 +#, c-format +msgid "Select" +msgstr "Välj" + +#: src/webex/pages/withdraw.tsx:145 +#, c-format +msgid "Error: URL may not be relative" +msgstr "" + +#: src/webex/pages/withdraw.tsx:160 +#, c-format +msgid "Invalid exchange URL (%1$s)" +msgstr "" + +#: src/webex/pages/withdraw.tsx:210 +#, fuzzy, c-format +msgid "The exchange is trusted by the wallet." +msgstr "Tjänsteleverantörer i plånboken:" + +#: src/webex/pages/withdraw.tsx:216 +#, c-format +msgid "The exchange is audited by a trusted auditor." +msgstr "" + +#: src/webex/pages/withdraw.tsx:222 +#, c-format +msgid "" +"Warning: The exchange is neither directly trusted nor audited by a trusted " +"auditor. If you withdraw from this exchange, it will be trusted in the " +"future." +msgstr "" + +#: src/webex/pages/withdraw.tsx:231 +#, c-format +msgid "" +"Using exchange provider %1$s. The exchange provider will charge %2$s in fees." +msgstr "" + +#: src/webex/pages/withdraw.tsx:243 +#, c-format +msgid "Waiting for a response from %1$s %2$s" +msgstr "" + +#: src/webex/pages/withdraw.tsx:260 +#, c-format +msgid "" +"Information about fees will be available when an exchange provider is " +"selected." +msgstr "" + +#: src/webex/pages/withdraw.tsx:279 +#, fuzzy, c-format +msgid "" +"Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has " +"a higher, incompatible protocol version (%3$s)." +msgstr "tjänsteleverantörer plånboken" + +#: src/webex/pages/withdraw.tsx:290 +#, fuzzy, c-format +msgid "" +"The chosen exchange (protocol version %1$s might be outdated.%2$s The " +"exchange has a lower, incompatible protocol version than your wallet " +"(protocol version %3$s)." +msgstr "tjänsteleverantörer plånboken" + +#: src/webex/pages/withdraw.tsx:309 +#, c-format +msgid "Accept fees and withdraw" +msgstr "Acceptera avgifter och utbetala" + +#: src/webex/pages/withdraw.tsx:314 +#, c-format +msgid "Change Exchange Provider" +msgstr "Ändra tjänsteleverantörer" + +#: src/webex/pages/withdraw.tsx:335 +#, c-format +msgid "" +"Please select an exchange. You can review the details before after your " +"selection." +msgstr "" + +#: src/webex/pages/withdraw.tsx:341 src/webex/pages/withdraw.tsx:353 +#, fuzzy, c-format +msgid "Select %1$s" +msgstr "Välj %1$s" + +#: src/webex/pages/withdraw.tsx:370 +#, fuzzy, c-format +msgid "You are about to withdraw %1$s from your bank account into your wallet." +msgstr "" +"Du är på väg att ta ut\n" +" %1$s från ditt bankkonto till din plånbok.\n" + +#: src/webex/pages/withdraw.tsx:459 +#, fuzzy, c-format +msgid "" +"Oops, something went wrong. The wallet responded with error status (%1$s)." +msgstr "plånboken" + +#: src/webex/pages/withdraw.tsx:468 +#, c-format +msgid "Checking URL, please wait ..." +msgstr "" + +#: src/webex/pages/withdraw.tsx:482 +#, c-format +msgid "Can't parse amount: %1$s" +msgstr "" + +#: src/webex/pages/withdraw.tsx:489 +#, c-format +msgid "Can't parse wire_types: %1$s" +msgstr "" + #: src/webex/renderHtml.tsx:225 #, c-format msgid "Withdrawal fees:" diff --git a/src/i18n/taler-wallet-webex.pot b/src/i18n/taler-wallet-webex.pot index e7615e41c..1f0dc2a47 100644 --- a/src/i18n/taler-wallet-webex.pot +++ b/src/i18n/taler-wallet-webex.pot @@ -37,28 +37,28 @@ msgstr "" msgid "time (ms/op)" msgstr "" -#: src/webex/pages/confirm-contract.tsx:78 +#: src/webex/pages/pay.tsx:78 #, c-format msgid "show more details" msgstr "" -#: src/webex/pages/confirm-contract.tsx:92 +#: src/webex/pages/pay.tsx:92 #, c-format msgid "Accepted exchanges:" msgstr "" -#: src/webex/pages/confirm-contract.tsx:97 +#: src/webex/pages/pay.tsx:97 #, c-format msgid "Exchanges in the wallet:" msgstr "" -#: src/webex/pages/confirm-contract.tsx:219 +#: src/webex/pages/pay.tsx:219 #, c-format msgid "You have insufficient funds of the requested currency in your wallet." msgstr "" #. tslint:disable-next-line:max-line-length -#: src/webex/pages/confirm-contract.tsx:221 +#: src/webex/pages/pay.tsx:221 #, c-format msgid "" "You do not have any funds from an exchange that is accepted by this " @@ -66,180 +66,58 @@ msgid "" "wallet." msgstr "" -#: src/webex/pages/confirm-contract.tsx:322 +#: src/webex/pages/pay.tsx:322 #, c-format msgid "Confirm payment" msgstr "" -#: src/webex/pages/confirm-contract.tsx:332 +#: src/webex/pages/pay.tsx:332 #, c-format msgid "Submitting payment" msgstr "" -#: src/webex/pages/confirm-contract.tsx:343 +#: src/webex/pages/pay.tsx:343 #, c-format msgid "" "You already paid for this, clicking \"Confirm payment\" will not cost money " "again." msgstr "" -#: src/webex/pages/confirm-contract.tsx:357 +#: src/webex/pages/pay.tsx:357 #, c-format msgid "Aborting payment ..." msgstr "" -#: src/webex/pages/confirm-contract.tsx:359 +#: src/webex/pages/pay.tsx:359 #, c-format msgid "Payment aborted!" msgstr "" -#: src/webex/pages/confirm-contract.tsx:362 +#: src/webex/pages/pay.tsx:362 #, c-format msgid "Retry Payment" msgstr "" -#: src/webex/pages/confirm-contract.tsx:365 +#: src/webex/pages/pay.tsx:365 #, c-format msgid "Abort Payment" msgstr "" -#: src/webex/pages/confirm-contract.tsx:374 +#: src/webex/pages/pay.tsx:374 #, c-format msgid "The merchant %1$s offers you to purchase:" msgstr "" -#: src/webex/pages/confirm-contract.tsx:383 +#: src/webex/pages/pay.tsx:383 #, c-format msgid "The total price is %1$s (plus %2$s fees)." msgstr "" -#: src/webex/pages/confirm-contract.tsx:387 +#: src/webex/pages/pay.tsx:387 #, c-format msgid "The total price is %1$s." msgstr "" -#: src/webex/pages/confirm-create-reserve.tsx:128 -#, c-format -msgid "Select" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:145 -#, c-format -msgid "Error: URL may not be relative" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:160 -#, c-format -msgid "Invalid exchange URL (%1$s)" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:210 -#, c-format -msgid "The exchange is trusted by the wallet." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:216 -#, c-format -msgid "The exchange is audited by a trusted auditor." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:222 -#, c-format -msgid "" -"Warning: The exchange is neither directly trusted nor audited by a trusted " -"auditor. If you withdraw from this exchange, it will be trusted in the " -"future." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:231 -#, c-format -msgid "" -"Using exchange provider %1$s. The exchange provider will charge %2$s in fees." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:243 -#, c-format -msgid "Waiting for a response from %1$s %2$s" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:260 -#, c-format -msgid "" -"Information about fees will be available when an exchange provider is " -"selected." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:279 -#, c-format -msgid "" -"Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has " -"a higher, incompatible protocol version (%3$s)." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:290 -#, c-format -msgid "" -"The chosen exchange (protocol version %1$s might be outdated.%2$s The " -"exchange has a lower, incompatible protocol version than your wallet " -"(protocol version %3$s)." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:309 -#, c-format -msgid "Accept fees and withdraw" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:314 -#, c-format -msgid "Change Exchange Provider" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:335 -#, c-format -msgid "" -"Please select an exchange. You can review the details before after your " -"selection." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:341 -#: src/webex/pages/confirm-create-reserve.tsx:353 -#, c-format -msgid "Select %1$s" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:370 -#, c-format -msgid "You are about to withdraw %1$s from your bank account into your wallet." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:459 -#, c-format -msgid "" -"Oops, something went wrong. The wallet responded with error status (%1$s)." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:468 -#, c-format -msgid "Checking URL, please wait ..." -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:482 -#, c-format -msgid "Can't parse amount: %1$s" -msgstr "" - -#: src/webex/pages/confirm-create-reserve.tsx:489 -#, c-format -msgid "Can't parse wire_types: %1$s" -msgstr "" - -#. #-#-#-#-# - (PACKAGE VERSION) #-#-#-#-# -#. TODO:generic error reporting function or component. -#: src/webex/pages/confirm-create-reserve.tsx:519 src/webex/pages/tip.tsx:180 -#, c-format -msgid "Fatal error: \"%1$s\"." -msgstr "" - #: src/webex/pages/popup.tsx:165 #, c-format msgid "Balance" @@ -370,6 +248,127 @@ msgstr "" msgid "Cancel" msgstr "" +#. #-#-#-#-# - (PACKAGE VERSION) #-#-#-#-# +#. TODO:generic error reporting function or component. +#: src/webex/pages/tip.tsx:180 src/webex/pages/withdraw.tsx:519 +#, c-format +msgid "Fatal error: \"%1$s\"." +msgstr "" + +#: src/webex/pages/withdraw.tsx:128 +#, c-format +msgid "Select" +msgstr "" + +#: src/webex/pages/withdraw.tsx:145 +#, c-format +msgid "Error: URL may not be relative" +msgstr "" + +#: src/webex/pages/withdraw.tsx:160 +#, c-format +msgid "Invalid exchange URL (%1$s)" +msgstr "" + +#: src/webex/pages/withdraw.tsx:210 +#, c-format +msgid "The exchange is trusted by the wallet." +msgstr "" + +#: src/webex/pages/withdraw.tsx:216 +#, c-format +msgid "The exchange is audited by a trusted auditor." +msgstr "" + +#: src/webex/pages/withdraw.tsx:222 +#, c-format +msgid "" +"Warning: The exchange is neither directly trusted nor audited by a trusted " +"auditor. If you withdraw from this exchange, it will be trusted in the " +"future." +msgstr "" + +#: src/webex/pages/withdraw.tsx:231 +#, c-format +msgid "" +"Using exchange provider %1$s. The exchange provider will charge %2$s in fees." +msgstr "" + +#: src/webex/pages/withdraw.tsx:243 +#, c-format +msgid "Waiting for a response from %1$s %2$s" +msgstr "" + +#: src/webex/pages/withdraw.tsx:260 +#, c-format +msgid "" +"Information about fees will be available when an exchange provider is " +"selected." +msgstr "" + +#: src/webex/pages/withdraw.tsx:279 +#, c-format +msgid "" +"Your wallet (protocol version %1$s) might be outdated.%2$s The exchange has " +"a higher, incompatible protocol version (%3$s)." +msgstr "" + +#: src/webex/pages/withdraw.tsx:290 +#, c-format +msgid "" +"The chosen exchange (protocol version %1$s might be outdated.%2$s The " +"exchange has a lower, incompatible protocol version than your wallet " +"(protocol version %3$s)." +msgstr "" + +#: src/webex/pages/withdraw.tsx:309 +#, c-format +msgid "Accept fees and withdraw" +msgstr "" + +#: src/webex/pages/withdraw.tsx:314 +#, c-format +msgid "Change Exchange Provider" +msgstr "" + +#: src/webex/pages/withdraw.tsx:335 +#, c-format +msgid "" +"Please select an exchange. You can review the details before after your " +"selection." +msgstr "" + +#: src/webex/pages/withdraw.tsx:341 src/webex/pages/withdraw.tsx:353 +#, c-format +msgid "Select %1$s" +msgstr "" + +#: src/webex/pages/withdraw.tsx:370 +#, c-format +msgid "You are about to withdraw %1$s from your bank account into your wallet." +msgstr "" + +#: src/webex/pages/withdraw.tsx:459 +#, c-format +msgid "" +"Oops, something went wrong. The wallet responded with error status (%1$s)." +msgstr "" + +#: src/webex/pages/withdraw.tsx:468 +#, c-format +msgid "Checking URL, please wait ..." +msgstr "" + +#: src/webex/pages/withdraw.tsx:482 +#, c-format +msgid "Can't parse amount: %1$s" +msgstr "" + +#: src/webex/pages/withdraw.tsx:489 +#, c-format +msgid "Can't parse wire_types: %1$s" +msgstr "" + #: src/webex/renderHtml.tsx:225 #, c-format msgid "Withdrawal fees:" diff --git a/src/wallet.ts b/src/wallet.ts index b6a9361c1..e476c94f6 100644 --- a/src/wallet.ts +++ b/src/wallet.ts @@ -105,6 +105,8 @@ import { WalletBalanceEntry, PreparePayResult, DownloadedWithdrawInfo, + WithdrawDetails, + AcceptWithdrawalResponse, } from "./walletTypes"; import { openPromise } from "./promiseUtils"; import { parsePayUri, parseWithdrawUri } from "./taleruri"; @@ -717,6 +719,12 @@ export class Wallet { return t; } + getNextUrl(contractTerms: ContractTerms): string { + const fu = new URI(contractTerms.fulfillment_url); + fu.addSearch("order_id", contractTerms.order_id); + return fu.href(); + } + async preparePay(url: string): Promise { const uriResult = parsePayUri(url); @@ -760,17 +768,20 @@ export class Wallet { uriResult.sessionId, ); return { - status: "session-replayed", + status: "paid", contractTerms: existingPayment.contractTerms, + nextUrl: this.getNextUrl(existingPayment.contractTerms), }; } } if (checkResult.status === "paid") { + const nextUrl = this.getNextUrl(proposal.contractTerms); return { status: "paid", contractTerms: proposal.contractTerms, proposalId: proposal.id!, + nextUrl, }; } if (checkResult.status === "insufficient-balance") { @@ -912,14 +923,6 @@ export class Wallet { modifiedCoins.push(c); } - const fu = new URI(purchase.contractTerms.fulfillment_url); - fu.addSearch("order_id", purchase.contractTerms.order_id); - if (merchantResp.session_sig) { - purchase.lastSessionSig = merchantResp.session_sig; - purchase.lastSessionId = sessionId; - fu.addSearch("session_sig", merchantResp.session_sig); - } - await this.q() .putAll(Stores.coins, modifiedCoins) .put(Stores.purchases, purchase) @@ -928,7 +931,7 @@ export class Wallet { this.refresh(c.coin_pub); } - const nextUrl = fu.href(); + const nextUrl = this.getNextUrl(purchase.contractTerms); this.cachedNextUrl[purchase.contractTerms.fulfillment_url] = { nextUrl, lastSessionId: sessionId, @@ -1150,6 +1153,54 @@ export class Wallet { return t; } + private async sendReserveInfoToBank(reservePub: string) { + const reserve = await this.q().get( + Stores.reserves, + reservePub, + ); + if (!reserve) { + throw Error("reserve not in db"); + } + + const bankStatusUrl = reserve.bankWithdrawStatusUrl; + if (!bankStatusUrl) { + throw Error("reserve not confirmed yet, and no status URL available."); + } + + const now = new Date().getTime(); + let status; + try { + const statusResp = await this.http.get(bankStatusUrl); + status = WithdrawOperationStatusResponse.checked(statusResp.responseJson); + } catch (e) { + console.log("bank error response", e); + throw e; + } + + if (status.transfer_done) { + await this.q().mutate(Stores.reserves, reservePub, r => { + r.timestamp_confirmed = now; + return r; + }); + } else if (reserve.timestamp_reserve_info_posted === 0) { + try { + if (!status.selection_done) { + const bankResp = await this.http.postJson(bankStatusUrl, { + reserve_pub: reservePub, + selected_exchange: reserve.exchangeWire, + }); + } + } catch (e) { + console.log("bank error response", e); + throw e; + } + await this.q().mutate(Stores.reserves, reservePub, r => { + r.timestamp_reserve_info_posted = now; + return r; + }); + } + } + /** * First fetch information requred to withdraw from the reserve, * then deplete the reserve, withdrawing coins until it is empty. @@ -1192,41 +1243,10 @@ export class Wallet { ); } maxTimeout = 2000; - const now = new Date().getTime(); - let status; - try { - const statusResp = await this.http.get(bankStatusUrl); - status = WithdrawOperationStatusResponse.checked( - statusResp.responseJson, - ); - } catch (e) { - console.log("bank error response", e); - throw e; - } - - if (status.transfer_done) { - await this.q().mutate(Stores.reserves, reservePub, r => { - r.timestamp_confirmed = now; - return r; - }); - } else if (reserve.timestamp_reserve_info_posted === 0) { - try { - if (!status.selection_done) { - const bankResp = await this.http.postJson(bankStatusUrl, { - reserve_pub: reservePub, - selected_exchange: reserve.exchangeWire, - }); - } - } catch (e) { - console.log("bank error response", e); - throw e; - } - await this.q().mutate(Stores.reserves, reservePub, r => { - r.timestamp_reserve_info_posted = now; - return r; - }); - throw Error("waiting for reserve to be confirmed"); - } + /* This path is only taken if the wallet crashed after a withdraw was accepted, + * and before the information could be sent to the bank. */ + await this.sendReserveInfoToBank(reservePub); + throw Error("waiting for reserve to be confirmed"); } const updatedReserve = await this.updateReserve(reservePub); @@ -1836,6 +1856,24 @@ export class Wallet { return { isTrusted, isAudited }; } + async getWithdrawDetails( + talerPayUri: string, + maybeSelectedExchange?: string, + ): Promise { + const info = await this.downloadWithdrawInfo(talerPayUri); + let rci: ReserveCreationInfo | undefined = undefined; + if (maybeSelectedExchange) { + rci = await this.getReserveCreationInfo( + maybeSelectedExchange, + info.amount, + ); + } + return { + withdrawInfo: info, + reserveCreationInfo: rci, + }; + } + async getReserveCreationInfo( baseUrl: string, amount: AmountJson, @@ -3514,16 +3552,6 @@ export class Wallet { ); } - /** - * Synchronously get the paid URL for a resource from the plain fulfillment - * URL. Returns undefined if the fulfillment URL is not a resource that was - * payed for, or if it is not cached anymore. Use the asynchronous - * queryPaymentByFulfillmentUrl to avoid false negatives. - */ - getNextUrlFromResourceUrl(resourceUrl: string): NextUrlResult | undefined { - return this.cachedNextUrl[resourceUrl]; - } - /** * Remove unreferenced / expired data from the wallet's database * based on the current system time. @@ -3557,10 +3585,10 @@ export class Wallet { }; } - async createReserveFromWithdrawUrl( + async acceptWithdrawal( talerWithdrawUri: string, selectedExchange: string, - ): Promise<{ reservePub: string; confirmTransferUrl?: string }> { + ): Promise { const withdrawInfo = await this.downloadWithdrawInfo(talerWithdrawUri); const exchangeWire = await this.getExchangePaytoUri( selectedExchange, @@ -3573,6 +3601,7 @@ export class Wallet { senderWire: withdrawInfo.senderWire, exchangeWire: exchangeWire, }); + await this.sendReserveInfoToBank(reserve.reservePub); return { reservePub: reserve.reservePub, confirmTransferUrl: withdrawInfo.confirmTransferUrl, diff --git a/src/walletTypes.ts b/src/walletTypes.ts index abe9f2712..c657ac02a 100644 --- a/src/walletTypes.ts +++ b/src/walletTypes.ts @@ -37,12 +37,7 @@ import { ExchangeWireFeesRecord, TipRecord, } from "./dbTypes"; -import { - CoinPaySig, - ContractTerms, - PayReq, -} from "./talerTypes"; - +import { CoinPaySig, ContractTerms, PayReq } from "./talerTypes"; /** * Response for the create reserve request to the wallet. @@ -69,7 +64,6 @@ export class CreateReserveResponse { static checked: (obj: any) => CreateReserveResponse; } - /** * Information about what will happen when creating a reserve. * @@ -138,7 +132,7 @@ export interface ReserveCreationInfo { * * Older exchanges don't return version information. */ - versionMatch: LibtoolVersion.VersionMatchResult|undefined; + versionMatch: LibtoolVersion.VersionMatchResult | undefined; /** * Libtool-style version string for the exchange or "unknown" @@ -152,6 +146,10 @@ export interface ReserveCreationInfo { walletVersion: string; } +export interface WithdrawDetails { + withdrawInfo: DownloadedWithdrawInfo; + reserveCreationInfo: ReserveCreationInfo | undefined; +} /** * Mapping from currency/exchange to detailed balance @@ -169,7 +167,6 @@ export interface WalletBalance { byCurrency: { [currency: string]: WalletBalanceEntry }; } - /** * Detailed wallet balance for a particular currency. */ @@ -192,7 +189,6 @@ export interface WalletBalanceEntry { paybackAmount: AmountJson; } - /** * Coins used for a payment, with signatures authorizing the payment and the * coins with remaining value updated to accomodate for a payment. @@ -203,7 +199,6 @@ export interface PayCoinInfo { sigs: CoinPaySig[]; } - /** * Listener for notifications from the wallet. */ @@ -214,15 +209,17 @@ export interface Notifier { notify(): void; } - /** * For terseness. */ -export function mkAmount(value: number, fraction: number, currency: string): AmountJson { - return {value, fraction, currency}; +export function mkAmount( + value: number, + fraction: number, + currency: string, +): AmountJson { + return { value, fraction, currency }; } - /** * Possible results for checkPay. */ @@ -231,7 +228,6 @@ export interface CheckPayResult { coinSelection?: CoinSelectionResult; } - /** * Result for confirmPay */ @@ -239,7 +235,6 @@ export interface ConfirmPayResult { nextUrl: string; } - /** * Activity history record. */ @@ -266,7 +261,6 @@ export interface HistoryRecord { detail: any; } - /** * Query payment response when the payment was found. */ @@ -274,7 +268,6 @@ export interface QueryPaymentNotFound { found: false; } - /** * Query payment response when the payment wasn't found. */ @@ -288,7 +281,6 @@ export interface QueryPaymentFound { proposalId: number; } - /** * Information about all sender wire details known to the wallet, * as well as exchanges that accept these wire types. @@ -306,7 +298,6 @@ export interface SenderWireInfos { senderWires: string[]; } - /** * Request to mark a reserve as confirmed. */ @@ -351,7 +342,6 @@ export class CreateReserveRequest { static checked: (obj: any) => CreateReserveRequest; } - /** * Request to mark a reserve as confirmed. */ @@ -371,7 +361,6 @@ export class ConfirmReserveRequest { static checked: (obj: any) => ConfirmReserveRequest; } - /** * Wire coins to the user's own bank account. */ @@ -403,7 +392,6 @@ export class ReturnCoinsRequest { static checked: (obj: any) => ReturnCoinsRequest; } - /** * Result of selecting coins, contains the exchange, and selected * coins with their denomination. @@ -418,7 +406,6 @@ export interface CoinSelectionResult { totalAmount: AmountJson; } - /** * Named tuple of coin and denomination. */ @@ -446,7 +433,6 @@ export interface TipStatus { tipRecord?: TipRecord; } - /** * Badge that shows activity for the wallet. */ @@ -477,7 +463,6 @@ export interface BenchmarkResult { repetitions: number; } - /** * Cached next URL for a particular session id. */ @@ -486,14 +471,38 @@ export interface NextUrlResult { lastSessionId: string | undefined; } -export interface PreparePayResult { - status: "paid" | "session-replayed" | "insufficient-balance" | "payment-possible" | "error"; - contractTerms?: ContractTerms; - error?: string; +export type PreparePayResult = + | PreparePayResultError + | PreparePayResultInsufficientBalance + | PreparePayResultPaid + | PreparePayResultPaymentPossible; + +export interface PreparePayResultPaymentPossible { + status: "payment-possible"; proposalId?: number; + contractTerms?: ContractTerms; totalFees?: AmountJson; } +export interface PreparePayResultInsufficientBalance { + status: "insufficient-balance"; + proposalId?: number; + contractTerms?: ContractTerms; + totalFees?: AmountJson; +} + +export interface PreparePayResultError { + status: "error"; + error: string; +} + +export interface PreparePayResultPaid { + status: "paid"; + proposalId?: number; + contractTerms?: ContractTerms; + nextUrl: string; +} + export interface DownloadedWithdrawInfo { selectionDone: boolean; transferDone: boolean; @@ -503,4 +512,9 @@ export interface DownloadedWithdrawInfo { confirmTransferUrl?: string; wireTypes: string[]; extractedStatusUrl: string; -} \ No newline at end of file +} + +export interface AcceptWithdrawalResponse { + reservePub: string; + confirmTransferUrl?: string; +} diff --git a/src/webex/messages.ts b/src/webex/messages.ts index 8bb9cafe5..ca0e1c7e1 100644 --- a/src/webex/messages.ts +++ b/src/webex/messages.ts @@ -32,12 +32,12 @@ import { UpgradeResponse } from "./wxApi"; * Message type information. */ export interface MessageMap { - "balances": { - request: { }; + balances: { + request: {}; response: walletTypes.WalletBalance; }; "dump-db": { - request: { }; + request: {}; response: any; }; "import-db": { @@ -46,18 +46,18 @@ export interface MessageMap { }; response: void; }; - "ping": { - request: { }; + ping: { + request: {}; response: void; }; "reset-db": { - request: { }; + request: {}; response: void; }; "create-reserve": { request: { amount: AmountJson; - exchange: string + exchange: string; }; response: void; }; @@ -70,11 +70,11 @@ export interface MessageMap { response: walletTypes.ConfirmPayResult; }; "check-pay": { - request: { proposalId: number; }; + request: { proposalId: number }; response: walletTypes.CheckPayResult; }; "query-payment": { - request: { }; + request: {}; response: dbTypes.PurchaseRecord; }; "exchange-info": { @@ -90,11 +90,11 @@ export interface MessageMap { response: string; }; "reserve-creation-info": { - request: { baseUrl: string, amount: AmountJson }; + request: { baseUrl: string; amount: AmountJson }; response: walletTypes.ReserveCreationInfo; }; "get-history": { - request: { }; + request: {}; response: walletTypes.HistoryRecord[]; }; "get-proposal": { @@ -110,7 +110,7 @@ export interface MessageMap { response: any; }; "get-currencies": { - request: { }; + request: {}; response: dbTypes.CurrencyRecord[]; }; "update-currency": { @@ -118,7 +118,7 @@ export interface MessageMap { response: void; }; "get-exchanges": { - request: { }; + request: {}; response: dbTypes.ExchangeRecord[]; }; "get-reserves": { @@ -126,7 +126,7 @@ export interface MessageMap { response: dbTypes.ReserveRecord[]; }; "get-payback-reserves": { - request: { }; + request: {}; response: dbTypes.ReserveRecord[]; }; "withdraw-payback-reserve": { @@ -146,15 +146,15 @@ export interface MessageMap { response: void; }; "check-upgrade": { - request: { }; + request: {}; response: UpgradeResponse; }; "get-sender-wire-infos": { - request: { }; + request: {}; response: walletTypes.SenderWireInfos; }; "return-coins": { - request: { }; + request: {}; response: void; }; "log-and-display-error": { @@ -182,7 +182,7 @@ export interface MessageMap { response: walletTypes.TipStatus; }; "clear-notification": { - request: { }; + request: {}; response: void; }; "taler-pay": { @@ -194,23 +194,36 @@ export interface MessageMap { response: number; }; "submit-pay": { - request: { contractTermsHash: string, sessionId: string | undefined }; + request: { contractTermsHash: string; sessionId: string | undefined }; response: walletTypes.ConfirmPayResult; }; "accept-refund": { - request: { refundUrl: string } + request: { refundUrl: string }; response: string; }; "abort-failed-payment": { - request: { contractTermsHash: string } + request: { contractTermsHash: string }; response: void; }; "benchmark-crypto": { - request: { repetitions: number } + request: { repetitions: number }; response: walletTypes.BenchmarkResult; }; + "get-withdraw-details": { + request: { talerWithdrawUri: string; maybeSelectedExchange: string | undefined }; + response: walletTypes.WithdrawDetails; + }; + "accept-withdrawal": { + request: { talerWithdrawUri: string; selectedExchange: string }; + response: walletTypes.AcceptWithdrawalResponse; + }; + "prepare-pay": { + request: { talerPayUri: string }; + response: walletTypes.PreparePayResult; + }; } + /** * String literal types for messages. */ @@ -219,14 +232,19 @@ export type MessageType = keyof MessageMap; /** * Make a request whose details match the request type. */ -export function makeRequest(type: T, details: MessageMap[T]["request"]) { +export function makeRequest( + type: T, + details: MessageMap[T]["request"], +) { return { type, details }; } /** * Make a response that matches the request type. */ -export function makeResponse(type: T, response: MessageMap[T]["response"]) { +export function makeResponse( + type: T, + response: MessageMap[T]["response"], +) { return response; } - diff --git a/src/webex/pages/confirm-contract.tsx b/src/webex/pages/confirm-contract.tsx deleted file mode 100644 index d24613794..000000000 --- a/src/webex/pages/confirm-contract.tsx +++ /dev/null @@ -1,417 +0,0 @@ -/* - This file is part of TALER - (C) 2015 GNUnet e.V. - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see - */ - -/** - * Page shown to the user to confirm entering - * a contract. - */ - - -/** - * Imports. - */ -import * as i18n from "../../i18n"; - -import { runOnceWhenReady } from "./common"; - -import { - ExchangeRecord, - ProposalDownloadRecord, -} from "../../dbTypes"; -import { ContractTerms } from "../../talerTypes"; -import { - CheckPayResult, -} from "../../walletTypes"; - -import { renderAmount } from "../renderHtml"; -import * as wxApi from "../wxApi"; - -import * as React from "react"; -import * as ReactDOM from "react-dom"; -import URI = require("urijs"); -import { WalletApiError } from "../wxApi"; - -import * as Amounts from "../../amounts"; - - -interface DetailState { - collapsed: boolean; -} - -interface DetailProps { - contractTerms: ContractTerms; - collapsed: boolean; - exchanges: ExchangeRecord[] | undefined; -} - - -class Details extends React.Component { - constructor(props: DetailProps) { - super(props); - console.log("new Details component created"); - this.state = { - collapsed: props.collapsed, - }; - - console.log("initial state:", this.state); - } - - render() { - if (this.state.collapsed) { - return ( -
- -
- ); - } else { - return ( -
- -
- {i18n.str`Accepted exchanges:`} -
    - {this.props.contractTerms.exchanges.map( - (e) =>
  • {`${e.url}: ${e.master_pub}`}
  • )} -
- {i18n.str`Exchanges in the wallet:`} -
    - {(this.props.exchanges || []).map( - (e: ExchangeRecord) => -
  • {`${e.baseUrl}: ${e.masterPublicKey}`}
  • )} -
-
-
); - } - } -} - -interface ContractPromptProps { - proposalId?: number; - contractUrl?: string; - sessionId?: string; - resourceUrl?: string; -} - -interface ContractPromptState { - proposalId: number | undefined; - proposal: ProposalDownloadRecord | undefined; - checkPayError: string | undefined; - confirmPayError: object | undefined; - payDisabled: boolean; - alreadyPaid: boolean; - exchanges: ExchangeRecord[] | undefined; - /** - * Don't request updates to proposal state while - * this is set to true, to avoid UI flickering - * when pressing pay. - */ - holdCheck: boolean; - payStatus?: CheckPayResult; - replaying: boolean; - payInProgress: boolean; - payAttempt: number; - working: boolean; - abortDone: boolean; - abortStarted: boolean; -} - -class ContractPrompt extends React.Component { - constructor(props: ContractPromptProps) { - super(props); - this.state = { - abortDone: false, - abortStarted: false, - alreadyPaid: false, - checkPayError: undefined, - confirmPayError: undefined, - exchanges: undefined, - holdCheck: false, - payAttempt: 0, - payDisabled: true, - payInProgress: false, - proposal: undefined, - proposalId: props.proposalId, - replaying: false, - working: false, - }; - } - - componentWillMount() { - this.update(); - } - - componentWillUnmount() { - // FIXME: abort running ops - } - - async update() { - if (this.props.resourceUrl) { - const p = await wxApi.queryPaymentByFulfillmentUrl(this.props.resourceUrl); - console.log("query for resource url", this.props.resourceUrl, "result", p); - if (p && p.finished) { - if (p.lastSessionSig === undefined || p.lastSessionSig === this.props.sessionId) { - const nextUrl = new URI(p.contractTerms.fulfillment_url); - nextUrl.addSearch("order_id", p.contractTerms.order_id); - if (p.lastSessionSig) { - nextUrl.addSearch("session_sig", p.lastSessionSig); - } - location.replace(nextUrl.href()); - return; - } else { - // We're in a new session - this.setState({ replaying: true }); - // FIXME: This could also go wrong. However the payment - // was already successful once, so we can just retry and not refund it. - const payResult = await wxApi.submitPay(p.contractTermsHash, this.props.sessionId); - console.log("payResult", payResult); - location.replace(payResult.nextUrl); - return; - } - } - } - let proposalId = this.props.proposalId; - if (proposalId === undefined) { - if (this.props.contractUrl === undefined) { - // Nothing we can do ... - return; - } - proposalId = await wxApi.downloadProposal(this.props.contractUrl); - } - const proposal = await wxApi.getProposal(proposalId); - this.setState({ proposal, proposalId }); - this.checkPayment(); - const exchanges = await wxApi.getExchanges(); - this.setState({ exchanges }); - } - - async checkPayment() { - window.setTimeout(() => this.checkPayment(), 500); - if (this.state.holdCheck) { - return; - } - const proposalId = this.state.proposalId; - if (proposalId === undefined) { - return; - } - const payStatus = await wxApi.checkPay(proposalId); - if (payStatus.status === "insufficient-balance") { - const msgInsufficient = i18n.str`You have insufficient funds of the requested currency in your wallet.`; - // tslint:disable-next-line:max-line-length - const msgNoMatch = i18n.str`You do not have any funds from an exchange that is accepted by this merchant. None of the exchanges accepted by the merchant is known to your wallet.`; - if (this.state.exchanges && this.state.proposal) { - const acceptedExchangePubs = this.state.proposal.contractTerms.exchanges.map((e) => e.master_pub); - const ex = this.state.exchanges.find((e) => acceptedExchangePubs.indexOf(e.masterPublicKey) >= 0); - if (ex) { - this.setState({ checkPayError: msgInsufficient }); - } else { - this.setState({ checkPayError: msgNoMatch }); - } - } else { - this.setState({ checkPayError: msgInsufficient }); - } - this.setState({ payDisabled: true }); - } else if (payStatus.status === "paid") { - this.setState({ alreadyPaid: true, payDisabled: false, checkPayError: undefined, payStatus }); - } else { - this.setState({ payDisabled: false, checkPayError: undefined, payStatus }); - } - } - - async doPayment() { - const proposal = this.state.proposal; - this.setState({ holdCheck: true, payAttempt: this.state.payAttempt + 1}); - if (!proposal) { - return; - } - const proposalId = proposal.id; - if (proposalId === undefined) { - console.error("proposal has no id"); - return; - } - console.log("confirmPay with", proposalId, "and", this.props.sessionId); - let payResult; - this.setState({ working: true }); - try { - payResult = await wxApi.confirmPay(proposalId, this.props.sessionId); - } catch (e) { - if (!(e instanceof WalletApiError)) { - throw e; - } - this.setState({ confirmPayError: e.detail }); - return; - } - console.log("payResult", payResult); - document.location.replace(payResult.nextUrl); - this.setState({ holdCheck: true }); - } - - - async abortPayment() { - const proposal = this.state.proposal; - this.setState({ holdCheck: true, abortStarted: true }); - if (!proposal) { - return; - } - wxApi.abortFailedPayment(proposal.contractTermsHash); - this.setState({ abortDone: true }); - } - - - render() { - if (this.props.contractUrl === undefined && this.props.proposalId === undefined) { - return Error: either contractUrl or proposalId must be given; - } - if (this.state.replaying) { - return Re-submitting existing payment; - } - if (this.state.proposalId === undefined) { - return Downloading contract terms; - } - if (!this.state.proposal) { - return ...; - } - const c = this.state.proposal.contractTerms; - let merchantName; - if (c.merchant && c.merchant.name) { - merchantName = {c.merchant.name}; - } else { - merchantName = (pub: {c.merchant_pub}); - } - const amount = {renderAmount(Amounts.parseOrThrow(c.amount))}; - console.log("payStatus", this.state.payStatus); - - let products = null; - if (c.products.length) { - products = ( -
- The following items are included: -
    - {c.products.map( - (p: any, i: number) => (
  • {p.description}: {renderAmount(p.price)}
  • )) - } -
-
- ); - } - - const ConfirmButton = () => ( - - ); - - const WorkingButton = () => ( -
-