From c65444f6136a23114e286c550f8e44f1ba472179 Mon Sep 17 00:00:00 2001 From: Michael Ossig Date: Fri, 18 Mar 2022 12:22:41 -0400 Subject: [PATCH] updated hook typing --- packages/client/src/hooks/types.ts | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/client/src/hooks/types.ts b/packages/client/src/hooks/types.ts index 1df3722..07ecf82 100644 --- a/packages/client/src/hooks/types.ts +++ b/packages/client/src/hooks/types.ts @@ -1,4 +1,5 @@ -import { PaymentAmount, PaymentMethodsResponseInterface } from '@adyen/adyen-web/dist/types/types'; +import { CoreOptions } from '@adyen/adyen-web/dist/types/core/types'; +import { PaymentAmount } from '@adyen/adyen-web/dist/types/types'; export type InitializationRequest = { merchantAccount: string; @@ -13,20 +14,11 @@ export type InitializationRequest = { shopperReference?: string; }; -export interface EditableCheckoutConfigFields { - session?: { - id: string; - data?: string; - }; - paymentMethodsResponse?: PaymentMethodsResponseInterface; +export interface EditableCheckoutConfigFields extends CoreOptions { redirectResult?: { redirectResult: string; redirectSessionId: string; }; - environment: string; - clientKey: string; - paymentMethodsConfiguration?: object; - amount?: PaymentAmount; showPayButton?: boolean; } @@ -34,7 +26,6 @@ export interface CheckoutConfig extends EditableCheckoutConfigFields { onChange?: (state: any, element: any) => void; onValid?: (state: any, element: any) => void; onSubmit?: (state: any, element: any) => void; - onComplete?: (state: any, element: any) => void; onAdditionalDetails?: (state: any, element: any) => void; onError?: (error: any, element?: any) => void; onPaymentCompleted?: (result: any, element: any) => void;