From 953cd9dc41ff3d52d23fe77f4ba3c18281e9d58f Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 14 Aug 2020 15:53:50 +0530 Subject: nuke some console.log statements, test wallet testing functionality in integration test --- packages/taler-wallet-core/src/types/dbTypes.ts | 7 ++++++ .../taler-wallet-core/src/types/transactions.ts | 8 +++++++ .../taler-wallet-core/src/types/walletTypes.ts | 27 ++++++++++++++++++---- 3 files changed, 38 insertions(+), 4 deletions(-) (limited to 'packages/taler-wallet-core/src/types') diff --git a/packages/taler-wallet-core/src/types/dbTypes.ts b/packages/taler-wallet-core/src/types/dbTypes.ts index 3c4c2a250..26e636e48 100644 --- a/packages/taler-wallet-core/src/types/dbTypes.ts +++ b/packages/taler-wallet-core/src/types/dbTypes.ts @@ -1164,7 +1164,14 @@ export type WalletRefundItem = | WalletRefundAppliedItem; export interface WalletRefundItemCommon { + // Execution time as claimed by the merchant executionTime: Timestamp; + + /** + * Time when the wallet became aware of the refund. + */ + obtainedTime: Timestamp; + refundAmount: AmountJson; refundFee: AmountJson; diff --git a/packages/taler-wallet-core/src/types/transactions.ts b/packages/taler-wallet-core/src/types/transactions.ts index f3192e5a4..e40031499 100644 --- a/packages/taler-wallet-core/src/types/transactions.ts +++ b/packages/taler-wallet-core/src/types/transactions.ts @@ -31,6 +31,8 @@ import { buildCodecForObject, codecOptional, codecForString, + codecForList, + codecForAny, } from "../util/codec"; export interface TransactionsRequest { @@ -309,3 +311,9 @@ export const codecForTransactionsRequest = (): Codec => .property("currency", codecOptional(codecForString())) .property("search", codecOptional(codecForString())) .build("TransactionsRequest"); + +// FIXME: do full validation here! +export const codecForTransactionsResponse = (): Codec => + buildCodecForObject() + .property("transactions", codecForList(codecForAny())) + .build("TransactionsResponse"); \ No newline at end of file diff --git a/packages/taler-wallet-core/src/types/walletTypes.ts b/packages/taler-wallet-core/src/types/walletTypes.ts index e64187e72..511d7766c 100644 --- a/packages/taler-wallet-core/src/types/walletTypes.ts +++ b/packages/taler-wallet-core/src/types/walletTypes.ts @@ -653,16 +653,16 @@ export interface GetExchangeTosResult { } export interface TestPayArgs { - merchant: string; - apikey: string; + merchantBaseUrl: string; + merchantApiKey: string; amount: string; summary: string; } export const codecForTestPayArgs = (): Codec => buildCodecForObject() - .property("merchant", codecForString()) - .property("apikey", codecForString()) + .property("merchantBaseUrl", codecForString()) + .property("merchantApiKey", codecForString()) .property("amount", codecForString()) .property("summary", codecForString()) .build("TestPayArgs"); @@ -829,3 +829,22 @@ export interface CoreApiResponseError { id: string; error: OperationErrorDetails; } + +export interface WithdrawTestBalanceRequest { + amount: string; + bankBaseUrl: string; + exchangeBaseUrl: string; +} + +export const withdrawTestBalanceDefaults = { + amount: "TESTKUDOS:10", + bankBaseUrl: "https://bank.test.taler.net/", + exchangeBaseUrl: "https://exchange.test.taler.net/", +}; + +export const codecForWithdrawTestBalance = (): Codec => + buildCodecForObject() + .property("amount", codecForString()) + .property("bankBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForString()) + .build("WithdrawTestBalanceRequest"); -- cgit v1.2.3