diff options
author | Sebastian <sebasjm@gmail.com> | 2022-11-11 14:50:01 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-11-11 14:50:01 -0300 |
commit | 22290020fba91253c9885eb9fa193a0dd98fa72f (patch) | |
tree | 269d57fa6f25811c9aef70b597ef993a1427aa83 /packages | |
parent | 9ec34480768fa9709cbee8d4b70118d31b379795 (diff) |
fix integration after changes in 5c742afb
Diffstat (limited to 'packages')
4 files changed, 35 insertions, 9 deletions
diff --git a/packages/taler-wallet-cli/src/harness/merchantApiTypes.ts b/packages/taler-wallet-cli/src/harness/merchantApiTypes.ts index dc9132b3e..2a59b0160 100644 --- a/packages/taler-wallet-cli/src/harness/merchantApiTypes.ts +++ b/packages/taler-wallet-cli/src/harness/merchantApiTypes.ts @@ -34,7 +34,7 @@ import { codecForConstString, codecForBoolean, codecForNumber, - codecForContractTerms, + codecForMerchantContractTerms, codecForAny, buildCodecForUnion, AmountString, @@ -102,7 +102,7 @@ export const codecForCheckPaymentPaidResponse = .property("exchange_ec", codecForNumber()) .property("exchange_hc", codecForNumber()) .property("refund_amount", codecForAmountString()) - .property("contract_terms", codecForContractTerms()) + .property("contract_terms", codecForMerchantContractTerms()) // FIXME: specify .property("wire_details", codecForAny()) .property("wire_reports", codecForAny()) @@ -122,7 +122,7 @@ export const codecForCheckPaymentClaimedResponse = (): Codec<CheckPaymentClaimedResponse> => buildCodecForObject<CheckPaymentClaimedResponse>() .property("order_status", codecForConstString("claimed")) - .property("contract_terms", codecForContractTerms()) + .property("contract_terms", codecForMerchantContractTerms()) .build("CheckPaymentClaimedResponse"); export const codecForMerchantOrderPrivateStatusResponse = diff --git a/packages/taler-wallet-cli/src/integrationtests/test-age-restrictions-peer.ts b/packages/taler-wallet-cli/src/integrationtests/test-age-restrictions-peer.ts index 3d160ca08..af5b4df52 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-age-restrictions-peer.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-age-restrictions-peer.ts @@ -17,6 +17,7 @@ /** * Imports. */ +import { AbsoluteTime, Duration } from "@gnu-taler/taler-util"; import { getDefaultNodeWallet2, WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { defaultCoinConfig } from "../harness/denomStructures.js"; import { GlobalTestState, WalletCli } from "../harness/harness.js"; @@ -59,10 +60,18 @@ export async function runAgeRestrictionsPeerTest(t: GlobalTestState) { restrictAge: 13, }); + const purse_expiration = AbsoluteTime.toTimestamp( + AbsoluteTime.addDuration( + AbsoluteTime.now(), + Duration.fromSpec({ days: 2 }), + ), + ); + const initResp = await wallet.client.call(WalletApiOperation.InitiatePeerPushPayment, { - amount: "TESTKUDOS:1", partialContractTerms: { summary: "Hello, World", + amount: "TESTKUDOS:1", + purse_expiration, }, }); diff --git a/packages/taler-wallet-cli/src/integrationtests/test-peer-to-peer-pull.ts b/packages/taler-wallet-cli/src/integrationtests/test-peer-to-peer-pull.ts index 0c149d63a..211f20494 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-peer-to-peer-pull.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-peer-to-peer-pull.ts @@ -17,7 +17,7 @@ /** * Imports. */ -import { j2s } from "@gnu-taler/taler-util"; +import { AbsoluteTime, Duration, j2s } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { GlobalTestState, WalletCli } from "../harness/harness.js"; import { @@ -47,13 +47,21 @@ export async function runPeerToPeerPullTest(t: GlobalTestState) { await wallet1.runUntilDone(); + const purse_expiration = AbsoluteTime.toTimestamp( + AbsoluteTime.addDuration( + AbsoluteTime.now(), + Duration.fromSpec({ days: 2 }), + ), + ); + const resp = await wallet1.client.call( WalletApiOperation.InitiatePeerPullPayment, { exchangeBaseUrl: exchange.baseUrl, - amount: "TESTKUDOS:5", partialContractTerms: { summary: "Hello World", + amount: "TESTKUDOS:5", + purse_expiration }, }, ); diff --git a/packages/taler-wallet-cli/src/integrationtests/test-peer-to-peer-push.ts b/packages/taler-wallet-cli/src/integrationtests/test-peer-to-peer-push.ts index 5f9d64ece..4aaeca624 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-peer-to-peer-push.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-peer-to-peer-push.ts @@ -17,7 +17,7 @@ /** * Imports. */ -import { j2s } from "@gnu-taler/taler-util"; +import { AbsoluteTime, Duration, j2s } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { GlobalTestState, WalletCli } from "../harness/harness.js"; import { @@ -47,13 +47,21 @@ export async function runPeerToPeerPushTest(t: GlobalTestState) { await wallet1.runUntilDone(); + const purse_expiration = AbsoluteTime.toTimestamp( + AbsoluteTime.addDuration( + AbsoluteTime.now(), + Duration.fromSpec({ days: 2 }), + ), + ); + { const resp = await wallet1.client.call( WalletApiOperation.InitiatePeerPushPayment, { - amount: "TESTKUDOS:5", partialContractTerms: { summary: "Hello World", + amount: "TESTKUDOS:5", + purse_expiration }, }, ); @@ -64,9 +72,10 @@ export async function runPeerToPeerPushTest(t: GlobalTestState) { const resp = await wallet1.client.call( WalletApiOperation.InitiatePeerPushPayment, { - amount: "TESTKUDOS:5", partialContractTerms: { summary: "Hello World", + amount: "TESTKUDOS:5", + purse_expiration }, }, ); |