diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-12-19 20:42:49 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-12-19 20:42:49 +0100 |
commit | 0c9358c1b2bd80e25940022e86bd8daef8184ad7 (patch) | |
tree | a8c8ca0134bd886d8151633aff4c85e9513ad32c /src/headless/merchant.ts | |
parent | 49e3b3e5b9bbf1ce356ef68f301d50c689ceecb9 (diff) | |
download | wallet-core-0c9358c1b2bd80e25940022e86bd8daef8184ad7.tar.xz |
new date format, replace checkable annotations with codecs
Diffstat (limited to 'src/headless/merchant.ts')
-rw-r--r-- | src/headless/merchant.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/headless/merchant.ts b/src/headless/merchant.ts index 6a2d0ad2e..1da5d5f03 100644 --- a/src/headless/merchant.ts +++ b/src/headless/merchant.ts @@ -23,7 +23,7 @@ * Imports. */ import axios from "axios"; -import { CheckPaymentResponse } from "../types/talerTypes"; +import { CheckPaymentResponse, codecForCheckPaymentResponse } from "../types/talerTypes"; /** * Connection to the *internal* merchant backend. @@ -96,8 +96,8 @@ export class MerchantBackendConnection { amount, summary, fulfillment_url: fulfillmentUrl, - refund_deadline: `/Date(${t})/`, - wire_transfer_deadline: `/Date(${t})/`, + refund_deadline: { t_ms: t * 1000 }, + wire_transfer_deadline: { t_ms: t * 1000 }, }, }; const resp = await axios({ @@ -133,6 +133,7 @@ export class MerchantBackendConnection { if (resp.status != 200) { throw Error("failed to check payment"); } - return CheckPaymentResponse.checked(resp.data); + + return codecForCheckPaymentResponse().decode(resp.data); } } |