@flopay/shared 1.4.0 → 1.4.2
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/README.md +10 -9
- package/dist/index.cjs +45 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +116 -70
- package/dist/index.d.ts +116 -70
- package/dist/index.mjs +42 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ throw validationError('Email is required', 'email');
|
|
|
86
86
|
| `ThemeBundleId` | Bundle id: `'modern-light'` / `'modern-dark'` / `'bold-light'` / `'bold-dark'` / `'glass-light'` / `'glass-dark'` |
|
|
87
87
|
| `ThemeId` | Accepted by the React components' `theme` prop: `'classic'` ∪ `ThemeBundleId` |
|
|
88
88
|
| `CheckoutMode` | Checkout mode: `'full'` / `'auto'` / `'confirm'` |
|
|
89
|
-
| `CheckoutSession` | Session object: `id`, `clientSecret`, `mode`, `status`, `amount`, `currency`, `customer?`, `checkoutMode?`, `products?` (unified `CheckoutSessionProduct[]`), `successUrl?`, `cancelUrl?`, `coupons?`, `subtotalAmount?` / `discountAmount?` / `totalAmount?` (cart-currency major units; populated by billing API ≥ v1.1.2), `gateways?` (map keyed by gateway code — `stripe`, `paypal`, …), `accountData?`, `tagsData?` |
|
|
89
|
+
| `CheckoutSession` | Session object: `id`, `clientSecret`, `mode`, `status`, `amount`, `currency`, `customer?`, `checkoutMode?`, `vault?` (hosted card widget), `products?` (unified `CheckoutSessionProduct[]`), `successUrl?`, `cancelUrl?`, `coupons?`, `subtotalAmount?` / `discountAmount?` / `totalAmount?` (cart-currency major units; populated by billing API ≥ v1.1.2), `gateways?` (map keyed by gateway code — `stripe`, `paypal`, …), `accountData?`, `tagsData?` |
|
|
90
90
|
| `CheckoutSessionProduct` | Unified product from session response: `uuid`, `checkoutSessionId`, `type` (`'item'`/`'subscription'`), `code?`, `name?`, `description?`, `quantity`, `totalAmount?`, `overrideAmount?`, `currency?`, `metadata?` |
|
|
91
91
|
| `CheckoutProductType` | `'item'` / `'subscription'` |
|
|
92
92
|
| `CheckoutProduct` | Unified product input for session creation: `type`, `code?`, `name?`, `quantity?`, `totalAmount?`, `overrideAmount?`, `currency?`, `metadata?` |
|
|
@@ -94,14 +94,15 @@ throw validationError('Email is required', 'email');
|
|
|
94
94
|
| `CheckoutGateways` | Map keyed by gateway code (e.g. `stripe`, `paypal`). A session can advertise multiple concurrent gateways. |
|
|
95
95
|
| `GatewayEnvironment` | `'sandbox'` / `'live'` — drives the PayPal JS SDK script and any other environment-scoped behavior |
|
|
96
96
|
| `PaymentResult` | Payment outcome: `status` (`'succeeded'`/`'processing'`/`'requires_action'`/`'failed'`), `paymentIntentId?`, `error?` |
|
|
97
|
-
| `ConfirmPaymentParams` | `clientSecret`, `returnUrl
|
|
98
|
-
| `
|
|
99
|
-
| `
|
|
100
|
-
| `
|
|
101
|
-
| `
|
|
102
|
-
| `
|
|
97
|
+
| `ConfirmPaymentParams` | Non-card confirmation: `clientSecret`, `paymentMethodCategory` (`'wallet'`/`'apm'`), `paymentMethodType`, `returnUrl?`, `billingDetails?`; `card` is rejected at runtime. |
|
|
98
|
+
| `PayPalPaymentResult` | Stripe-hosted PayPal outcome: `status`, `paymentIntentId?`, `paymentMethodId?`, `error?` |
|
|
99
|
+
| `CreateSessionIntentRequest` | Discriminated Stripe wallet/APM or PayPal order/subscription intent request. Direct card is not representable. |
|
|
100
|
+
| `SessionIntent` | Matching discriminated response with provider, payment-method category/type/id, intent kind, client secret, and provider object ID kept as separate fields. |
|
|
101
|
+
| `SessionIntentDeclineRequest` | Non-card provider decline classification. Runtime reporting accepts safe classification codes only and rejects messages or identifier-shaped values. |
|
|
102
|
+
| `ElementType` | `'payment'` / `'address'` |
|
|
103
|
+
| `ElementOptions` | Options for creating non-card elements: `appearance?`, `paymentMethodTypes?`, `clientSecret?`, `amount?`, `currency?`, `paymentMethodCreation?`, `layout?`, `defaultValues?`, `readOnly?`, `mode?`. A `payment` element requires a non-empty wallet/APM allowlist. |
|
|
103
104
|
| `MountedElement` | Runtime element: `mount()`, `unmount()`, `update()`, `on()`, `off()`, `destroy()` |
|
|
104
|
-
| `PaymentProviderAdapter` | Provider interface
|
|
105
|
+
| `PaymentProviderAdapter` | Provider interface for non-card elements, confirmations, PayPal, raw-provider access, and lifecycle management. Card collection uses `CardCaptureAdapter`. |
|
|
105
106
|
| `ElementChangeEvent` | Change event: `elementType`, `complete`, `empty`, `error?`, `value?` |
|
|
106
107
|
| `Customer` | `id`, `email`, `firstName?`, `lastName?`, `gender?`, `city?`, `state?`, `country?`, `zip?` |
|
|
107
108
|
| `LineItem` | `price?`, `priceData?`, `quantity` |
|
|
@@ -177,7 +178,7 @@ policy.
|
|
|
177
178
|
| `THEMES` | `Record<ThemeBundleId, ThemeBundle>` — pick `THEMES['glass-dark']` to get `{ appearance, buttonsLayout }` |
|
|
178
179
|
| `resolveTheme(id)` | Resolve a `ThemeId` (`'classic'` ∪ `ThemeBundleId`) to its `ThemeBundle`; `'classic'` and missing ids return `undefined` |
|
|
179
180
|
| `resolveButtonsLayoutTheme(name)` | Map a `ButtonsLayoutTheme` name to its `ButtonsLayoutStyles` preset |
|
|
180
|
-
| `ELEMENT_TYPES` | `['payment', '
|
|
181
|
+
| `ELEMENT_TYPES` | `['payment', 'address']` |
|
|
181
182
|
| `SUPPORTED_CARD_BRANDS` | `['visa', 'mastercard', 'mastercard_debit', 'amex', 'discover']` |
|
|
182
183
|
| `STRIPE_EXPRESS_METHODS` | `['apple_pay', 'google_pay', 'paypal', 'link', 'amazon_pay', 'klarna']` — Stripe method type identifiers supported by `ExpressCheckoutElement` (everything else returned in `gateways.stripe.enabledPaymentMethods` falls into the `PaymentElement` accordion in the React SDK) |
|
|
183
184
|
| `partitionStripeMethods(enabledMethods, { excludePaypal? })` | Split the backend's enabled list into `{ expressMethods, paymentElementMethods }`. Drops `card`; also drops `paypal` when `excludePaypal: true`. |
|
package/dist/index.cjs
CHANGED
|
@@ -79,6 +79,7 @@ __export(index_exports, {
|
|
|
79
79
|
TELEMETRY_SDK_PACKAGES: () => TELEMETRY_SDK_PACKAGES,
|
|
80
80
|
THEMES: () => THEMES,
|
|
81
81
|
US_STATES: () => US_STATES,
|
|
82
|
+
UUID_V4: () => UUID_V42,
|
|
82
83
|
apiError: () => apiError,
|
|
83
84
|
authenticationError: () => authenticationError,
|
|
84
85
|
buildCheckoutDisplayData: () => buildCheckoutDisplayData,
|
|
@@ -110,6 +111,7 @@ __export(index_exports, {
|
|
|
110
111
|
isAVSFieldVisible: () => isAVSFieldVisible,
|
|
111
112
|
isPostalCodeSupported: () => isPostalCodeSupported,
|
|
112
113
|
isSetupIntentClientSecret: () => isSetupIntentClientSecret,
|
|
114
|
+
isUuidV4: () => isUuidV4,
|
|
113
115
|
isValidPostalCode: () => isValidPostalCode,
|
|
114
116
|
isValidPublishableKey: () => isValidPublishableKey,
|
|
115
117
|
isValidSecretKey: () => isValidSecretKey,
|
|
@@ -117,6 +119,7 @@ __export(index_exports, {
|
|
|
117
119
|
networkError: () => networkError,
|
|
118
120
|
normalizeGatewayEnvironment: () => normalizeGatewayEnvironment,
|
|
119
121
|
partitionStripeMethods: () => partitionStripeMethods,
|
|
122
|
+
randomUuidV4: () => randomUuidV4,
|
|
120
123
|
rateLimitError: () => rateLimitError,
|
|
121
124
|
resolveAVSConfig: () => resolveAVSConfig,
|
|
122
125
|
resolveBillingApiUrl: () => resolveBillingApiUrl,
|
|
@@ -490,23 +493,21 @@ function getFloPayEnvironment() {
|
|
|
490
493
|
}
|
|
491
494
|
|
|
492
495
|
// src/payment-logos.generated.ts
|
|
493
|
-
var
|
|
494
|
-
alipay
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
sepa_debit: '<svg style="display:block;width:100%;height:100%" viewBox="0 0 120 80" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="120" height="80" rx="4" fill="white"/><path fill-rule="evenodd" clip-rule="evenodd" d="M61.7961 51.0291L61.7626 52.2779H57.8379V46.1184H59.2417V51.0291H61.7961Z" fill="#005DA1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M65.3571 50.1424C65.2336 50.0933 64.9856 50.0354 64.6468 50.0354C64.0768 50.0354 63.8121 50.2573 63.8121 50.6922C63.8121 51.1772 64.1015 51.3499 64.5242 51.3499C64.9609 51.3499 65.3571 51.0868 65.3571 50.7668V50.1424ZM65.5486 51.8015L65.523 51.7928C65.2177 52.1541 64.7386 52.3601 64.1668 52.3601C63.2174 52.3601 62.6147 51.8261 62.6147 50.7089C62.6147 49.789 63.2589 49.1567 64.3989 49.1567C64.7703 49.1567 65.0924 49.2146 65.3571 49.2962V49.0094C65.3571 48.5078 65.0924 48.2781 64.4077 48.2781C63.8545 48.2781 63.4909 48.3605 63.0268 48.549L62.9192 47.5309C63.4247 47.3169 63.9939 47.2021 64.6389 47.2021C66.1177 47.2021 66.6303 47.8343 66.6303 49.1979V52.2777H65.6465L65.5486 51.8015Z" fill="#005DA1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M69.4 52.3767C68.7956 52.3767 68.2503 52.2618 67.8294 52.0321L67.9609 50.9806C68.3756 51.2183 68.9624 51.3332 69.3912 51.3332C69.9038 51.3332 70.1183 51.128 70.1183 50.8324C70.1183 50.0353 67.7968 50.4957 67.7968 48.755C67.7968 47.8597 68.4083 47.2186 69.6974 47.2186C70.2003 47.2186 70.698 47.3177 71.118 47.4896L71.0112 48.5323C70.5974 48.3604 70.0441 48.278 69.6727 48.278C69.2518 48.278 69.0188 48.4428 69.0188 48.6971C69.0188 49.4522 71.3085 49.0006 71.3085 50.7176C71.3085 51.7111 70.7544 52.3767 69.4 52.3767Z" fill="#005DA1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M73.8302 48.2537V50.7994C73.8302 51.1861 74.0287 51.3501 74.4249 51.3501C74.5573 51.3501 74.7302 51.3255 74.822 51.2922L74.8961 52.22C74.7223 52.2945 74.3923 52.3603 74.0358 52.3603C73.037 52.3603 72.549 51.785 72.549 50.8406V48.2537H71.987V47.3013H72.6064L72.8208 46.1754L73.8302 46.085V47.3013H74.9464V48.2537H73.8302Z" fill="#005DA1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M97.9976 52.2778V48.2457H97.3693V47.3013H97.9976V47.0873C97.9976 46.3401 98.5182 45.7245 99.7155 45.7245C99.9979 45.7245 100.31 45.7649 100.526 45.8307L100.451 46.6523C100.302 46.619 100.138 46.6032 99.9714 46.6032C99.4693 46.6032 99.2779 46.7997 99.2779 47.1206V47.3013H100.344V48.2457H99.2779V52.2778H97.9976Z" fill="#005DA1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M94.8401 52.2778V47.3337L96.154 47.2758V52.2778H94.8401ZM95.501 46.7672C95.0051 46.7672 94.766 46.6269 94.766 46.2253C94.766 45.8719 95.0051 45.6746 95.501 45.6746C96.0057 45.6746 96.2281 45.864 96.2281 46.2253C96.2281 46.5866 96.0057 46.7672 95.501 46.7672Z" fill="#005DA1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M90.5345 52.2778V47.3337L91.5581 47.2846L91.6745 48.1142H91.6983C92.0133 47.5143 92.5013 47.2188 93.0713 47.2188C93.2945 47.2188 93.4842 47.2521 93.6157 47.2925L93.5328 48.5491C93.3775 48.5 93.1869 48.4667 92.9875 48.4667C92.3186 48.4667 91.8236 48.9516 91.8236 49.7812V52.2778H90.5345Z" fill="#005DA1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M87.9053 52.2778V49.1077C87.9053 48.5982 87.6494 48.3351 87.1041 48.3351C86.7318 48.3351 86.4097 48.5 86.2527 48.7131V52.2778H84.9715V45.8885L86.2527 45.8228V46.9557L86.2359 47.6126L86.2606 47.6301C86.633 47.317 87.0856 47.2022 87.5091 47.2022C88.5662 47.2022 89.1856 47.909 89.1856 49.1077V52.2778H87.9053Z" fill="#005DA1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M83.6814 48.5161C83.4256 48.4258 83.1194 48.36 82.83 48.36C81.8973 48.36 81.5903 48.7459 81.5903 49.7973C81.5903 50.8654 82.0288 51.2837 82.8053 51.2837C83.1361 51.2837 83.4503 51.2179 83.715 51.0952L83.8067 52.0887C83.5094 52.2694 83.062 52.3764 82.5247 52.3764C81.0458 52.3764 80.2597 51.538 80.2597 49.7973C80.2597 48.1461 80.9461 47.2183 82.5494 47.2183C82.9703 47.2183 83.4423 47.3086 83.7556 47.4323L83.6814 48.5161Z" fill="#005DA1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M77.4249 52.3767C76.8213 52.3767 76.276 52.2618 75.8543 52.0321L75.9866 50.9806C76.4005 51.2183 76.9872 51.3332 77.4169 51.3332C77.9296 51.3332 78.144 51.128 78.144 50.8324C78.144 50.0353 75.8225 50.4957 75.8225 48.755C75.8225 47.8597 76.4331 47.2186 77.7231 47.2186C78.226 47.2186 78.7228 47.3177 79.1437 47.4896L79.0369 48.5323C78.6231 48.3604 78.0699 48.278 77.6984 48.278C77.2766 48.278 77.0446 48.4428 77.0446 48.6971C77.0446 49.4522 79.3343 49.0006 79.3343 50.7176C79.3343 51.7111 78.7802 52.3767 77.4249 52.3767Z" fill="#005DA1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M102.973 48.2537V50.7994C102.973 51.1861 103.171 51.3501 103.567 51.3501C103.699 51.3501 103.873 51.3255 103.964 51.2922L104.038 52.22C103.865 52.2945 103.535 52.3603 103.178 52.3603C102.179 52.3603 101.691 51.785 101.691 50.8406V48.2537H101.128V47.3013H101.748L101.963 46.1754L102.973 46.085V47.3013H104.088V48.2537H102.973Z" fill="#005DA1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M61.9028 42.6681C60.3543 42.6681 58.9311 42.2971 57.7734 41.678L58.1652 39.113C59.3405 39.7321 60.5502 40.0864 61.8667 40.0864C63.3261 40.0864 63.9676 39.5559 63.9676 38.636C63.9676 36.5489 57.8273 37.4328 57.8273 32.993C57.8273 30.7472 59.2867 28.9249 62.6679 28.9249C63.9676 28.9249 65.3731 29.1906 66.4055 29.6151L66.0323 32.1266C64.9284 31.7732 63.8255 31.561 62.8108 31.561C61.1555 31.561 60.7108 32.1266 60.7108 32.8342C60.7108 34.9038 66.8502 33.9488 66.8502 38.4413C66.8502 41.0589 65.0167 42.6681 61.9028 42.6681Z" fill="#005DA1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M78.421 39.8206V42.4207H69.3451V29.1555H78.421V31.7906H72.3531V34.4258H77.2819V36.7961H72.3531V39.8206H78.421Z" fill="#005DA1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M85.8635 31.6491H84.0829V35.7171H85.8635C87.3406 35.7171 87.9803 35.3462 87.9803 33.6835C87.9803 32.0911 87.4121 31.6491 85.8635 31.6491ZM85.8635 38.105H84.0829V42.4212H81.0759V29.1551H85.8635C89.565 29.1551 91.0774 30.6055 91.0774 33.7011C91.0774 36.4958 89.5835 38.105 85.8635 38.105Z" fill="#005DA1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M97.4702 32.7984L96.1352 37.3443H99.5349L98.2528 32.7984L97.8972 31.4014H97.8434L97.4702 32.7984ZM100.246 39.8383H95.4055L94.6581 42.4209H91.4905L96.0999 29.1556H99.6769L104.339 42.4209H100.993L100.246 39.8383Z" fill="#005DA1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M29.6441 39.6275C29.6018 39.6836 29.5374 39.7117 29.4712 39.7257C29.3971 39.7345 29.3203 39.7178 29.2568 39.6705L25.8235 37.1072L21.2291 33.6776L17.795 31.1135C17.7324 31.0661 17.6953 30.9977 17.6821 30.924C17.6777 30.8574 17.6874 30.7881 17.7297 30.732L18.6659 29.4929C18.6659 29.4929 19.6938 28.1714 20.5965 26.9779L24.4603 29.863L28.6462 32.9883L32.5109 35.8734C31.6082 37.0669 30.5803 38.3884 30.5803 38.3884L29.6441 39.6275ZM23.1862 24.0034L26.5991 26.5526L28.9065 28.2749L31.2121 29.998L34.6268 32.5455C34.7582 32.6428 34.7856 32.8261 34.6885 32.9541L33.8697 34.0748L30.0059 31.1897L25.82 28.0644L21.9562 25.1793L22.7741 24.0586C22.8703 23.9306 23.0556 23.906 23.1862 24.0034ZM35.0177 32.0491L29.2868 27.7715L23.5568 23.4921C23.1571 23.1948 22.5906 23.2738 22.2915 23.6693L17.2471 30.3435C17.1668 30.4479 17.1191 30.5636 17.0909 30.6838C17.0044 31.024 17.1244 31.4002 17.4235 31.6247L20.8391 34.1739L25.453 37.6185L28.8668 40.1668C29.1668 40.3913 29.5638 40.4009 29.8682 40.2221C29.9768 40.1633 30.0747 40.0844 30.1541 39.98L35.1985 33.3066C35.4977 32.9111 35.4165 32.3473 35.0177 32.0491Z" fill="#A4AAB6"/><path fill-rule="evenodd" clip-rule="evenodd" d="M16.4587 56.1126L20.484 42.8281H31.3907L30.451 44.0786L29.0975 45.9368L28.944 46.2113L28.8019 46.5305L28.6563 46.89L28.5046 47.2715L28.359 47.6871L28.2152 48.0958L28.0802 48.507L27.9469 48.9104L27.8269 49.2928L27.7166 49.6453L27.6187 49.9531L27.5446 50.21L27.4872 50.4056L27.4396 50.5275C27.4396 50.5275 27.4316 50.5538 27.4078 50.5854C27.3805 50.6231 27.2155 50.773 27.0813 50.6739C26.9525 50.5783 26.9657 50.2416 26.979 50.0811C27.0196 49.5892 27.0593 49.0972 27.0999 48.6061C27.1122 48.4334 26.9004 48.336 26.7637 48.4141C26.161 48.7587 25.8019 49.1761 25.4728 49.6532C25.5037 49.5418 25.5346 49.4296 25.5646 49.3182C25.704 48.8113 25.899 48.2869 25.974 47.766C26.0163 47.4688 25.9405 47.1154 25.591 47.0584C25.1975 46.9926 24.9399 47.4039 24.7475 47.6748C24.1643 48.4921 23.821 49.5304 23.0975 50.2416C22.8249 50.5091 22.5231 50.7064 22.1322 50.5959C21.6778 50.4678 21.5013 50.9984 22.3025 51.0703C23.0905 51.1404 23.6763 50.3135 24.0337 49.7356C24.2931 49.3156 24.5216 48.8771 24.774 48.4536C24.8957 48.2501 25.0219 48.0493 25.1613 47.8572C25.2222 47.7757 25.336 47.5565 25.4419 47.5275C25.5813 47.4889 25.5452 47.5687 25.5372 47.6784C25.5187 47.9256 25.4128 48.18 25.3475 48.4185C25.2769 48.6789 25.2054 48.9394 25.134 49.1998C24.9813 49.7584 24.8296 50.317 24.6769 50.8747C24.6081 51.1282 24.9434 51.2457 25.0846 51.0457C25.6457 50.2512 25.9255 49.5778 26.6172 49.0464C26.6022 49.2209 26.5881 49.3954 26.574 49.5708C26.551 49.8593 26.4955 50.1644 26.5149 50.4529C26.5484 50.9247 26.9066 51.2518 27.3575 51.0457C27.5931 50.937 27.7625 50.773 27.7625 50.773L27.789 50.7537L27.8843 50.6827L28.0581 50.5687L28.2937 50.4073L28.5557 50.2127L28.8452 50.0092L29.1857 49.7716L29.5316 49.5181L29.8766 49.2656L30.2225 49.0122L30.5587 48.7578L30.8746 48.5202L31.1657 48.2843L31.4207 48.0879L31.6237 47.9002L31.7816 47.7494L31.7878 47.7406L31.7913 47.7441L32.8669 46.4814L35.6154 42.8281H40.4949L44.2907 56.1126H16.4587ZM36.0487 42.2528L44.6922 30.7651L45.5737 29.6102C45.6646 29.4866 45.6513 29.3735 45.5649 29.3112L43.1181 27.5495C43.0325 27.4872 42.9205 27.5118 42.8569 27.5968C42.851 27.605 42.7319 27.7567 42.4996 28.0519L31.8231 42.2528H20.0657L15.6602 56.6879H45.0769L40.921 42.2528H36.0487Z" fill="#005DA1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M46.6821 30.1526L46.3592 29.9114C46.2947 29.8632 46.2021 29.8763 46.1536 29.9404L42.0453 35.3738C41.9959 35.4369 42.01 35.529 42.0736 35.5772L42.3974 35.8184C42.4618 35.8666 42.5527 35.8534 42.6021 35.7894L46.7112 30.356C46.7598 30.292 46.7465 30.2008 46.6821 30.1526Z" fill="#0062A5"/><path fill-rule="evenodd" clip-rule="evenodd" d="M30.178 53.2862H38.353L38.1792 52.6426H30.178H22.1768L22.0039 53.2862H30.178Z" fill="#005DA1"/></svg>',
|
|
505
|
-
wechat_pay: '<svg style="display:block;width:100%;height:100%" viewBox="0 0 120 80" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="120" height="80" rx="4" fill="white"/><path d="M73.2397 56.5749C73.3943 56.5493 73.685 56.5139 74.1093 56.5139C75.2631 56.5139 75.9244 57.0591 75.9244 58.0102C75.9244 59.0356 75.2281 59.624 74.0135 59.624C73.7781 59.624 73.4812 59.6156 73.2397 59.5535V56.5749ZM74.1303 55.8092C73.6062 55.8092 73.0794 55.8556 72.5652 55.949L72.4497 55.9695V63.3045H73.2397V60.2803C73.4528 60.32 73.6885 60.3286 73.9712 60.3286C74.9189 60.3286 75.7031 60.0294 76.179 59.4862C76.539 59.0907 76.7145 58.5908 76.7145 57.9571C76.7145 57.3385 76.5089 56.8185 76.1199 56.4539C75.6873 56.0322 74.9996 55.8092 74.1303 55.8092Z" fill="#222222"/><path d="M85.8919 57.9234L84.6149 61.3183C84.5129 61.5845 84.4225 61.8497 84.3464 62.0757C84.2652 61.8285 84.1757 61.5754 84.0894 61.348L82.7506 58.012L82.716 57.9234H81.8714L83.8401 62.8445C83.8929 62.9785 83.8937 63.0156 83.8937 63.0156C83.8937 63.0495 83.8662 63.1212 83.841 63.1845C83.5868 63.7873 83.2551 64.1914 83.0221 64.4242C82.7027 64.7323 82.3561 64.8902 82.1784 64.9569L82.0353 65.0095L82.4088 65.6554L82.4852 65.6266C82.6193 65.5757 82.9748 65.4212 83.3708 65.0875C84.0503 64.4946 84.4799 63.5939 85.1304 61.9203L86.7396 57.9234H85.8919Z" fill="#222222"/><path d="M80.1643 61.5279C80.1643 61.5953 80.1565 61.6957 80.119 61.7911C79.9659 62.238 79.5243 62.7163 78.7428 62.7163C78.3362 62.7163 77.8619 62.4748 77.8619 61.7938C77.8619 61.4999 77.958 61.2572 78.148 61.0726C78.4922 60.7391 79.1375 60.5702 80.0666 60.5702L80.1634 60.5708L80.1643 61.5279ZM80.9543 61.953V59.9554C80.9543 58.5493 80.2962 57.8066 79.0508 57.8066C78.5316 57.8066 77.9661 57.9639 77.5372 58.2278L77.4575 58.2776L77.7971 58.8643L77.8815 58.8116C78.1929 58.618 78.5889 58.5114 78.9971 58.5114H79.016C79.3664 58.5114 79.6396 58.6058 79.8275 58.7913C80.0539 59.0155 80.1639 59.3683 80.1643 59.8672C78.9448 59.8714 78.064 60.1331 77.5455 60.6461C77.2171 60.9711 77.0508 61.3857 77.0508 61.8785C77.0508 62.6218 77.5635 63.4213 78.6887 63.4213C79.4746 63.4213 79.9769 63.0423 80.24 62.764L80.2943 63.3048H81.0533L81.0272 63.1421C80.9631 62.7478 80.9543 62.3379 80.9543 61.953Z" fill="#222222"/><path d="M40.1196 59.9908L39.9602 60.5577C39.8267 61.0302 39.7086 61.4484 39.6068 61.8603C39.4771 61.2522 39.2971 60.5723 39.1358 59.9723L38.0649 55.9331L38.0456 55.8619H37.3435L36.1456 59.9989C35.9315 60.6985 35.7411 61.3299 35.6076 61.8828C35.505 61.4456 35.3816 60.9587 35.2521 60.4472L34.0902 55.9331L34.0714 55.8619H33.2607L35.2072 63.2322L35.226 63.3048H35.9165L37.1686 59.0819C37.3865 58.362 37.5515 57.7964 37.6706 57.3016C37.7768 57.8238 37.925 58.397 38.1102 59.0766L39.192 63.2327L39.2113 63.3048H39.9121L42.1057 55.9861L42.1436 55.8619H41.329L40.1196 59.9908Z" fill="#222222"/><path d="M42.9317 59.9105C43.1288 58.8019 43.8565 58.4048 44.4796 58.4048C44.8753 58.4048 45.1929 58.5242 45.4243 58.7597C45.7661 59.1067 45.8436 59.6106 45.8571 59.9105H42.9317ZM44.5436 57.7002C43.0869 57.7002 42.1086 58.867 42.1086 60.6035C42.1086 62.2192 43.1214 63.3048 44.6288 63.3048C45.5762 63.3048 46.1145 63.0614 46.3016 62.9573L46.4173 62.8931L46.076 62.3019L45.9955 62.3385C45.7288 62.4624 45.3657 62.5887 44.6926 62.5887C43.5888 62.5887 42.9338 61.8626 42.8897 60.5943H46.6221L46.6464 60.4845C46.6706 60.3741 46.6706 60.2931 46.6706 60.1458C46.6706 59.9472 46.6428 59.2517 46.2836 58.6471C45.91 58.0184 45.3245 57.7002 44.5436 57.7002Z" fill="#222222"/><path d="M52.8041 62.321C52.4132 62.5012 51.8646 62.6088 51.3372 62.6088C49.5816 62.6088 48.5339 61.4989 48.5339 59.6402C48.5339 57.7104 49.6128 56.5578 51.42 56.5578C51.9199 56.5578 52.3952 56.6522 52.7583 56.8228L52.8366 56.8595L53.1897 56.2475L53.0843 56.189C52.9446 56.1127 52.4121 55.863 51.4097 55.863C49.2186 55.863 47.7461 57.3768 47.7461 59.6296C47.7461 62.3412 49.592 63.3037 51.1725 63.3037C52.063 63.3037 52.7573 63.1149 53.1109 62.9387L53.2254 62.8806L52.8817 62.2856L52.8041 62.321Z" fill="#222222"/><path d="M56.8701 57.8067C56.4716 57.8067 56.0898 57.9165 55.769 58.1225C55.5846 58.2285 55.4129 58.3741 55.2668 58.5485V55.7447H54.4768V63.3048H55.2668V60.0509C55.2668 59.8559 55.2753 59.7303 55.3228 59.5871C55.5439 58.9668 56.1234 58.5329 56.7317 58.5329C57.8307 58.5329 57.9944 59.5436 57.9944 60.1467V63.3048H58.7849V60.0935C58.7849 57.9168 57.1893 57.8067 56.8701 57.8067Z" fill="#222222"/><path d="M66.2943 56.7776H65.5039V57.973H64.6432V58.618H65.5039V61.6983C65.5039 62.3118 65.6185 62.7408 65.8523 63.0064C66.0643 63.2778 66.4041 63.4211 66.8343 63.4211C67.133 63.4211 67.3914 63.3744 67.6027 63.282L67.7294 63.2269L67.3977 62.652L67.3294 62.667C67.2095 62.6925 67.0646 62.7058 66.8985 62.7058C66.475 62.7058 66.2943 62.4329 66.2943 61.7937V58.618H67.7502V57.973H66.2943V56.7776Z" fill="#222222"/><path d="M61.178 61.0725C61.5214 60.7392 62.1673 60.5703 63.0968 60.5703L63.1931 60.5709L63.1946 61.5278C63.1946 61.5951 63.1867 61.6951 63.1486 61.7913C62.9962 62.2384 62.5546 62.7166 61.7722 62.7166C61.366 62.7166 60.8916 62.4747 60.8916 61.7937C60.8916 61.4998 60.9879 61.2571 61.178 61.0725ZM63.9844 61.9529V59.9552C63.9844 58.5495 63.3262 57.8067 62.0802 57.8067C61.5297 57.8067 60.9403 57.9778 60.5056 58.2644L60.424 58.3134L60.7674 58.9069L60.8532 58.8491C61.1727 58.6311 61.5897 58.5114 62.027 58.5114H62.0453C62.3967 58.5114 62.6695 58.6057 62.8572 58.7915C63.084 59.0158 63.1942 59.3682 63.1946 59.8671C61.9744 59.8712 61.0934 60.1328 60.5749 60.646C60.2468 60.971 60.0806 61.386 60.0806 61.8786C60.0806 62.6219 60.5934 63.4212 61.719 63.4212C62.5042 63.4212 63.0064 63.0418 63.2698 62.7639L63.3239 63.3047H64.0828L64.0569 63.1427C63.9931 62.7493 63.9844 62.3384 63.9844 61.9529Z" fill="#222222"/><path d="M54.7867 35.6905C54.6142 35.7776 54.4195 35.8281 54.2128 35.8281C53.735 35.8281 53.3191 35.5646 53.1008 35.1759L53.0175 34.9927L49.5359 27.3531C49.4984 27.2702 49.4749 27.1763 49.4749 27.0847C49.4749 26.7324 49.7604 26.4471 50.1125 26.4471C50.2555 26.4471 50.3874 26.4941 50.494 26.5739L54.6018 29.4988C54.9024 29.6951 55.2607 29.8102 55.6465 29.8102C55.8769 29.8102 56.0959 29.7676 56.3007 29.6929L75.6211 21.0937C72.1581 17.012 66.4546 14.3447 60.0001 14.3447C49.438 14.3447 40.8765 21.4795 40.8765 30.2814C40.8765 35.0835 43.4523 39.4062 47.4839 42.3275C47.8078 42.5585 48.0194 42.9376 48.0194 43.366C48.0194 43.5074 47.9893 43.6373 47.9524 43.7721C47.6302 44.9734 47.1149 46.8967 47.0902 46.9868C47.0505 47.1373 46.9876 47.2946 46.9876 47.453C46.9876 47.8046 47.2732 48.0902 47.6253 48.0902C47.7637 48.0902 47.8765 48.0389 47.9935 47.9715L52.1802 45.5544C52.4952 45.3725 52.8286 45.2602 53.1956 45.2602C53.3912 45.2602 53.5801 45.2901 53.7577 45.3444C55.7109 45.9061 57.818 46.2183 60.0001 46.2183C70.5617 46.2183 79.1236 39.0831 79.1236 30.2814C79.1236 27.6155 78.3342 25.1046 76.9457 22.8966L54.9262 35.61L54.7867 35.6905Z" fill="#14AB39"/></svg>'
|
|
506
|
-
};
|
|
496
|
+
var VENDORED_LOGO_METHODS = [
|
|
497
|
+
"alipay",
|
|
498
|
+
"bancontact",
|
|
499
|
+
"blik",
|
|
500
|
+
"eps",
|
|
501
|
+
"giropay",
|
|
502
|
+
"ideal",
|
|
503
|
+
"klarna",
|
|
504
|
+
"p24",
|
|
505
|
+
"sepa_debit",
|
|
506
|
+
"wechat_pay"
|
|
507
|
+
];
|
|
507
508
|
|
|
508
509
|
// src/constants.ts
|
|
509
|
-
var SDK_VERSION2 = "1.4.
|
|
510
|
+
var SDK_VERSION2 = "1.4.1";
|
|
510
511
|
var FLO_SDK_VERSION_HEADER = "x-flo-sdk-version";
|
|
511
512
|
var BILLING_API_URL_STAGING = "https://api.stage.flopay.com";
|
|
512
513
|
var BILLING_API_URL_PRODUCTION = "https://api.flopay.com";
|
|
@@ -1664,15 +1665,9 @@ var STRIPE_METHOD_MATRIX = {
|
|
|
1664
1665
|
},
|
|
1665
1666
|
zip: { displayName: "Zip", currencies: ["aud"], countries: ["AU", "NZ"] }
|
|
1666
1667
|
};
|
|
1667
|
-
for (const [method, entry] of Object.entries(STRIPE_METHOD_MATRIX)) {
|
|
1668
|
-
const realLogo = PAYMENT_METHOD_LOGOS[method];
|
|
1669
|
-
if (!realLogo || !entry.theme) continue;
|
|
1670
|
-
if (entry.theme.light) entry.theme.light.logoSvg = realLogo;
|
|
1671
|
-
if (entry.theme.dark) entry.theme.dark.logoSvg = realLogo;
|
|
1672
|
-
}
|
|
1673
1668
|
function hasVendoredStripeMethodLogo(type) {
|
|
1674
1669
|
if (!type) return false;
|
|
1675
|
-
return
|
|
1670
|
+
return VENDORED_LOGO_METHODS.includes(type);
|
|
1676
1671
|
}
|
|
1677
1672
|
var STRIPE_EXPRESS_METHODS = Object.entries(STRIPE_METHOD_MATRIX).filter(([, entry]) => entry.express).map(([key]) => key);
|
|
1678
1673
|
var STRIPE_EXPRESS_METHODS_SET = new Set(STRIPE_EXPRESS_METHODS);
|
|
@@ -1770,10 +1765,6 @@ function partitionStripeMethods(enabledPaymentMethods, options) {
|
|
|
1770
1765
|
}
|
|
1771
1766
|
var ELEMENT_TYPES = [
|
|
1772
1767
|
"payment",
|
|
1773
|
-
"card",
|
|
1774
|
-
"cardNumber",
|
|
1775
|
-
"cardExpiry",
|
|
1776
|
-
"cardCvc",
|
|
1777
1768
|
"address"
|
|
1778
1769
|
];
|
|
1779
1770
|
var SUPPORTED_CARD_BRANDS = [
|
|
@@ -2627,6 +2618,31 @@ function resolveIdempotencyKey(supplied) {
|
|
|
2627
2618
|
}
|
|
2628
2619
|
return supplied;
|
|
2629
2620
|
}
|
|
2621
|
+
|
|
2622
|
+
// src/uuid.ts
|
|
2623
|
+
var UUID_V42 = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
2624
|
+
function isUuidV4(value) {
|
|
2625
|
+
return typeof value === "string" && UUID_V42.test(value);
|
|
2626
|
+
}
|
|
2627
|
+
function randomUuidV4() {
|
|
2628
|
+
try {
|
|
2629
|
+
const id = globalThis.crypto.randomUUID();
|
|
2630
|
+
if (UUID_V42.test(id)) return id;
|
|
2631
|
+
} catch {
|
|
2632
|
+
}
|
|
2633
|
+
const bytes = new Uint8Array(16);
|
|
2634
|
+
try {
|
|
2635
|
+
globalThis.crypto.getRandomValues(bytes);
|
|
2636
|
+
} catch {
|
|
2637
|
+
for (let index = 0; index < bytes.length; index += 1) {
|
|
2638
|
+
bytes[index] = Math.floor(Math.random() * 256);
|
|
2639
|
+
}
|
|
2640
|
+
}
|
|
2641
|
+
bytes[6] = bytes[6] & 15 | 64;
|
|
2642
|
+
bytes[8] = bytes[8] & 63 | 128;
|
|
2643
|
+
const hex = [...bytes].map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
2644
|
+
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
2645
|
+
}
|
|
2630
2646
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2631
2647
|
0 && (module.exports = {
|
|
2632
2648
|
BILLING_API_URL,
|
|
@@ -2678,6 +2694,7 @@ function resolveIdempotencyKey(supplied) {
|
|
|
2678
2694
|
TELEMETRY_SDK_PACKAGES,
|
|
2679
2695
|
THEMES,
|
|
2680
2696
|
US_STATES,
|
|
2697
|
+
UUID_V4,
|
|
2681
2698
|
apiError,
|
|
2682
2699
|
authenticationError,
|
|
2683
2700
|
buildCheckoutDisplayData,
|
|
@@ -2709,6 +2726,7 @@ function resolveIdempotencyKey(supplied) {
|
|
|
2709
2726
|
isAVSFieldVisible,
|
|
2710
2727
|
isPostalCodeSupported,
|
|
2711
2728
|
isSetupIntentClientSecret,
|
|
2729
|
+
isUuidV4,
|
|
2712
2730
|
isValidPostalCode,
|
|
2713
2731
|
isValidPublishableKey,
|
|
2714
2732
|
isValidSecretKey,
|
|
@@ -2716,6 +2734,7 @@ function resolveIdempotencyKey(supplied) {
|
|
|
2716
2734
|
networkError,
|
|
2717
2735
|
normalizeGatewayEnvironment,
|
|
2718
2736
|
partitionStripeMethods,
|
|
2737
|
+
randomUuidV4,
|
|
2719
2738
|
rateLimitError,
|
|
2720
2739
|
resolveAVSConfig,
|
|
2721
2740
|
resolveBillingApiUrl,
|