From c994f847a31f55069c8164e2dbaf4e96dd6b94c9 Mon Sep 17 00:00:00 2001 From: Brandon Tom Date: Fri, 13 Dec 2024 15:15:34 -0800 Subject: [PATCH 1/4] fix: added `payPalComplete` property to PayPal `DirectConfig` type definition --- types/lib/paypal.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/lib/paypal.d.ts b/types/lib/paypal.d.ts index 333405968..6c62a5ebc 100644 --- a/types/lib/paypal.d.ts +++ b/types/lib/paypal.d.ts @@ -25,6 +25,7 @@ export type DirectConfig = { logoImageUrl?: string; headerImageUrl?: string; }; + payPalComplete?: boolean; }; export type PayPalConfig = BraintreeConfig | DirectConfig; From 3125b0f89e643ca5ddd6cb91d0f65a5cbed66466 Mon Sep 17 00:00:00 2001 From: Brandon Tom Date: Fri, 13 Dec 2024 15:21:56 -0800 Subject: [PATCH 2/4] chore: ignoring JetBrains `.idea/` files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5c48122cd..00096064d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .DS_Store .vscode +.idea build node_modules tmp From cd0b01c9182ad0bc7d4c6886849c17a401b98c71 Mon Sep 17 00:00:00 2001 From: Brandon Tom Date: Wed, 18 Dec 2024 08:18:10 -0800 Subject: [PATCH 3/4] feat: added `PayPalCompleteConfig` type --- types/lib/paypal.d.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/types/lib/paypal.d.ts b/types/lib/paypal.d.ts index 6c62a5ebc..dbc752366 100644 --- a/types/lib/paypal.d.ts +++ b/types/lib/paypal.d.ts @@ -25,10 +25,18 @@ export type DirectConfig = { logoImageUrl?: string; headerImageUrl?: string; }; - payPalComplete?: boolean; }; -export type PayPalConfig = BraintreeConfig | DirectConfig; +export type PayPalCompleteConfig = { + payPalComplete?: boolean; + display?: { + locale?: string; + displayName?: string; + amount?: string; + } +} + +export type PayPalConfig = BraintreeConfig | DirectConfig | PayPalCompleteConfig export type PayPalEvent = 'error' | 'token' | 'cancel' | 'ready'; From cd61fcdaa3486cbb6a0d82f1ce23389087187f2e Mon Sep 17 00:00:00 2001 From: Brandon Tom Date: Wed, 18 Dec 2024 08:24:45 -0800 Subject: [PATCH 4/4] 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 dbc752366..1aeba353e 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