fix integration after changes in 5c742afb

This commit is contained in:
Sebastian 2022-11-11 14:50:01 -03:00
parent 9ec3448076
commit 22290020fb
No known key found for this signature in database
GPG Key ID: BE4FF68352439FC1
4 changed files with 35 additions and 9 deletions

View File

@ -34,7 +34,7 @@ import {
codecForConstString, codecForConstString,
codecForBoolean, codecForBoolean,
codecForNumber, codecForNumber,
codecForContractTerms, codecForMerchantContractTerms,
codecForAny, codecForAny,
buildCodecForUnion, buildCodecForUnion,
AmountString, AmountString,
@ -102,7 +102,7 @@ export const codecForCheckPaymentPaidResponse =
.property("exchange_ec", codecForNumber()) .property("exchange_ec", codecForNumber())
.property("exchange_hc", codecForNumber()) .property("exchange_hc", codecForNumber())
.property("refund_amount", codecForAmountString()) .property("refund_amount", codecForAmountString())
.property("contract_terms", codecForContractTerms()) .property("contract_terms", codecForMerchantContractTerms())
// FIXME: specify // FIXME: specify
.property("wire_details", codecForAny()) .property("wire_details", codecForAny())
.property("wire_reports", codecForAny()) .property("wire_reports", codecForAny())
@ -122,7 +122,7 @@ export const codecForCheckPaymentClaimedResponse =
(): Codec<CheckPaymentClaimedResponse> => (): Codec<CheckPaymentClaimedResponse> =>
buildCodecForObject<CheckPaymentClaimedResponse>() buildCodecForObject<CheckPaymentClaimedResponse>()
.property("order_status", codecForConstString("claimed")) .property("order_status", codecForConstString("claimed"))
.property("contract_terms", codecForContractTerms()) .property("contract_terms", codecForMerchantContractTerms())
.build("CheckPaymentClaimedResponse"); .build("CheckPaymentClaimedResponse");
export const codecForMerchantOrderPrivateStatusResponse = export const codecForMerchantOrderPrivateStatusResponse =

View File

@ -17,6 +17,7 @@
/** /**
* Imports. * Imports.
*/ */
import { AbsoluteTime, Duration } from "@gnu-taler/taler-util";
import { getDefaultNodeWallet2, WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { getDefaultNodeWallet2, WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import { defaultCoinConfig } from "../harness/denomStructures.js"; import { defaultCoinConfig } from "../harness/denomStructures.js";
import { GlobalTestState, WalletCli } from "../harness/harness.js"; import { GlobalTestState, WalletCli } from "../harness/harness.js";
@ -59,10 +60,18 @@ export async function runAgeRestrictionsPeerTest(t: GlobalTestState) {
restrictAge: 13, restrictAge: 13,
}); });
const purse_expiration = AbsoluteTime.toTimestamp(
AbsoluteTime.addDuration(
AbsoluteTime.now(),
Duration.fromSpec({ days: 2 }),
),
);
const initResp = await wallet.client.call(WalletApiOperation.InitiatePeerPushPayment, { const initResp = await wallet.client.call(WalletApiOperation.InitiatePeerPushPayment, {
amount: "TESTKUDOS:1",
partialContractTerms: { partialContractTerms: {
summary: "Hello, World", summary: "Hello, World",
amount: "TESTKUDOS:1",
purse_expiration,
}, },
}); });

View File

@ -17,7 +17,7 @@
/** /**
* Imports. * 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 { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import { GlobalTestState, WalletCli } from "../harness/harness.js"; import { GlobalTestState, WalletCli } from "../harness/harness.js";
import { import {
@ -47,13 +47,21 @@ export async function runPeerToPeerPullTest(t: GlobalTestState) {
await wallet1.runUntilDone(); await wallet1.runUntilDone();
const purse_expiration = AbsoluteTime.toTimestamp(
AbsoluteTime.addDuration(
AbsoluteTime.now(),
Duration.fromSpec({ days: 2 }),
),
);
const resp = await wallet1.client.call( const resp = await wallet1.client.call(
WalletApiOperation.InitiatePeerPullPayment, WalletApiOperation.InitiatePeerPullPayment,
{ {
exchangeBaseUrl: exchange.baseUrl, exchangeBaseUrl: exchange.baseUrl,
amount: "TESTKUDOS:5",
partialContractTerms: { partialContractTerms: {
summary: "Hello World", summary: "Hello World",
amount: "TESTKUDOS:5",
purse_expiration
}, },
}, },
); );

View File

@ -17,7 +17,7 @@
/** /**
* Imports. * 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 { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import { GlobalTestState, WalletCli } from "../harness/harness.js"; import { GlobalTestState, WalletCli } from "../harness/harness.js";
import { import {
@ -47,13 +47,21 @@ export async function runPeerToPeerPushTest(t: GlobalTestState) {
await wallet1.runUntilDone(); await wallet1.runUntilDone();
const purse_expiration = AbsoluteTime.toTimestamp(
AbsoluteTime.addDuration(
AbsoluteTime.now(),
Duration.fromSpec({ days: 2 }),
),
);
{ {
const resp = await wallet1.client.call( const resp = await wallet1.client.call(
WalletApiOperation.InitiatePeerPushPayment, WalletApiOperation.InitiatePeerPushPayment,
{ {
amount: "TESTKUDOS:5",
partialContractTerms: { partialContractTerms: {
summary: "Hello World", summary: "Hello World",
amount: "TESTKUDOS:5",
purse_expiration
}, },
}, },
); );
@ -64,9 +72,10 @@ export async function runPeerToPeerPushTest(t: GlobalTestState) {
const resp = await wallet1.client.call( const resp = await wallet1.client.call(
WalletApiOperation.InitiatePeerPushPayment, WalletApiOperation.InitiatePeerPushPayment,
{ {
amount: "TESTKUDOS:5",
partialContractTerms: { partialContractTerms: {
summary: "Hello World", summary: "Hello World",
amount: "TESTKUDOS:5",
purse_expiration
}, },
}, },
); );