From c3b9a08065a32f99ccb19e0aa28e00bd7e424d64 Mon Sep 17 00:00:00 2001 From: Ludovic Levalleux Date: Mon, 16 Oct 2023 17:54:16 +0100 Subject: [PATCH 1/4] add some routes for callback tests --- tests/redemptionBackend/src/router.ts | 100 ++++++++++++++++++++++++- tests/redemptionBackend/src/service.ts | 19 ++++- 2 files changed, 115 insertions(+), 4 deletions(-) diff --git a/tests/redemptionBackend/src/router.ts b/tests/redemptionBackend/src/router.ts index 87f2f5f..5eac54b 100644 --- a/tests/redemptionBackend/src/router.ts +++ b/tests/redemptionBackend/src/router.ts @@ -1,11 +1,11 @@ import { Router } from "express"; -import { receive } from "./service"; +import { confirmed, deliveryInfo, submitted } from "./service"; const router = Router(); router.get("/", (req, res) => res.sendStatus(200)); -router.post("/", (req, res, next) => { +router.post("/fail", (req, res, next) => { console.log( "Receive POST request", req.url, @@ -14,7 +14,101 @@ router.post("/", (req, res, next) => { req.body, req.headers ); - receive(req.body) + setTimeout(() => { + res.sendStatus(500); + }, 2000); +}); + +router.post("/fail2", (req, res, next) => { + console.log( + "Receive POST request", + req.url, + req.query, + req.params, + req.body, + req.headers + ); + setTimeout(() => { + res.status(409).json({ + accepted: false, + resume: false, + reason: `Unsupported delivery jurisdiction` + }); + }, 2000); +}); + +router.post("/deliveryInfo", (req, res, next) => { + console.log( + "Receive POST request", + req.url, + req.query, + req.params, + req.body, + req.headers + ); + deliveryInfo(req.body) + .then(() => { + setTimeout(() => { + res.status(200).json({ + accepted: true, + resume: true, + reason: "" + }); + }, 2000); + }) + .catch(next); +}); + +router.post("/deliveryInfoThenClose", (req, res, next) => { + console.log( + "Receive POST request", + req.url, + req.query, + req.params, + req.body, + req.headers + ); + deliveryInfo(req.body) + .then(() => { + setTimeout(() => { + res.status(200).json({ + accepted: true, + resume: false, + reason: "" + }); + }, 2000); + }) + .catch(next); +}); + +router.post("/submitted", (req, res, next) => { + console.log( + "Receive POST request", + req.url, + req.query, + req.params, + req.body, + req.headers + ); + submitted(req.body) + .then(() => { + setTimeout(() => { + res.sendStatus(200); + }, 2000); + }) + .catch(next); +}); + +router.post("/confirmed", (req, res, next) => { + console.log( + "Receive POST request", + req.url, + req.query, + req.params, + req.body, + req.headers + ); + confirmed(req.body) .then(() => { setTimeout(() => { res.sendStatus(200); diff --git a/tests/redemptionBackend/src/service.ts b/tests/redemptionBackend/src/service.ts index 367d78c..b4f0d4f 100644 --- a/tests/redemptionBackend/src/service.ts +++ b/tests/redemptionBackend/src/service.ts @@ -1,6 +1,6 @@ import { verifyMessage } from "ethers/lib/utils"; -export async function receive(body: { [key: string]: string }) { +export async function deliveryInfo(body: { [key: string]: string }) { if (!body.message) { throw `'message' field missing in request body`; } @@ -8,6 +8,7 @@ export async function receive(body: { [key: string]: string }) { throw `'signature' field missing in request body`; } try { + console.log(JSON.stringify(body.message)); const signerAddr = await verifyMessage( JSON.stringify(body.message), body.signature @@ -17,3 +18,19 @@ export async function receive(body: { [key: string]: string }) { throw `Unable to verify message signature: ${e}`; } } + +export async function submitted(body: { [key: string]: string }) { + try { + console.log("Redemption tx has been submitted", body); + } catch (e) { + throw `Unable to verify message signature: ${e}`; + } +} + +export async function confirmed(body: { [key: string]: string }) { + try { + console.log("Redemption tx has been confirmed", body); + } catch (e) { + throw `Unable to verify message signature: ${e}`; + } +} From 2bf313ff65068953ede36701c6274375617312f3 Mon Sep 17 00:00:00 2001 From: Ludovic Levalleux Date: Wed, 18 Oct 2023 17:01:48 +0100 Subject: [PATCH 2/4] feat: add redemption widgets params for callbacks URL --- public/example.html | 64 +++++++++++++++++++++++- public/scripts/boson-widgets.js | 39 +++++++++++++++ src/components/widgets/redeem/Redeem.tsx | 61 ++++++++++++++++++++++ tests/redemptionBackend/src/router.ts | 31 ++++++++++++ 4 files changed, 193 insertions(+), 2 deletions(-) diff --git a/public/example.html b/public/example.html index 7e4eb25..a0a0227 100644 --- a/public/example.html +++ b/public/example.html @@ -109,13 +109,23 @@

Redemption Widget

+ + DeliveryInfo + + + + + + + PostDeliveryInfoURL - + @@ -125,7 +135,45 @@

Redemption Widget

- + + + + + PostRedemptionSubmittedURL + + + + + + + + + PostRedemptionSubmittedHeader + + + + + + + + + PostRedemptionConfirmedURL + + + + + + + + + PostRedemptionConfirmedHeader + + + + + @@ -162,11 +210,23 @@

Redemption Widget

setValue('select-redeem-exchange-state', 'Committed') setValue('input-post-delivery-info-url', '') setValue('input-post-delivery-info-header', '') + setValue('input-post-redemption-submitted-url', '') + setValue('input-post-redemption-submitted-header', '') + setValue('input-post-redemption-confirmed-url', '') + setValue('input-post-redemption-confirmed-header', '') + setValue('input-delivery-info', '') } function clearFinanceInputs() { setValue('input-finance-seller-id', '') updateFinanceButton('disabled', true) } + function fullDecodeUri(s) { + const s2 = decodeURI(s); + if (s2 !== s) { + return fullDecodeUri(s2) + } + return s2 + } \ No newline at end of file diff --git a/public/scripts/boson-widgets.js b/public/scripts/boson-widgets.js index 0cf5686..616d528 100644 --- a/public/scripts/boson-widgets.js +++ b/public/scripts/boson-widgets.js @@ -13,8 +13,13 @@ const constants = { exchangeStateTag: "data-exchange-state", showRedemptionOverviewTag: "data-show-redemption-overview", widgetActionTag: "data-widget-action", + deliveryInfoTag: "data-delivery-info", postDeliveryInfoUrlTag: "data-post-delivery-info-url", postDeliveryInfoHeadersTag: "data-post-delivery-info-headers", + postRedemptionSubmittedUrlTag: "data-post-redemption-submitted-url", + postRedemptionSubmittedHeadersTag: "data-post-redemption-submitted-headers", + postRedemptionConfirmedUrlTag: "data-post-redemption-confirmed-url", + postRedemptionConfirmedHeadersTag: "data-post-redemption-confirmed-headers", sellerIdTag: "data-seller-id", configIdTag: "data-config-id", accountTag: "data-account", @@ -127,10 +132,22 @@ function bosonWidgetReload() { showRedeemId.attributes[constants.showRedemptionOverviewTag]?.value; const widgetAction = showRedeemId.attributes[constants.widgetActionTag]?.value; + const deliveryInfo = + showRedeemId.attributes[constants.deliveryInfoTag]?.value; const postDeliveryInfoUrl = showRedeemId.attributes[constants.postDeliveryInfoUrlTag]?.value; const postDeliveryInfoHeaders = showRedeemId.attributes[constants.postDeliveryInfoHeadersTag]?.value; + const postRedemptionSubmittedUrl = + showRedeemId.attributes[constants.postRedemptionSubmittedUrlTag]?.value; + const postRedemptionSubmittedHeaders = + showRedeemId.attributes[constants.postRedemptionSubmittedHeadersTag] + ?.value; + const postRedemptionConfirmedUrl = + showRedeemId.attributes[constants.postRedemptionConfirmedUrlTag]?.value; + const postRedemptionConfirmedHeaders = + showRedeemId.attributes[constants.postRedemptionConfirmedHeadersTag] + ?.value; const configId = showRedeemId.attributes[constants.configIdTag]?.value; const account = showRedeemId.attributes[constants.accountTag]?.value; bosonWidgetShowRedeem({ @@ -139,8 +156,13 @@ function bosonWidgetReload() { exchangeState, showRedemptionOverview, widgetAction, + deliveryInfo, postDeliveryInfoUrl, postDeliveryInfoHeaders, + postRedemptionSubmittedUrl, + postRedemptionSubmittedHeaders, + postRedemptionConfirmedUrl, + postRedemptionConfirmedHeaders, configId, account }); @@ -165,8 +187,25 @@ function bosonWidgetShowRedeem(args) { value: args.showRedemptionOverview?.toString() // to allow passing either a real boolean or a string }, { tag: "widgetAction", value: args.widgetAction }, + { tag: "deliveryInfo", value: args.deliveryInfo }, { tag: "postDeliveryInfoUrl", value: args.postDeliveryInfoUrl }, { tag: "postDeliveryInfoHeaders", value: args.postDeliveryInfoHeaders }, + { + tag: "postRedemptionSubmittedUrl", + value: args.postRedemptionSubmittedUrl + }, + { + tag: "postRedemptionSubmittedHeaders", + value: args.postRedemptionSubmittedHeaders + }, + { + tag: "postRedemptionConfirmedUrl", + value: args.postRedemptionConfirmedUrl + }, + { + tag: "postRedemptionConfirmedHeaders", + value: args.postRedemptionConfirmedHeaders + }, { tag: "configId", value: args.configId }, { tag: "account", value: args.account } ]); diff --git a/src/components/widgets/redeem/Redeem.tsx b/src/components/widgets/redeem/Redeem.tsx index 9f40c2a..e002ae8 100644 --- a/src/components/widgets/redeem/Redeem.tsx +++ b/src/components/widgets/redeem/Redeem.tsx @@ -22,6 +22,22 @@ export function Redeem() { const exchangeState: subgraph.ExchangeState = checkExchangeState( searchParams.get("exchangeState") || undefined ); + const deliveryInfo = searchParams.get("deliveryInfo") || undefined; + let deliveryInfoDecoded = undefined; + if (deliveryInfo) { + try { + deliveryInfoDecoded = JSON.parse(deliveryInfo); + for (const key of Object.keys(deliveryInfoDecoded)) { + deliveryInfoDecoded[key] = decodeURIComponent(deliveryInfoDecoded[key]); + } + console.log("deliveryInfoDecoded", deliveryInfoDecoded); + } catch (e) { + console.error( + `Unable to parse JSON from deliveryInfo='${deliveryInfo}': ${e}` + ); + } + } + const postDeliveryInfoUrl = searchParams.get("postDeliveryInfoUrl") || undefined; const postDeliveryInfoHeaders = @@ -40,6 +56,46 @@ export function Redeem() { ); } } + const postRedemptionSubmittedUrl = + searchParams.get("postRedemptionSubmittedUrl") || undefined; + const postRedemptionSubmittedHeaders = + searchParams.get("postRedemptionSubmittedHeaders") || undefined; + let postRedemptionSubmittedHeadersDecoded = undefined; + if (postRedemptionSubmittedHeaders) { + try { + postRedemptionSubmittedHeadersDecoded = JSON.parse( + postRedemptionSubmittedHeaders + ); + console.log( + "postRedemptionSubmittedHeadersDecoded", + postRedemptionSubmittedHeadersDecoded + ); + } catch (e) { + console.error( + `Unable to parse JSON from postRedemptionSubmittedHeaders='${postRedemptionSubmittedHeaders}': ${e}` + ); + } + } + const postRedemptionConfirmedUrl = + searchParams.get("postRedemptionConfirmedUrl") || undefined; + const postRedemptionConfirmedHeaders = + searchParams.get("postRedemptionConfirmedHeaders") || undefined; + let postRedemptionConfirmedHeadersDecoded = undefined; + if (postRedemptionConfirmedHeaders) { + try { + postRedemptionConfirmedHeadersDecoded = JSON.parse( + postRedemptionConfirmedHeaders + ); + console.log( + "postRedemptionConfirmedHeadersDecoded", + postRedemptionConfirmedHeadersDecoded + ); + } catch (e) { + console.error( + `Unable to parse JSON from postRedemptionConfirmedHeaders='${postRedemptionConfirmedHeaders}': ${e}` + ); + } + } const configId = searchParams.get("configId") as ConfigId; if (!configId) { return

Missing 'configId' query param

; @@ -92,8 +148,13 @@ export function Redeem() { }} modalMargin="2%" widgetAction={widgetAction} + deliveryInfo={deliveryInfoDecoded} postDeliveryInfoUrl={postDeliveryInfoUrl} postDeliveryInfoHeaders={postDeliveryInfoHeadersDecoded} + postRedemptionSubmittedUrl={postRedemptionSubmittedUrl} + postRedemptionSubmittedHeaders={postRedemptionSubmittedHeadersDecoded} + postRedemptionConfirmedUrl={postRedemptionConfirmedUrl} + postRedemptionConfirmedHeaders={postRedemptionConfirmedHeadersDecoded} > ); } diff --git a/tests/redemptionBackend/src/router.ts b/tests/redemptionBackend/src/router.ts index 5eac54b..4e72f23 100644 --- a/tests/redemptionBackend/src/router.ts +++ b/tests/redemptionBackend/src/router.ts @@ -37,6 +37,37 @@ router.post("/fail2", (req, res, next) => { }, 2000); }); +router.post("/fail3", (req, res, next) => { + console.log( + "Receive POST request", + req.url, + req.query, + req.params, + req.body, + req.headers + ); + setTimeout(() => { + res.status(409).json({ + accepted: false, + reason: `Something has gone wrong` + }); + }, 2000); +}); + +router.post("/fail4", (req, res, next) => { + console.log( + "Receive POST request", + req.url, + req.query, + req.params, + req.body, + req.headers + ); + setTimeout(() => { + res.status(409).send(`Help me please....`); + }, 2000); +}); + router.post("/deliveryInfo", (req, res, next) => { console.log( "Receive POST request", From 180903b0d787e6059dde191a02c4df472cbdb38f Mon Sep 17 00:00:00 2001 From: Ludovic Levalleux Date: Fri, 20 Oct 2023 15:57:07 +0100 Subject: [PATCH 3/4] upgrade react-kit version --- package-lock.json | 66 +++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/package-lock.json b/package-lock.json index 723d9f1..02a0f99 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "widgets", "version": "0.1.0", "dependencies": { - "@bosonprotocol/react-kit": "^0.22.0-alpha.2", + "@bosonprotocol/react-kit": "^0.22.0-alpha.4", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", @@ -2147,9 +2147,9 @@ } }, "node_modules/@bosonprotocol/common": { - "version": "1.23.2", - "resolved": "https://registry.npmjs.org/@bosonprotocol/common/-/common-1.23.2.tgz", - "integrity": "sha512-GRN/IL97o2J4Zj43ZBm57nCK/5xMW3Q8+/8OsV/Ve9wLdoz9uzlW/yEZHQnxb1rjpcnXX05OZcsUIcwn3jsfIw==", + "version": "1.24.0-alpha.1", + "resolved": "https://registry.npmjs.org/@bosonprotocol/common/-/common-1.24.0-alpha.1.tgz", + "integrity": "sha512-YcNyVzy9Fyqd5anef9jB5KLpyH1xS9JVRjf95uNbLsPTrJ35h1XD8yAYhN2EJi+IFU69HDI0UFveigqOULFAuA==", "dependencies": { "@bosonprotocol/metadata": "^1.13.0", "@ethersproject/abi": "^5.5.0", @@ -2161,11 +2161,11 @@ } }, "node_modules/@bosonprotocol/core-sdk": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/@bosonprotocol/core-sdk/-/core-sdk-1.32.0.tgz", - "integrity": "sha512-1P6siYsiyyjFXvb4NAcg5Io8RPDmoGpvpvlANsE9u60HbIp54QEAxYJF3CjaVHKHWZCMY2jbao715qinxgm1rA==", + "version": "1.33.0-alpha.1", + "resolved": "https://registry.npmjs.org/@bosonprotocol/core-sdk/-/core-sdk-1.33.0-alpha.1.tgz", + "integrity": "sha512-kHn3/jAHBtK/DoGU/72lpiRaAmnzqBBntNuJVsEHfIvw9ZTrwgLLjKL2LTxKLAHfJGZTp+HaCAIUB7kXPDj90w==", "dependencies": { - "@bosonprotocol/common": "^1.23.2", + "@bosonprotocol/common": "^1.24.0-alpha.1", "@ethersproject/abi": "^5.5.0", "@ethersproject/address": "^5.5.0", "@ethersproject/bignumber": "^5.5.0", @@ -2194,11 +2194,11 @@ } }, "node_modules/@bosonprotocol/ethers-sdk": { - "version": "1.12.9", - "resolved": "https://registry.npmjs.org/@bosonprotocol/ethers-sdk/-/ethers-sdk-1.12.9.tgz", - "integrity": "sha512-AsjWtoTFYdR+Uzn9YNbINKOEvf3oXcSiHN8+Kzkka0hFXep3BbdJTyyfcNfxoiAaOwLQm8vkubTKY2xfzaNdyA==", + "version": "1.12.10-alpha.1", + "resolved": "https://registry.npmjs.org/@bosonprotocol/ethers-sdk/-/ethers-sdk-1.12.10-alpha.1.tgz", + "integrity": "sha512-5t2Uu1wnQWUblHk6Nlq18it3a6W9IA4K0ul7D0HNVEqD4OLZnbW04SCinxcNLjUu553kE2y9Xduz2mZdV8W9jQ==", "dependencies": { - "@bosonprotocol/common": "^1.23.2" + "@bosonprotocol/common": "^1.24.0-alpha.1" }, "peerDependencies": { "ethers": "^5.5.0" @@ -2224,13 +2224,13 @@ } }, "node_modules/@bosonprotocol/react-kit": { - "version": "0.22.0-alpha.2", - "resolved": "https://registry.npmjs.org/@bosonprotocol/react-kit/-/react-kit-0.22.0-alpha.2.tgz", - "integrity": "sha512-PuxJyP8CUQuGt1MxEuNMdwF+dRGAVP2i+dWl6i0Xf6p4XNlyBvOU8RZrrRM/FfJPWbuurbk2F+imFc+U7FiO+w==", + "version": "0.22.0-alpha.4", + "resolved": "https://registry.npmjs.org/@bosonprotocol/react-kit/-/react-kit-0.22.0-alpha.4.tgz", + "integrity": "sha512-WogTOv2ulT/eslSry5tVaZ6YUkobxDQLakvqBo3Es66wTbvrTC4LDo5MJPymwsYOXMlEkyAUF3bCrPAujRaZ9g==", "dependencies": { "@bosonprotocol/chat-sdk": "^1.3.1-alpha.9", - "@bosonprotocol/core-sdk": "^1.32.0", - "@bosonprotocol/ethers-sdk": "^1.12.9", + "@bosonprotocol/core-sdk": "^1.33.0-alpha.1", + "@bosonprotocol/ethers-sdk": "^1.12.10-alpha.1", "@bosonprotocol/ipfs-storage": "^1.10.10", "@davatar/react": "1.11.1", "@ethersproject/units": "5.6.0", @@ -31265,9 +31265,9 @@ } }, "@bosonprotocol/common": { - "version": "1.23.2", - "resolved": "https://registry.npmjs.org/@bosonprotocol/common/-/common-1.23.2.tgz", - "integrity": "sha512-GRN/IL97o2J4Zj43ZBm57nCK/5xMW3Q8+/8OsV/Ve9wLdoz9uzlW/yEZHQnxb1rjpcnXX05OZcsUIcwn3jsfIw==", + "version": "1.24.0-alpha.1", + "resolved": "https://registry.npmjs.org/@bosonprotocol/common/-/common-1.24.0-alpha.1.tgz", + "integrity": "sha512-YcNyVzy9Fyqd5anef9jB5KLpyH1xS9JVRjf95uNbLsPTrJ35h1XD8yAYhN2EJi+IFU69HDI0UFveigqOULFAuA==", "requires": { "@bosonprotocol/metadata": "^1.13.0", "@ethersproject/abi": "^5.5.0", @@ -31279,11 +31279,11 @@ } }, "@bosonprotocol/core-sdk": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/@bosonprotocol/core-sdk/-/core-sdk-1.32.0.tgz", - "integrity": "sha512-1P6siYsiyyjFXvb4NAcg5Io8RPDmoGpvpvlANsE9u60HbIp54QEAxYJF3CjaVHKHWZCMY2jbao715qinxgm1rA==", + "version": "1.33.0-alpha.1", + "resolved": "https://registry.npmjs.org/@bosonprotocol/core-sdk/-/core-sdk-1.33.0-alpha.1.tgz", + "integrity": "sha512-kHn3/jAHBtK/DoGU/72lpiRaAmnzqBBntNuJVsEHfIvw9ZTrwgLLjKL2LTxKLAHfJGZTp+HaCAIUB7kXPDj90w==", "requires": { - "@bosonprotocol/common": "^1.23.2", + "@bosonprotocol/common": "^1.24.0-alpha.1", "@ethersproject/abi": "^5.5.0", "@ethersproject/address": "^5.5.0", "@ethersproject/bignumber": "^5.5.0", @@ -31311,11 +31311,11 @@ } }, "@bosonprotocol/ethers-sdk": { - "version": "1.12.9", - "resolved": "https://registry.npmjs.org/@bosonprotocol/ethers-sdk/-/ethers-sdk-1.12.9.tgz", - "integrity": "sha512-AsjWtoTFYdR+Uzn9YNbINKOEvf3oXcSiHN8+Kzkka0hFXep3BbdJTyyfcNfxoiAaOwLQm8vkubTKY2xfzaNdyA==", + "version": "1.12.10-alpha.1", + "resolved": "https://registry.npmjs.org/@bosonprotocol/ethers-sdk/-/ethers-sdk-1.12.10-alpha.1.tgz", + "integrity": "sha512-5t2Uu1wnQWUblHk6Nlq18it3a6W9IA4K0ul7D0HNVEqD4OLZnbW04SCinxcNLjUu553kE2y9Xduz2mZdV8W9jQ==", "requires": { - "@bosonprotocol/common": "^1.23.2" + "@bosonprotocol/common": "^1.24.0-alpha.1" } }, "@bosonprotocol/ipfs-storage": { @@ -31338,13 +31338,13 @@ } }, "@bosonprotocol/react-kit": { - "version": "0.22.0-alpha.2", - "resolved": "https://registry.npmjs.org/@bosonprotocol/react-kit/-/react-kit-0.22.0-alpha.2.tgz", - "integrity": "sha512-PuxJyP8CUQuGt1MxEuNMdwF+dRGAVP2i+dWl6i0Xf6p4XNlyBvOU8RZrrRM/FfJPWbuurbk2F+imFc+U7FiO+w==", + "version": "0.22.0-alpha.4", + "resolved": "https://registry.npmjs.org/@bosonprotocol/react-kit/-/react-kit-0.22.0-alpha.4.tgz", + "integrity": "sha512-WogTOv2ulT/eslSry5tVaZ6YUkobxDQLakvqBo3Es66wTbvrTC4LDo5MJPymwsYOXMlEkyAUF3bCrPAujRaZ9g==", "requires": { "@bosonprotocol/chat-sdk": "^1.3.1-alpha.9", - "@bosonprotocol/core-sdk": "^1.32.0", - "@bosonprotocol/ethers-sdk": "^1.12.9", + "@bosonprotocol/core-sdk": "^1.33.0-alpha.1", + "@bosonprotocol/ethers-sdk": "^1.12.10-alpha.1", "@bosonprotocol/ipfs-storage": "^1.10.10", "@davatar/react": "1.11.1", "@ethersproject/units": "5.6.0", diff --git a/package.json b/package.json index 541959c..61477fa 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "dependencies": { - "@bosonprotocol/react-kit": "^0.22.0-alpha.2", + "@bosonprotocol/react-kit": "^0.22.0-alpha.4", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", From 114853182cf1fc1b8be1e1967b80f32f7e378d6d Mon Sep 17 00:00:00 2001 From: Ludovic Levalleux Date: Fri, 20 Oct 2023 16:29:39 +0100 Subject: [PATCH 4/4] remove useless console logs --- src/components/widgets/redeem/Redeem.tsx | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/components/widgets/redeem/Redeem.tsx b/src/components/widgets/redeem/Redeem.tsx index e002ae8..3f7b37e 100644 --- a/src/components/widgets/redeem/Redeem.tsx +++ b/src/components/widgets/redeem/Redeem.tsx @@ -30,7 +30,6 @@ export function Redeem() { for (const key of Object.keys(deliveryInfoDecoded)) { deliveryInfoDecoded[key] = decodeURIComponent(deliveryInfoDecoded[key]); } - console.log("deliveryInfoDecoded", deliveryInfoDecoded); } catch (e) { console.error( `Unable to parse JSON from deliveryInfo='${deliveryInfo}': ${e}` @@ -46,10 +45,6 @@ export function Redeem() { if (postDeliveryInfoHeaders) { try { postDeliveryInfoHeadersDecoded = JSON.parse(postDeliveryInfoHeaders); - console.log( - "postDeliveryInfoHeadersDecoded", - postDeliveryInfoHeadersDecoded - ); } catch (e) { console.error( `Unable to parse JSON from postDeliveryInfoHeaders='${postDeliveryInfoHeaders}': ${e}` @@ -66,10 +61,6 @@ export function Redeem() { postRedemptionSubmittedHeadersDecoded = JSON.parse( postRedemptionSubmittedHeaders ); - console.log( - "postRedemptionSubmittedHeadersDecoded", - postRedemptionSubmittedHeadersDecoded - ); } catch (e) { console.error( `Unable to parse JSON from postRedemptionSubmittedHeaders='${postRedemptionSubmittedHeaders}': ${e}` @@ -86,10 +77,6 @@ export function Redeem() { postRedemptionConfirmedHeadersDecoded = JSON.parse( postRedemptionConfirmedHeaders ); - console.log( - "postRedemptionConfirmedHeadersDecoded", - postRedemptionConfirmedHeadersDecoded - ); } catch (e) { console.error( `Unable to parse JSON from postRedemptionConfirmedHeaders='${postRedemptionConfirmedHeaders}': ${e}`