fix CheckPaymentPaidResponse schema
This commit is contained in:
parent
7008de598d
commit
e259d109ef
@ -82,7 +82,7 @@ export const codecForCheckPaymentPaidResponse = (): Codec<
|
|||||||
CheckPaymentPaidResponse
|
CheckPaymentPaidResponse
|
||||||
> =>
|
> =>
|
||||||
buildCodecForObject<CheckPaymentPaidResponse>()
|
buildCodecForObject<CheckPaymentPaidResponse>()
|
||||||
.property("order_status_url", codecForConstString("paid"))
|
.property("order_status_url", codecForString())
|
||||||
.property("order_status", codecForConstString("paid"))
|
.property("order_status", codecForConstString("paid"))
|
||||||
.property("refunded", codecForBoolean())
|
.property("refunded", codecForBoolean())
|
||||||
.property("wired", codecForBoolean())
|
.property("wired", codecForBoolean())
|
||||||
|
@ -341,10 +341,17 @@ export function codecForConstString<V extends string>(s: V): Codec<V> {
|
|||||||
if (x === s) {
|
if (x === s) {
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
if (typeof x !== "string") {
|
||||||
|
throw new DecodingError(
|
||||||
|
`expected string constant "${s}" at ${renderContext(
|
||||||
|
c,
|
||||||
|
)} but got ${typeof x}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
throw new DecodingError(
|
throw new DecodingError(
|
||||||
`expected string constant "${s}" at ${renderContext(
|
`expected string constant "${s}" at ${renderContext(
|
||||||
c,
|
c,
|
||||||
)} but got ${typeof x}`,
|
)} but got string value "${x}"`,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -233,7 +233,7 @@ importers:
|
|||||||
taler-wallet-core: 'workspace:*'
|
taler-wallet-core: 'workspace:*'
|
||||||
tslib: ^2.0.1
|
tslib: ^2.0.1
|
||||||
typescript: ^3.9.7
|
typescript: ^3.9.7
|
||||||
lockfileVersion: 5.1
|
lockfileVersion: 5.2
|
||||||
packages:
|
packages:
|
||||||
/@ava/typescript/1.1.1:
|
/@ava/typescript/1.1.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
Loading…
Reference in New Issue
Block a user