@easypayment/medusa-paypal-ui 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/index.cjs +197 -88
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +197 -88
- package/dist/index.mjs.map +1 -1
- package/dist/order.cjs.map +1 -1
- package/dist/order.mjs.map +1 -1
- package/package.json +1 -1
- package/src/adapters/MedusaNextPayPalAdapter.tsx +196 -195
- package/src/client/http.ts +214 -204
- package/src/client/paypal.ts +91 -88
- package/src/client/types.ts +40 -40
- package/src/components/PayPalAdvancedCard.tsx +646 -611
- package/src/components/PayPalCurrencyNotice.tsx +24 -19
- package/src/components/PayPalPaymentSection.tsx +5 -1
- package/src/components/PayPalProvider.tsx +44 -38
- package/src/components/PayPalSmartButtons.tsx +489 -445
- package/src/hooks/usePayPalConfig.ts +100 -96
- package/src/hooks/usePayPalPaymentMethods.ts +146 -145
- package/src/index.ts +19 -16
- package/src/order.ts +140 -134
- package/src/utils/next-errors.ts +21 -21
- package/src/utils/processing-overlay.ts +96 -96
package/src/client/types.ts
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
export type PayPalConfig = {
|
|
2
|
-
environment: "sandbox" | "live"
|
|
3
|
-
client_id: string
|
|
4
|
-
currency: string
|
|
5
|
-
currency_supported: boolean
|
|
6
|
-
currency_errors: string[]
|
|
7
|
-
supported_currencies: string[]
|
|
8
|
-
client_token?: string
|
|
9
|
-
intent?: "capture" | "authorize"
|
|
10
|
-
paypal_enabled?: boolean
|
|
11
|
-
paypal_title?: string
|
|
12
|
-
card_enabled?: boolean
|
|
13
|
-
card_title?: string
|
|
14
|
-
card_three_ds?: "sli" | "when_required" | "always"
|
|
15
|
-
button_color?: "gold" | "blue" | "silver" | "black" | "white"
|
|
16
|
-
button_shape?: "rect" | "pill"
|
|
17
|
-
button_width?: string
|
|
18
|
-
button_height?: number
|
|
19
|
-
button_label?: "paypal" | "checkout" | "buynow" | "pay" | "installment"
|
|
20
|
-
disable_buttons?: string[]
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export type PayPalSettingsResponse = {
|
|
24
|
-
/**
|
|
25
|
-
* What `GET /store/paypal/settings` actually returns: the configured
|
|
26
|
-
* payment action and whether advanced card fields are enabled.
|
|
27
|
-
*/
|
|
28
|
-
paymentAction?: "capture" | "authorize"
|
|
29
|
-
advancedCardEnabled?: boolean
|
|
30
|
-
/**
|
|
31
|
-
* @deprecated The settings endpoint has never returned a `data` envelope —
|
|
32
|
-
* kept only so existing (already-null-safe) consumer code keeps compiling.
|
|
33
|
-
*/
|
|
34
|
-
data?: {
|
|
35
|
-
api_details?: { currency_code?: string }
|
|
36
|
-
paypal_settings?: Record<string, unknown>
|
|
37
|
-
onboarding_config?: Record<string, unknown>
|
|
38
|
-
}
|
|
39
|
-
[key: string]: unknown
|
|
40
|
-
}
|
|
1
|
+
export type PayPalConfig = {
|
|
2
|
+
environment: "sandbox" | "live"
|
|
3
|
+
client_id: string
|
|
4
|
+
currency: string
|
|
5
|
+
currency_supported: boolean
|
|
6
|
+
currency_errors: string[]
|
|
7
|
+
supported_currencies: string[]
|
|
8
|
+
client_token?: string
|
|
9
|
+
intent?: "capture" | "authorize"
|
|
10
|
+
paypal_enabled?: boolean
|
|
11
|
+
paypal_title?: string
|
|
12
|
+
card_enabled?: boolean
|
|
13
|
+
card_title?: string
|
|
14
|
+
card_three_ds?: "sli" | "when_required" | "always"
|
|
15
|
+
button_color?: "gold" | "blue" | "silver" | "black" | "white"
|
|
16
|
+
button_shape?: "rect" | "pill"
|
|
17
|
+
button_width?: string
|
|
18
|
+
button_height?: number
|
|
19
|
+
button_label?: "paypal" | "checkout" | "buynow" | "pay" | "installment"
|
|
20
|
+
disable_buttons?: string[]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type PayPalSettingsResponse = {
|
|
24
|
+
/**
|
|
25
|
+
* What `GET /store/paypal/settings` actually returns: the configured
|
|
26
|
+
* payment action and whether advanced card fields are enabled.
|
|
27
|
+
*/
|
|
28
|
+
paymentAction?: "capture" | "authorize"
|
|
29
|
+
advancedCardEnabled?: boolean
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated The settings endpoint has never returned a `data` envelope —
|
|
32
|
+
* kept only so existing (already-null-safe) consumer code keeps compiling.
|
|
33
|
+
*/
|
|
34
|
+
data?: {
|
|
35
|
+
api_details?: { currency_code?: string }
|
|
36
|
+
paypal_settings?: Record<string, unknown>
|
|
37
|
+
onboarding_config?: Record<string, unknown>
|
|
38
|
+
}
|
|
39
|
+
[key: string]: unknown
|
|
40
|
+
}
|