fix contract terms normalization
This commit is contained in:
parent
7719d4d249
commit
038aa948eb
@ -63,10 +63,7 @@ export function canonicalJson(obj: any): string {
|
|||||||
// Check for cycles, etc.
|
// Check for cycles, etc.
|
||||||
obj = JSON.parse(JSON.stringify(obj));
|
obj = JSON.parse(JSON.stringify(obj));
|
||||||
if (typeof obj === "string") {
|
if (typeof obj === "string") {
|
||||||
const s = JSON.stringify(obj);
|
return JSON.stringify(obj);
|
||||||
return s.replace(/[\u007F-\uFFFF]/g, function (chr) {
|
|
||||||
return "\\u" + ("0000" + chr.charCodeAt(0).toString(16)).substr(-4);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
if (typeof obj === "number" || typeof obj === "boolean" || obj === null) {
|
if (typeof obj === "number" || typeof obj === "boolean" || obj === null) {
|
||||||
return JSON.stringify(obj);
|
return JSON.stringify(obj);
|
||||||
|
@ -49,6 +49,14 @@ export async function runPaymentTest(t: GlobalTestState) {
|
|||||||
|
|
||||||
await makeTestPayment(t, { wallet, merchant, order });
|
await makeTestPayment(t, { wallet, merchant, order });
|
||||||
|
|
||||||
|
const order2 = {
|
||||||
|
summary: "Testing “unicode” characters",
|
||||||
|
amount: "TESTKUDOS:5",
|
||||||
|
fulfillment_url: "taler://fulfillment-success/thx",
|
||||||
|
};
|
||||||
|
|
||||||
|
await makeTestPayment(t, { wallet, merchant, order: order2 });
|
||||||
|
|
||||||
await wallet.runUntilDone();
|
await wallet.runUntilDone();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user