From fe6bcc0dcb9b77ad81c1324ed80883c58ca7219f Mon Sep 17 00:00:00 2001 From: nicholas Date: Mon, 9 Dec 2024 13:26:58 +0100 Subject: [PATCH] Stop stories setting the onChange callback --- packages/lib/storybook/helpers/create-advanced-checkout.ts | 6 +----- packages/lib/storybook/helpers/create-sessions-checkout.ts | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/lib/storybook/helpers/create-advanced-checkout.ts b/packages/lib/storybook/helpers/create-advanced-checkout.ts index c3cef699be..6d9bac19bf 100644 --- a/packages/lib/storybook/helpers/create-advanced-checkout.ts +++ b/packages/lib/storybook/helpers/create-advanced-checkout.ts @@ -1,6 +1,6 @@ import { AdyenCheckout } from '../../src/core/AdyenCheckout'; import { cancelOrder, checkBalance, createOrder, getPaymentMethods, makeDetailsCall, makePayment } from './checkout-api-calls'; -import { handleChange, handleError, handleFinalState } from './checkout-handlers'; +import { handleError, handleFinalState } from './checkout-handlers'; import getCurrency from '../utils/get-currency'; import { AdyenCheckoutProps } from '../stories/types'; import Checkout from '../../src/core/core'; @@ -100,10 +100,6 @@ async function createAdvancedFlowCheckout({ handleFinalState(result, element); }, - onChange: (state, component) => { - handleChange(state, component); - }, - onBalanceCheck: async (resolve, reject, data) => { const payload = { amount: paymentAmount, diff --git a/packages/lib/storybook/helpers/create-sessions-checkout.ts b/packages/lib/storybook/helpers/create-sessions-checkout.ts index 2527e3da2a..e5a036918d 100644 --- a/packages/lib/storybook/helpers/create-sessions-checkout.ts +++ b/packages/lib/storybook/helpers/create-sessions-checkout.ts @@ -1,6 +1,6 @@ import { createSession } from './checkout-api-calls'; import { RETURN_URL, SHOPPER_REFERENCE } from '../config/commonConfig'; -import { handleChange, handleError, handleFinalState } from './checkout-handlers'; +import { handleError, handleFinalState } from './checkout-handlers'; import getCurrency from '../utils/get-currency'; import { AdyenCheckoutProps } from '../stories/types'; import Checkout from '../../src/core/core'; @@ -53,10 +53,6 @@ async function createSessionsCheckout({ handleError(error, component); }, - onChange: (state, component) => { - handleChange(state, component); - }, - ...restCheckoutProps }); }