diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-08-14 15:53:50 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-08-14 15:53:50 +0530 |
commit | 953cd9dc41ff3d52d23fe77f4ba3c18281e9d58f (patch) | |
tree | 17ff47fea3651dad192beee5d32c5fd4c538fa39 /packages/taler-wallet-core/src/types | |
parent | e3850158c249d890399fdb9e083ec7e654a8380f (diff) | |
download | wallet-core-953cd9dc41ff3d52d23fe77f4ba3c18281e9d58f.tar.xz |
nuke some console.log statements, test wallet testing functionality in integration test
Diffstat (limited to 'packages/taler-wallet-core/src/types')
-rw-r--r-- | packages/taler-wallet-core/src/types/dbTypes.ts | 7 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/types/transactions.ts | 8 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/types/walletTypes.ts | 27 |
3 files changed, 38 insertions, 4 deletions
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<TransactionsRequest> => .property("currency", codecOptional(codecForString())) .property("search", codecOptional(codecForString())) .build("TransactionsRequest"); + +// FIXME: do full validation here! +export const codecForTransactionsResponse = (): Codec<TransactionsResponse> => + buildCodecForObject<TransactionsResponse>() + .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<TestPayArgs> => buildCodecForObject<TestPayArgs>() - .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<WithdrawTestBalanceRequest> => + buildCodecForObject<WithdrawTestBalanceRequest>() + .property("amount", codecForString()) + .property("bankBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForString()) + .build("WithdrawTestBalanceRequest"); |