From cd61fcdaa3486cbb6a0d82f1ce23389087187f2e Mon Sep 17 00:00:00 2001 From: Brandon Tom Date: Wed, 18 Dec 2024 08:24:45 -0800 Subject: [PATCH] feat: added `PayPalDisplayConfig` type --- types/lib/paypal.d.ts | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/types/lib/paypal.d.ts b/types/lib/paypal.d.ts index dbc75236..1aeba353 100644 --- a/types/lib/paypal.d.ts +++ b/types/lib/paypal.d.ts @@ -1,13 +1,16 @@ import { Emitter } from './emitter'; +export type PayPalDisplayConfig = { + locale?: string; + displayName?: string; + amount?: string; +} + export type BraintreeConfig = { braintree: { clientAuthorization: string; }; - display?: { - locale?: string; - displayName?: string; - amount?: string; + display?: PayPalDisplayConfig & { enableShippingAddress?: boolean; shippingAddressOverride?: any; shippingAddressEditable?: boolean; @@ -18,10 +21,7 @@ export type BraintreeConfig = { export type DirectConfig = { gatewayCode?: string; - display?: { - locale?: string; - displayName?: string; - amount?: string; + display?: PayPalDisplayConfig & { logoImageUrl?: string; headerImageUrl?: string; }; @@ -29,11 +29,7 @@ export type DirectConfig = { export type PayPalCompleteConfig = { payPalComplete?: boolean; - display?: { - locale?: string; - displayName?: string; - amount?: string; - } + display?: PayPalDisplayConfig; } export type PayPalConfig = BraintreeConfig | DirectConfig | PayPalCompleteConfig