diff options
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts')
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts b/packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts index fca368dad..e959e813b 100644 --- a/packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts +++ b/packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts @@ -72,7 +72,7 @@ async function testWithClaimToken( let talerPayUri: string; { - const httpResp = await httpLib.get( + const httpResp = await httpLib.fetch( new URL(`orders/${orderId}`, merchantBaseUrl).href, ); const r = await httpResp.json(); @@ -83,7 +83,7 @@ async function testWithClaimToken( { const url = new URL(`orders/${orderId}`, merchantBaseUrl); url.searchParams.set("token", claimToken); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); t.assertDeepEqual(httpResp.status, 402); console.log(r); @@ -94,7 +94,7 @@ async function testWithClaimToken( { const url = new URL(`orders/${orderId}`, merchantBaseUrl); url.searchParams.set("token", claimToken); - const httpResp = await httpLib.get(url.href, { + const httpResp = await httpLib.fetch(url.href, { headers: { Accept: "text/html", }, @@ -120,7 +120,7 @@ async function testWithClaimToken( const url = new URL(`orders/${orderId}`, merchantBaseUrl); const hcWrong = encodeCrock(getRandomBytes(64)); url.searchParams.set("h_contract", hcWrong); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 403); @@ -131,7 +131,7 @@ async function testWithClaimToken( const url = new URL(`orders/${orderId}`, merchantBaseUrl); const ctWrong = encodeCrock(getRandomBytes(16)); url.searchParams.set("token", ctWrong); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 403); @@ -141,7 +141,7 @@ async function testWithClaimToken( { const url = new URL(`orders/${orderId}`, merchantBaseUrl); url.searchParams.set("token", claimToken); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 402); @@ -151,7 +151,7 @@ async function testWithClaimToken( { const url = new URL(`orders/${orderId}`, merchantBaseUrl); url.searchParams.set("h_contract", contractTermsHash); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 402); @@ -160,7 +160,7 @@ async function testWithClaimToken( // claimed, unpaid, access without credentials { const url = new URL(`orders/${orderId}`, merchantBaseUrl); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 202); @@ -178,7 +178,7 @@ async function testWithClaimToken( // paid, access without credentials { const url = new URL(`orders/${orderId}`, merchantBaseUrl); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 202); @@ -189,7 +189,7 @@ async function testWithClaimToken( const url = new URL(`orders/${orderId}`, merchantBaseUrl); const hcWrong = encodeCrock(getRandomBytes(64)); url.searchParams.set("h_contract", hcWrong); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 403); @@ -200,7 +200,7 @@ async function testWithClaimToken( const url = new URL(`orders/${orderId}`, merchantBaseUrl); const ctWrong = encodeCrock(getRandomBytes(16)); url.searchParams.set("token", ctWrong); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 403); @@ -210,7 +210,7 @@ async function testWithClaimToken( { const url = new URL(`orders/${orderId}`, merchantBaseUrl); url.searchParams.set("h_contract", contractTermsHash); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 200); @@ -220,7 +220,7 @@ async function testWithClaimToken( { const url = new URL(`orders/${orderId}`, merchantBaseUrl); url.searchParams.set("token", claimToken); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 200); @@ -232,7 +232,7 @@ async function testWithClaimToken( { const url = new URL(`orders/${orderId}`, merchantBaseUrl); url.searchParams.set("token", claimToken); - const httpResp = await httpLib.get(url.href, { + const httpResp = await httpLib.fetch(url.href, { headers: { Accept: "text/html" }, }); t.assertDeepEqual(httpResp.status, 200); @@ -269,7 +269,7 @@ async function testWithClaimToken( { const url = new URL(`orders/${apOrderId}`, merchantBaseUrl); url.searchParams.set("token", apToken); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 402); @@ -280,7 +280,7 @@ async function testWithClaimToken( const url = new URL(`orders/${apOrderId}`, merchantBaseUrl); url.searchParams.set("token", apToken); url.searchParams.set("session_id", sessionId); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 402); @@ -293,7 +293,7 @@ async function testWithClaimToken( const url = new URL(`orders/${apOrderId}`, merchantBaseUrl); url.searchParams.set("token", apToken); url.searchParams.set("session_id", sessionId); - const httpResp = await httpLib.get(url.href, { + const httpResp = await httpLib.fetch(url.href, { headers: { Accept: "text/html" }, }); t.assertDeepEqual(httpResp.status, 302); @@ -326,7 +326,7 @@ async function testWithoutClaimToken( let talerPayUri: string; { - const httpResp = await httpLib.get( + const httpResp = await httpLib.fetch( new URL(`orders/${orderId}`, merchantBaseUrl).href, ); const r = await httpResp.json(); @@ -336,7 +336,7 @@ async function testWithoutClaimToken( { const url = new URL(`orders/${orderId}`, merchantBaseUrl); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); t.assertDeepEqual(httpResp.status, 402); console.log(r); @@ -346,7 +346,7 @@ async function testWithoutClaimToken( { const url = new URL(`orders/${orderId}`, merchantBaseUrl); - const httpResp = await httpLib.get(url.href, { + const httpResp = await httpLib.fetch(url.href, { headers: { Accept: "text/html", }, @@ -374,7 +374,7 @@ async function testWithoutClaimToken( const url = new URL(`orders/${orderId}`, merchantBaseUrl); const hcWrong = encodeCrock(getRandomBytes(64)); url.searchParams.set("h_contract", hcWrong); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 403); @@ -385,7 +385,7 @@ async function testWithoutClaimToken( const url = new URL(`orders/${orderId}`, merchantBaseUrl); const ctWrong = encodeCrock(getRandomBytes(16)); url.searchParams.set("token", ctWrong); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 403); @@ -394,7 +394,7 @@ async function testWithoutClaimToken( // claimed, unpaid, no claim token { const url = new URL(`orders/${orderId}`, merchantBaseUrl); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 402); @@ -404,7 +404,7 @@ async function testWithoutClaimToken( { const url = new URL(`orders/${orderId}`, merchantBaseUrl); url.searchParams.set("h_contract", contractTermsHash); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 402); @@ -413,7 +413,7 @@ async function testWithoutClaimToken( // claimed, unpaid, access without credentials { const url = new URL(`orders/${orderId}`, merchantBaseUrl); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); // No credentials, but the order doesn't require a claim token. @@ -434,7 +434,7 @@ async function testWithoutClaimToken( // paid, access without credentials { const url = new URL(`orders/${orderId}`, merchantBaseUrl); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 200); @@ -445,7 +445,7 @@ async function testWithoutClaimToken( const url = new URL(`orders/${orderId}`, merchantBaseUrl); const hcWrong = encodeCrock(getRandomBytes(64)); url.searchParams.set("h_contract", hcWrong); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 403); @@ -456,7 +456,7 @@ async function testWithoutClaimToken( const url = new URL(`orders/${orderId}`, merchantBaseUrl); const ctWrong = encodeCrock(getRandomBytes(16)); url.searchParams.set("token", ctWrong); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 403); @@ -466,7 +466,7 @@ async function testWithoutClaimToken( { const url = new URL(`orders/${orderId}`, merchantBaseUrl); url.searchParams.set("h_contract", contractTermsHash); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 200); @@ -475,7 +475,7 @@ async function testWithoutClaimToken( // paid, JSON { const url = new URL(`orders/${orderId}`, merchantBaseUrl); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 200); @@ -486,7 +486,7 @@ async function testWithoutClaimToken( // paid, HTML { const url = new URL(`orders/${orderId}`, merchantBaseUrl); - const httpResp = await httpLib.get(url.href, { + const httpResp = await httpLib.fetch(url.href, { headers: { Accept: "text/html" }, }); t.assertDeepEqual(httpResp.status, 200); @@ -523,7 +523,7 @@ async function testWithoutClaimToken( { const url = new URL(`orders/${apOrderId}`, merchantBaseUrl); url.searchParams.set("token", apToken); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 402); @@ -534,7 +534,7 @@ async function testWithoutClaimToken( const url = new URL(`orders/${apOrderId}`, merchantBaseUrl); url.searchParams.set("token", apToken); url.searchParams.set("session_id", sessionId); - const httpResp = await httpLib.get(url.href); + const httpResp = await httpLib.fetch(url.href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 402); @@ -547,7 +547,7 @@ async function testWithoutClaimToken( const url = new URL(`orders/${apOrderId}`, merchantBaseUrl); url.searchParams.set("token", apToken); url.searchParams.set("session_id", sessionId); - const httpResp = await httpLib.get(url.href, { + const httpResp = await httpLib.fetch(url.href, { headers: { Accept: "text/html" }, }); t.assertDeepEqual(httpResp.status, 302); @@ -572,14 +572,14 @@ export async function runMerchantSpecPublicOrdersTest(t: GlobalTestState) { const merchantBaseUrl = merchant.makeInstanceBaseUrl(); { - const httpResp = await httpLib.get(new URL("config", merchantBaseUrl).href); + const httpResp = await httpLib.fetch(new URL("config", merchantBaseUrl).href); const r = await httpResp.json(); console.log(r); t.assertDeepEqual(r.currency, "TESTKUDOS"); } { - const httpResp = await httpLib.get( + const httpResp = await httpLib.fetch( new URL("orders/foo", merchantBaseUrl).href, ); const r = await httpResp.json(); @@ -589,7 +589,7 @@ export async function runMerchantSpecPublicOrdersTest(t: GlobalTestState) { } { - const httpResp = await httpLib.get( + const httpResp = await httpLib.fetch( new URL("orders/foo", merchantBaseUrl).href, { headers: { |