merchant test: pass h_contract

This commit is contained in:
Florian Dold 2021-08-06 11:45:08 +02:00
parent ea0e058b34
commit 9026b0aaad
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
3 changed files with 9 additions and 2 deletions

View File

@ -324,6 +324,7 @@ export const codecForPreparePayResultPaymentPossible = (): Codec<PreparePayResul
.property("amountRaw", codecForAmountString())
.property("contractTerms", codecForContractTerms())
.property("proposalId", codecForString())
.property("contractTermsHash", codecForString())
.property(
"status",
codecForConstString(PreparePayResultType.PaymentPossible),
@ -381,6 +382,7 @@ export interface PreparePayResultPaymentPossible {
status: PreparePayResultType.PaymentPossible;
proposalId: string;
contractTerms: ContractTerms;
contractTermsHash: string;
amountRaw: string;
amountEffective: string;
}

View File

@ -44,6 +44,7 @@ import {
} from "./faultInjection";
import { defaultCoinConfig } from "./denomStructures";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import { URL } from "url";
/**
* Run a test case with a simple TESTKUDOS Taler environment, consisting
@ -211,9 +212,12 @@ export async function runMerchantExchangeConfusionTest(t: GlobalTestState) {
const proposalId = preparePayResp.proposalId;
console.log("requesting", publicOrderStatusUrl);
const orderUrlWithHash = new URL(publicOrderStatusUrl);
orderUrlWithHash.searchParams.set("h_contract", preparePayResp.contractTermsHash);
publicOrderStatusResp = await axios.get(publicOrderStatusUrl, {
console.log("requesting", orderUrlWithHash.href);
publicOrderStatusResp = await axios.get(orderUrlWithHash.href, {
validateStatus: () => true,
});

View File

@ -1392,6 +1392,7 @@ export async function checkPaymentByProposalId(
proposalId: proposal.proposalId,
amountEffective: Amounts.stringify(totalCost),
amountRaw: Amounts.stringify(res.paymentAmount),
contractTermsHash: d.contractData.contractTermsHash,
};
}