also accept payment in test

This commit is contained in:
Florian Dold 2022-09-07 14:49:10 +02:00
parent 96bc4d6692
commit dcc1bcee43
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -17,7 +17,7 @@
/** /**
* Imports. * Imports.
*/ */
import { 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";
import { import {
@ -59,14 +59,7 @@ export async function runAgeRestrictionsPeerTest(t: GlobalTestState) {
restrictAge: 13, restrictAge: 13,
}); });
const order = { const initResp = await wallet.client.call(WalletApiOperation.InitiatePeerPushPayment, {
summary: "Buy me!",
amount: "TESTKUDOS:5",
fulfillment_url: "taler://fulfillment-success/thx",
minimum_age: 9,
};
await wallet.client.call(WalletApiOperation.InitiatePeerPushPayment, {
amount: "TESTKUDOS:1", amount: "TESTKUDOS:1",
partialContractTerms: { partialContractTerms: {
summary: "Hello, World", summary: "Hello, World",
@ -74,6 +67,16 @@ export async function runAgeRestrictionsPeerTest(t: GlobalTestState) {
}); });
await wallet.runUntilDone(); await wallet.runUntilDone();
const checkResp = await walletTwo.client.call(WalletApiOperation.CheckPeerPushPayment, {
talerUri: initResp.talerUri,
});
await walletTwo.client.call(WalletApiOperation.AcceptPeerPushPayment, {
peerPushPaymentIncomingId: checkResp.peerPushPaymentIncomingId,
});
await walletTwo.runUntilDone();
} }
} }