fix bug in the WebExtensions pay page
This commit is contained in:
parent
adebfab94e
commit
266b33dc42
@ -57,27 +57,27 @@ msgstr ""
|
|||||||
msgid "time (ms/op)"
|
msgid "time (ms/op)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:117
|
#: src/webex/pages/pay.tsx:132
|
||||||
#, fuzzy, c-format
|
#, fuzzy, c-format
|
||||||
msgid "The merchant %1$s offers you to purchase:"
|
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."
|
msgstr "Der Händler %1$s möchte einen Vertrag über %2$s mit Ihnen abschließen."
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:123
|
#: src/webex/pages/pay.tsx:138
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "The total price is %1$s (plus %2$s fees)."
|
msgid "The total price is %1$s (plus %2$s fees)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:128
|
#: src/webex/pages/pay.tsx:143
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "The total price is %1$s."
|
msgid "The total price is %1$s."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:148
|
#: src/webex/pages/pay.tsx:163
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Retry"
|
msgid "Retry"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:157
|
#: src/webex/pages/pay.tsx:172
|
||||||
#, fuzzy, c-format
|
#, fuzzy, c-format
|
||||||
msgid "Confirm payment"
|
msgid "Confirm payment"
|
||||||
msgstr "Bezahlung bestätigen"
|
msgstr "Bezahlung bestätigen"
|
||||||
|
@ -57,27 +57,27 @@ msgstr ""
|
|||||||
msgid "time (ms/op)"
|
msgid "time (ms/op)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:117
|
#: src/webex/pages/pay.tsx:132
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "The merchant %1$s offers you to purchase:"
|
msgid "The merchant %1$s offers you to purchase:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:123
|
#: src/webex/pages/pay.tsx:138
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "The total price is %1$s (plus %2$s fees)."
|
msgid "The total price is %1$s (plus %2$s fees)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:128
|
#: src/webex/pages/pay.tsx:143
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "The total price is %1$s."
|
msgid "The total price is %1$s."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:148
|
#: src/webex/pages/pay.tsx:163
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Retry"
|
msgid "Retry"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:157
|
#: src/webex/pages/pay.tsx:172
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Confirm payment"
|
msgid "Confirm payment"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -57,27 +57,27 @@ msgstr ""
|
|||||||
msgid "time (ms/op)"
|
msgid "time (ms/op)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:117
|
#: src/webex/pages/pay.tsx:132
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "The merchant %1$s offers you to purchase:"
|
msgid "The merchant %1$s offers you to purchase:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:123
|
#: src/webex/pages/pay.tsx:138
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "The total price is %1$s (plus %2$s fees)."
|
msgid "The total price is %1$s (plus %2$s fees)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:128
|
#: src/webex/pages/pay.tsx:143
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "The total price is %1$s."
|
msgid "The total price is %1$s."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:148
|
#: src/webex/pages/pay.tsx:163
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Retry"
|
msgid "Retry"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:157
|
#: src/webex/pages/pay.tsx:172
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Confirm payment"
|
msgid "Confirm payment"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -57,27 +57,27 @@ msgstr ""
|
|||||||
msgid "time (ms/op)"
|
msgid "time (ms/op)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:117
|
#: src/webex/pages/pay.tsx:132
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "The merchant %1$s offers you to purchase:"
|
msgid "The merchant %1$s offers you to purchase:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:123
|
#: src/webex/pages/pay.tsx:138
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "The total price is %1$s (plus %2$s fees)."
|
msgid "The total price is %1$s (plus %2$s fees)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:128
|
#: src/webex/pages/pay.tsx:143
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "The total price is %1$s."
|
msgid "The total price is %1$s."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:148
|
#: src/webex/pages/pay.tsx:163
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Retry"
|
msgid "Retry"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:157
|
#: src/webex/pages/pay.tsx:172
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Confirm payment"
|
msgid "Confirm payment"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -57,27 +57,27 @@ msgstr ""
|
|||||||
msgid "time (ms/op)"
|
msgid "time (ms/op)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:117
|
#: src/webex/pages/pay.tsx:132
|
||||||
#, fuzzy, c-format
|
#, fuzzy, c-format
|
||||||
msgid "The merchant %1$s offers you to purchase:"
|
msgid "The merchant %1$s offers you to purchase:"
|
||||||
msgstr "Säljaren %1$s erbjuder följande:"
|
msgstr "Säljaren %1$s erbjuder följande:"
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:123
|
#: src/webex/pages/pay.tsx:138
|
||||||
#, fuzzy, c-format
|
#, fuzzy, c-format
|
||||||
msgid "The total price is %1$s (plus %2$s fees)."
|
msgid "The total price is %1$s (plus %2$s fees)."
|
||||||
msgstr "Det totala priset är %1$s (plus %2$s avgifter).\n"
|
msgstr "Det totala priset är %1$s (plus %2$s avgifter).\n"
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:128
|
#: src/webex/pages/pay.tsx:143
|
||||||
#, fuzzy, c-format
|
#, fuzzy, c-format
|
||||||
msgid "The total price is %1$s."
|
msgid "The total price is %1$s."
|
||||||
msgstr "Det totala priset är %1$s."
|
msgstr "Det totala priset är %1$s."
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:148
|
#: src/webex/pages/pay.tsx:163
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Retry"
|
msgid "Retry"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:157
|
#: src/webex/pages/pay.tsx:172
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Confirm payment"
|
msgid "Confirm payment"
|
||||||
msgstr "Godkän betalning"
|
msgstr "Godkän betalning"
|
||||||
|
@ -57,27 +57,27 @@ msgstr ""
|
|||||||
msgid "time (ms/op)"
|
msgid "time (ms/op)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:117
|
#: src/webex/pages/pay.tsx:132
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "The merchant %1$s offers you to purchase:"
|
msgid "The merchant %1$s offers you to purchase:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:123
|
#: src/webex/pages/pay.tsx:138
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "The total price is %1$s (plus %2$s fees)."
|
msgid "The total price is %1$s (plus %2$s fees)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:128
|
#: src/webex/pages/pay.tsx:143
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "The total price is %1$s."
|
msgid "The total price is %1$s."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:148
|
#: src/webex/pages/pay.tsx:163
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Retry"
|
msgid "Retry"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/webex/pages/pay.tsx:157
|
#: src/webex/pages/pay.tsx:172
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Confirm payment"
|
msgid "Confirm payment"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -106,6 +106,12 @@ class ObjectCodecBuilder<OutputType, PartialOutputType> {
|
|||||||
path: [`(${objectDisplayName})`],
|
path: [`(${objectDisplayName})`],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
if (typeof x !== "object") {
|
||||||
|
throw new DecodingError(
|
||||||
|
`expected object for ${objectDisplayName} at ${renderContext(
|
||||||
|
c,
|
||||||
|
)} but got ${typeof x}`)
|
||||||
|
}
|
||||||
const obj: any = {};
|
const obj: any = {};
|
||||||
for (const prop of propList) {
|
for (const prop of propList) {
|
||||||
const propRawVal = x[prop.name];
|
const propRawVal = x[prop.name];
|
||||||
|
@ -32,6 +32,7 @@ import * as wxApi from "../wxApi";
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
|
|
||||||
import * as Amounts from "../../util/amounts";
|
import * as Amounts from "../../util/amounts";
|
||||||
|
import { codecForContractTerms, ContractTerms } from "../../types/talerTypes";
|
||||||
|
|
||||||
function TalerPayDialog({ talerPayUri }: { talerPayUri: string }) {
|
function TalerPayDialog({ talerPayUri }: { talerPayUri: string }) {
|
||||||
const [payStatus, setPayStatus] = useState<PreparePayResult | undefined>();
|
const [payStatus, setPayStatus] = useState<PreparePayResult | undefined>();
|
||||||
@ -74,7 +75,21 @@ function TalerPayDialog({ talerPayUri }: { talerPayUri: string }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const contractTerms = payStatus.contractTermsRaw;
|
let contractTerms: ContractTerms;
|
||||||
|
|
||||||
|
try {
|
||||||
|
contractTerms = codecForContractTerms().decode(JSON.parse(payStatus.contractTermsRaw));
|
||||||
|
} catch (e) {
|
||||||
|
// This should never happen, as the wallet is supposed to check the contract terms
|
||||||
|
// before storing them.
|
||||||
|
console.error(e);
|
||||||
|
console.log("raw contract terms were", payStatus.contractTermsRaw);
|
||||||
|
return (
|
||||||
|
<span>
|
||||||
|
Invalid contract terms.
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (!contractTerms) {
|
if (!contractTerms) {
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user