From 34a4662c80b57f6097e757ddb6ceb3beb9c269d0 Mon Sep 17 00:00:00 2001 From: nicholas Date: Tue, 10 Dec 2024 16:05:07 +0100 Subject: [PATCH 1/2] Stop calling sanitizeResponse twice during the payment response handling process --- .../src/components/internal/UIElement/UIElement.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/lib/src/components/internal/UIElement/UIElement.tsx b/packages/lib/src/components/internal/UIElement/UIElement.tsx index 945de0637b..ce164eb142 100644 --- a/packages/lib/src/components/internal/UIElement/UIElement.tsx +++ b/packages/lib/src/components/internal/UIElement/UIElement.tsx @@ -19,8 +19,7 @@ import type { PaymentAmount, PaymentData, PaymentMethodsResponse, - PaymentResponseData, - RawPaymentResponse + PaymentResponseData } from '../../../types/global-types'; import type { IDropin } from '../../Dropin/types'; import type { NewableComponent } from '../../../core/core.registry'; @@ -390,11 +389,11 @@ export abstract class UIElement

exten * Handles a /payments or /payments/details response. * The component will handle automatically actions, orders, and final results. * - * @param rawResponse - + * Expected to be called after sanitizeResponse has been run on the raw payment response + * + * @param response - */ - protected handleResponse(rawResponse: RawPaymentResponse): void { - const response = sanitizeResponse(rawResponse); - + protected handleResponse(response: PaymentResponseData): void { if (response.action) { this.elementRef.handleAction(response.action); return; From 9210514b7b7365908f0c2a41c5328ac57f83dc2f Mon Sep 17 00:00:00 2001 From: nicholas Date: Fri, 10 Jan 2025 17:52:27 +0100 Subject: [PATCH 2/2] Added changeset file --- .changeset/green-bobcats-act.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/green-bobcats-act.md diff --git a/.changeset/green-bobcats-act.md b/.changeset/green-bobcats-act.md new file mode 100644 index 0000000000..c7e786bb3d --- /dev/null +++ b/.changeset/green-bobcats-act.md @@ -0,0 +1,5 @@ +--- +'@adyen/adyen-web': patch +--- + +Internal improvement to avoid unnecessary second call of sanitizeResponse during the payment response handling process