diff options
author | Florian Dold <florian@dold.me> | 2021-08-06 11:45:08 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-08-06 11:45:08 +0200 |
commit | 9026b0aaada91262084f5eefbd3fa46c8ecb3c64 (patch) | |
tree | 2fa8b4ff4889a34b137376bc2b3b6bbf3ea6d5e6 | |
parent | ea0e058b3403373c1ead9709fe4d2deecaa6ff8b (diff) | |
download | wallet-core-9026b0aaada91262084f5eefbd3fa46c8ecb3c64.tar.xz |
merchant test: pass h_contract
3 files changed, 9 insertions, 2 deletions
diff --git a/packages/taler-util/src/walletTypes.ts b/packages/taler-util/src/walletTypes.ts index 4d49db029..e789b469a 100644 --- a/packages/taler-util/src/walletTypes.ts +++ b/packages/taler-util/src/walletTypes.ts @@ -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; } diff --git a/packages/taler-wallet-cli/src/integrationtests/test-merchant-exchange-confusion.ts b/packages/taler-wallet-cli/src/integrationtests/test-merchant-exchange-confusion.ts index b556c9665..4cf9c39b4 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-merchant-exchange-confusion.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-merchant-exchange-confusion.ts @@ -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, }); diff --git a/packages/taler-wallet-core/src/operations/pay.ts b/packages/taler-wallet-core/src/operations/pay.ts index fed61428c..54049feb2 100644 --- a/packages/taler-wallet-core/src/operations/pay.ts +++ b/packages/taler-wallet-core/src/operations/pay.ts @@ -1392,6 +1392,7 @@ export async function checkPaymentByProposalId( proposalId: proposal.proposalId, amountEffective: Amounts.stringify(totalCost), amountRaw: Amounts.stringify(res.paymentAmount), + contractTermsHash: d.contractData.contractTermsHash, }; } |