stripe-pwa-elements 4.0.0 → 4.0.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/dist/cjs/factory-tenFFIul.js +1200 -0
- package/dist/cjs/{factory-da3xAKkz.js → i18n-FhEOc8vz.js} +6 -1131
- package/dist/cjs/ion-icon_2.cjs.entry.js +723 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/stripe-address-element.cjs.entry.js +12 -4
- package/dist/cjs/stripe-card-element-modal.cjs.entry.js +3 -2
- package/dist/cjs/{stripe-card-element_2.cjs.entry.js → stripe-card-element.cjs.entry.js} +15 -82
- package/dist/cjs/stripe-currency-selector.cjs.entry.js +11 -3
- package/dist/cjs/stripe-elements.cjs.js +1 -1
- package/dist/cjs/stripe-express-checkout-element.cjs.entry.js +31 -5
- package/dist/cjs/stripe-link-authentication-element.cjs.entry.js +11 -3
- package/dist/cjs/stripe-payment-element.cjs.entry.js +106 -161
- package/dist/cjs/stripe-payment-element.helpers-DukP33RI.js +122 -0
- package/dist/cjs/stripe-payment-request-button.cjs.entry.js +23 -16
- package/dist/cjs/stripe-payment-sheet.cjs.entry.js +506 -0
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/stripe-address-element/stripe-address-element.js +7 -0
- package/dist/collection/components/stripe-card-element/stripe-card-element.js +10 -2
- package/dist/collection/components/stripe-card-element-modal/stripe-card-element-modal.js +4 -3
- package/dist/collection/components/stripe-currency-selector/stripe-currency-selector.js +7 -0
- package/dist/collection/components/stripe-express-checkout-element/stripe-express-checkout-element.js +25 -0
- package/dist/collection/components/stripe-link-authentication-element/stripe-link-authentication-element.js +7 -0
- package/dist/collection/components/stripe-modal/stripe-modal.css +23 -1
- package/dist/collection/components/stripe-modal/stripe-modal.js +147 -6
- package/dist/collection/components/stripe-payment-element/stripe-payment-element.js +94 -37
- package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js +17 -10
- package/dist/collection/components/stripe-payment-sheet/payment-sheet-state.js +179 -0
- package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.css +68 -0
- package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.helpers.js +90 -0
- package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.js +544 -0
- package/dist/collection/services/express-checkout-element-manager.js +36 -2
- package/dist/collection/services/stripe-service.js +37 -5
- package/dist/collection/utils/focus.js +76 -0
- package/dist/collection/utils/i18n.js +6 -0
- package/dist/components/factory.js +1 -1
- package/dist/components/i18n.js +1 -0
- package/dist/components/stripe-address-element.js +1 -1
- package/dist/components/stripe-card-element-modal.js +1 -1
- package/dist/components/stripe-card-element2.js +1 -1
- package/dist/components/stripe-currency-selector.js +1 -1
- package/dist/components/stripe-express-checkout-element.js +1 -1
- package/dist/components/stripe-link-authentication-element.js +1 -1
- package/dist/components/stripe-modal2.js +1 -1
- package/dist/components/stripe-payment-element.helpers.js +1 -0
- package/dist/components/stripe-payment-element.js +1 -1
- package/dist/components/stripe-payment-request-button2.js +1 -1
- package/dist/components/stripe-payment-sheet.d.ts +11 -0
- package/dist/components/stripe-payment-sheet.js +1 -0
- package/dist/esm/factory-Cd6OGTWN.js +1198 -0
- package/dist/esm/{factory-DeqoYLf_.js → i18n-B6JoQetF.js} +7 -1131
- package/dist/esm/ion-icon_2.entry.js +720 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/stripe-address-element.entry.js +9 -1
- package/dist/esm/stripe-card-element-modal.entry.js +3 -2
- package/dist/esm/{stripe-card-element_2.entry.js → stripe-card-element.entry.js} +13 -79
- package/dist/esm/stripe-currency-selector.entry.js +9 -1
- package/dist/esm/stripe-elements.js +1 -1
- package/dist/esm/stripe-express-checkout-element.entry.js +27 -1
- package/dist/esm/stripe-link-authentication-element.entry.js +9 -1
- package/dist/esm/stripe-payment-element.entry.js +98 -153
- package/dist/esm/stripe-payment-element.helpers-CipV87b8.js +117 -0
- package/dist/esm/stripe-payment-request-button.entry.js +18 -11
- package/dist/esm/stripe-payment-sheet.entry.js +504 -0
- package/dist/stripe-elements/{p-38e7b187.entry.js → p-4891edf0.entry.js} +1 -1
- package/dist/stripe-elements/p-5338bc5e.entry.js +1 -0
- package/dist/stripe-elements/p-6a9c8b7a.entry.js +1 -0
- package/dist/stripe-elements/p-7fe4a287.entry.js +1 -0
- package/dist/stripe-elements/p-915b86ed.entry.js +1 -0
- package/dist/stripe-elements/p-B6JoQetF.js +1 -0
- package/dist/stripe-elements/p-C7MQk9FK.js +1 -0
- package/dist/stripe-elements/p-DFAhQS0n.js +1 -0
- package/dist/stripe-elements/p-b06a254f.entry.js +1 -0
- package/dist/stripe-elements/p-b91c4fa7.entry.js +1 -0
- package/dist/stripe-elements/p-ba791c8f.entry.js +1 -0
- package/dist/stripe-elements/p-e7372ca7.entry.js +1 -0
- package/dist/stripe-elements/p-f892e375.entry.js +1 -0
- package/dist/stripe-elements/stripe-elements.esm.js +1 -1
- package/dist/types/components/stripe-address-element/stripe-address-element.d.ts +6 -0
- package/dist/types/components/stripe-card-element/stripe-card-element.d.ts +8 -1
- package/dist/types/components/stripe-card-element-modal/stripe-card-element-modal.d.ts +2 -1
- package/dist/types/components/stripe-currency-selector/stripe-currency-selector.d.ts +6 -0
- package/dist/types/components/stripe-express-checkout-element/stripe-express-checkout-element.d.ts +11 -0
- package/dist/types/components/stripe-link-authentication-element/stripe-link-authentication-element.d.ts +6 -0
- package/dist/types/components/stripe-modal/stripe-modal.d.ts +44 -0
- package/dist/types/components/stripe-payment-element/stripe-payment-element.d.ts +18 -0
- package/dist/types/components/stripe-payment-request-button/stripe-payment-request-button.d.ts +7 -2
- package/dist/types/components/stripe-payment-sheet/payment-sheet-state.d.ts +104 -0
- package/dist/types/components/stripe-payment-sheet/stripe-payment-sheet.d.ts +112 -0
- package/dist/types/components/stripe-payment-sheet/stripe-payment-sheet.helpers.d.ts +95 -0
- package/dist/types/components.d.ts +169 -10
- package/dist/types/index.d.ts +2 -0
- package/dist/types/services/interfaces.d.ts +2 -0
- package/dist/types/services/stripe-service.d.ts +12 -3
- package/dist/types/utils/focus.d.ts +15 -0
- package/package.json +5 -3
- package/readme.md +46 -10
- package/dist/cjs/ion-icon.cjs.entry.js +0 -431
- package/dist/components/utils.js +0 -1
- package/dist/esm/ion-icon.entry.js +0 -429
- package/dist/stripe-elements/p--sA2m1ad.js +0 -1
- package/dist/stripe-elements/p-44495284.entry.js +0 -1
- package/dist/stripe-elements/p-4ba675fa.entry.js +0 -1
- package/dist/stripe-elements/p-5cf62945.entry.js +0 -1
- package/dist/stripe-elements/p-c24ae181.entry.js +0 -1
- package/dist/stripe-elements/p-d9e86451.entry.js +0 -1
- package/dist/stripe-elements/p-f09c86a0.entry.js +0 -1
- package/dist/stripe-elements/p-f64f394d.entry.js +0 -1
- package/dist/stripe-elements/p-f6d2425e.entry.js +0 -1
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["stripe-card-element-modal",[[0,"stripe-card-element-modal",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"intentType":[1,"intent-type"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"showCloseButton":[4,"show-close-button"],"zip":[4],"open":[4],"getStripeCardElementElement":[64],"present":[64],"updateProgress":[64],"destroy":[64],"setPaymentRequestButton":[64]}]]],["stripe-address-element",[[0,"stripe-address-element",{"mode":[1],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"defaultCountry":[1,"default-country"],"allowedCountries":[16],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getValue":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-currency-selector",[[0,"stripe-currency-selector",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"handleCurrencyChange":[1040],"stripeDidLoaded":[1040],"initStripe":[64],"setErrorMessage":[64],"getSelectedCurrency":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-express-checkout-element",[[0,"stripe-express-checkout-element",{"intentType":[1,"intent-type"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"amount":[2],"currency":[1],"buttonHeight":[1,"button-height"],"shouldUseDefaultConfirmAction":[4,"should-use-default-confirm-action"],"stripeDidLoaded":[1040],"progress":[32],"updateProgress":[64],"setErrorMessage":[64],"initStripe":[64],"updateElementOptions":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-link-authentication-element",[[0,"stripe-link-authentication-element",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"defaultEmail":[1,"default-email"],"handleChange":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getEmail":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-payment-element",[[0,"stripe-payment-element",{"intentType":[1,"intent-type"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"intentClientSecret":[1,"intent-client-secret"],"checkoutSessionClientSecret":[1,"checkout-session-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"initStripeWithCheckoutSession":[64],"updateProgress":[64],"setErrorMessage":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}],"intentClientSecret":[{"updateIntentClientSecret":0}],"checkoutSessionClientSecret":[{"updateCheckoutSessionClientSecret":0}]}]]],["
|
|
8
|
+
return bootstrapLazy([["stripe-card-element-modal",[[0,"stripe-card-element-modal",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"intentType":[1,"intent-type"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"showCloseButton":[4,"show-close-button"],"zip":[4],"open":[4],"getStripeCardElementElement":[64],"present":[64],"updateProgress":[64],"destroy":[64],"setPaymentRequestButton":[64]}]]],["stripe-payment-sheet",[[0,"stripe-payment-sheet",{"publishableKey":[1,"publishable-key"],"intentClientSecret":[1,"intent-client-secret"],"stripeAccount":[1,"stripe-account"],"open":[1540],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"applicationName":[1,"application-name"],"options":[16],"sheet":[32],"visible":[32],"errorMessage":[32],"present":[64]},null,{"publishableKey":[{"handleSecretChange":0}],"intentClientSecret":[{"handleSecretChange":0}],"stripeAccount":[{"handleSecretChange":0}],"open":[{"handleOpenChange":0}]}]]],["stripe-address-element",[[0,"stripe-address-element",{"mode":[1],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"defaultCountry":[1,"default-country"],"allowedCountries":[16],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getValue":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-currency-selector",[[0,"stripe-currency-selector",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"handleCurrencyChange":[1040],"stripeDidLoaded":[1040],"initStripe":[64],"setErrorMessage":[64],"getSelectedCurrency":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-express-checkout-element",[[0,"stripe-express-checkout-element",{"intentType":[1,"intent-type"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"amount":[2],"currency":[1],"buttonHeight":[1,"button-height"],"shouldUseDefaultConfirmAction":[4,"should-use-default-confirm-action"],"stripeDidLoaded":[1040],"progress":[32],"updateProgress":[64],"setErrorMessage":[64],"initStripe":[64],"updateElementOptions":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-link-authentication-element",[[0,"stripe-link-authentication-element",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"defaultEmail":[1,"default-email"],"handleChange":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getEmail":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-payment-element",[[0,"stripe-payment-element",{"intentType":[1,"intent-type"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"intentClientSecret":[1,"intent-client-secret"],"checkoutSessionClientSecret":[1,"checkout-session-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"initStripeWithCheckoutSession":[64],"updateProgress":[64],"setErrorMessage":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}],"intentClientSecret":[{"updateIntentClientSecret":0}],"checkoutSessionClientSecret":[{"updateCheckoutSessionClientSecret":0}]}]]],["stripe-payment-request-button",[[260,"stripe-payment-request-button",{"paymentMethodEventHandler":[16],"shippingOptionEventHandler":[16],"shippingAddressEventHandler":[16],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"stripeDidLoaded":[1040],"loadStripeStatus":[32],"stripe":[32],"paymentRequestOption":[32],"isAvailable":[64],"setPaymentMethodEventHandler":[64],"setPaymentRequestShippingOptionEventHandler":[64],"setPaymentRequestShippingAddressEventHandler":[64],"setPaymentRequestOption":[64],"initStripe":[64]}]]],["stripe-card-element",[[0,"stripe-card-element",{"intentType":[1,"intent-type"],"zip":[4],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"showPaymentRequestButton":[4,"show-payment-request-button"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"zipCode":[32],"paymentRequestOption":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"setPaymentRequestOption":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["ion-icon_2",[[257,"stripe-modal",{"showCloseButton":[4,"show-close-button"],"open":[1028],"renderedOpen":[32],"toggleModal":[64],"openModal":[64],"closeModal":[64]},null,{"open":[{"onOpenChange":0}]}],[1,"ion-icon",{"mode":[1025],"color":[1],"ios":[1],"md":[1],"flipRtl":[4,"flip-rtl"],"name":[513],"src":[1],"icon":[8],"size":[1],"lazy":[4],"sanitize":[4],"svgContent":[32],"isVisible":[32]},null,{"name":[{"loadIcon":0}],"src":[{"loadIcon":0}],"icon":[{"loadIcon":0}],"ios":[{"loadIcon":0}],"md":[{"loadIcon":0}]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, a as createEvent, h, g as getElement } from './index-C6bbmyga.js';
|
|
2
|
-
import {
|
|
2
|
+
import { c as checkPlatform, i as i18n } from './i18n-B6JoQetF.js';
|
|
3
|
+
import { s as serviceFactory } from './factory-Cd6OGTWN.js';
|
|
3
4
|
import './index-CBXaOfXU.js';
|
|
4
5
|
|
|
5
6
|
const stripeAddressElementCss = () => `:root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-input-border-shadow:rgba(228, 228, 230, 0.6);--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}.stripe-payment-sheet-wrap{box-sizing:border-box}.stripe-payment-sheet-wrap *:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:"Roboto", sans-serif;box-sizing:border-box}.stripe-payment-sheet-wrap button{cursor:pointer}.stripe-payment-sheet-wrap{display:block;width:100%;background:#fff;padding:32px 16px}.stripe-payment-sheet-wrap #address-element{margin-top:16px}.stripe-payment-sheet-wrap .stripe-heading{font-size:24px;font-weight:bold;color:var(--color-heading-text);margin-bottom:24px}.stripe-payment-sheet-wrap .stripe-section-title{font-size:14px;font-weight:bold;color:var(--color-label);margin-bottom:8px}.stripe-payment-sheet-wrap .payment-info.address{margin-bottom:16px}.stripe-payment-sheet-wrap .stripe-element-errors{margin-top:8px;font-size:14px;color:var(--color-text-error)}.stripe-payment-sheet-wrap .submit-button-wrapper{margin-top:32px}.stripe-payment-sheet-wrap button{display:block;color:var(--color-button-text);background-color:var(--color-primary);width:100%;text-align:center;padding:16px 16px;font-size:18px;border-radius:6px;min-height:42px}.stripe-payment-sheet-wrap button:disabled{color:var(--color-button-text-disabled)}`;
|
|
@@ -189,6 +190,13 @@ const StripeAddressElement = class {
|
|
|
189
190
|
// Dependency Injection via factory
|
|
190
191
|
this.stripeService = serviceFactory.createStripeService();
|
|
191
192
|
this.addressElementManager = serviceFactory.createAddressElementManager(this.stripeService);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Props are not yet populated inside the constructor when the component is registered via
|
|
196
|
+
* the custom-elements build (`dist/components/*`), so initialization that depends on them
|
|
197
|
+
* must run in `componentWillLoad`, where both the lazy and custom-elements builds have them set.
|
|
198
|
+
*/
|
|
199
|
+
componentWillLoad() {
|
|
192
200
|
if (this.publishableKey != null && this.publishableKey !== '') {
|
|
193
201
|
this.initStripe(this.publishableKey, {
|
|
194
202
|
stripeAccount: this.stripeAccount,
|
|
@@ -11,7 +11,8 @@ const StripeCardElementModal = class {
|
|
|
11
11
|
*/
|
|
12
12
|
this.showLabel = false;
|
|
13
13
|
/**
|
|
14
|
-
* The component will
|
|
14
|
+
* The component will confirm the intent for you: `stripe.confirmCardPayment` when `intentType` is `'payment'`,
|
|
15
|
+
* `stripe.confirmCardSetup` when it is `'setup'`.
|
|
15
16
|
* If you want to customize the behavior, should set false.
|
|
16
17
|
* And listen the 'formSubmit' event on the element
|
|
17
18
|
*/
|
|
@@ -99,7 +100,7 @@ const StripeCardElementModal = class {
|
|
|
99
100
|
cardElement.setPaymentRequestOption(options);
|
|
100
101
|
}
|
|
101
102
|
render() {
|
|
102
|
-
return (h("stripe-modal", { key: '
|
|
103
|
+
return (h("stripe-modal", { key: '4904f57b562da9ce4fc348fb376f931cac707540', open: this.open, showCloseButton: this.showCloseButton }, h("stripe-card-element", { key: '8707fa6e32ca82b700f53fc2a257b8af1cc7b45c', showLabel: this.showLabel, publishableKey: this.publishableKey, intentClientSecret: this.intentClientSecret, shouldUseDefaultFormSubmitAction: this.shouldUseDefaultFormSubmitAction, handleSubmit: this.handleSubmit, stripeDidLoaded: this.stripeDidLoaded, intentType: this.intentType, zip: this.zip, buttonLabel: this.buttonLabel, sheetTitle: this.sheetTitle, applicationName: this.applicationName })));
|
|
103
104
|
}
|
|
104
105
|
get el() { return getElement(this); }
|
|
105
106
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, a as createEvent, h, g as getElement
|
|
2
|
-
import {
|
|
1
|
+
import { r as registerInstance, a as createEvent, h, g as getElement } from './index-C6bbmyga.js';
|
|
2
|
+
import { c as checkPlatform, i as i18n } from './i18n-B6JoQetF.js';
|
|
3
|
+
import { s as serviceFactory } from './factory-Cd6OGTWN.js';
|
|
3
4
|
import { S as StripeAPIError } from './error-XRfh5Wrs.js';
|
|
4
5
|
import './index-CBXaOfXU.js';
|
|
5
6
|
|
|
@@ -291,7 +292,8 @@ const StripeCardElement = class {
|
|
|
291
292
|
*/
|
|
292
293
|
this.showLabel = false;
|
|
293
294
|
/**
|
|
294
|
-
* The component will
|
|
295
|
+
* The component will confirm the intent for you: `stripe.confirmCardPayment` when `intentType` is `'payment'`,
|
|
296
|
+
* `stripe.confirmCardSetup` when it is `'setup'`.
|
|
295
297
|
* If you want to customize the behavior, should set false.
|
|
296
298
|
* And listen the 'formSubmit' event on the element
|
|
297
299
|
*/
|
|
@@ -299,6 +301,13 @@ const StripeCardElement = class {
|
|
|
299
301
|
// Dependency Injection via factory
|
|
300
302
|
this.stripeService = serviceFactory.createStripeService();
|
|
301
303
|
this.cardElementManager = serviceFactory.createCardElementManager(this.stripeService);
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Props are not yet populated inside the constructor when the component is registered via
|
|
307
|
+
* the custom-elements build (`dist/components/*`), so initialization that depends on them
|
|
308
|
+
* must run in `componentWillLoad`, where both the lazy and custom-elements builds have them set.
|
|
309
|
+
*/
|
|
310
|
+
componentWillLoad() {
|
|
302
311
|
if (this.publishableKey != null && this.publishableKey !== '') {
|
|
303
312
|
this.initStripe(this.publishableKey, buildInitStripeOptionsFromAccount(this.stripeAccount));
|
|
304
313
|
}
|
|
@@ -428,79 +437,4 @@ const StripeCardElement = class {
|
|
|
428
437
|
};
|
|
429
438
|
StripeCardElement.style = stripeCardElementCss();
|
|
430
439
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
const StripeModal = class {
|
|
434
|
-
constructor(hostRef) {
|
|
435
|
-
registerInstance(this, hostRef);
|
|
436
|
-
this.close = createEvent(this, "close", 7);
|
|
437
|
-
/**
|
|
438
|
-
* If true, the modal display close button
|
|
439
|
-
*/
|
|
440
|
-
this.showCloseButton = true;
|
|
441
|
-
/**
|
|
442
|
-
* Modal state.
|
|
443
|
-
* If true, the modal will open
|
|
444
|
-
*/
|
|
445
|
-
this.open = false;
|
|
446
|
-
/**
|
|
447
|
-
* Effect `this.open`. This is for animation.
|
|
448
|
-
* Ionic Ref: https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/accordion/accordion.tsx#L83
|
|
449
|
-
*/
|
|
450
|
-
this.renderedOpen = false;
|
|
451
|
-
}
|
|
452
|
-
/**
|
|
453
|
-
* Toggle modal state
|
|
454
|
-
*/
|
|
455
|
-
async toggleModal() {
|
|
456
|
-
this.open ? await this.closeModal() : await this.openModal();
|
|
457
|
-
}
|
|
458
|
-
/**
|
|
459
|
-
* Open the modal
|
|
460
|
-
*/
|
|
461
|
-
async openModal() {
|
|
462
|
-
this.open = true;
|
|
463
|
-
this.openModalAnimation();
|
|
464
|
-
}
|
|
465
|
-
/**
|
|
466
|
-
* Close the modal
|
|
467
|
-
*/
|
|
468
|
-
async closeModal() {
|
|
469
|
-
this.open = false;
|
|
470
|
-
this.renderedOpen = false;
|
|
471
|
-
this.close.emit();
|
|
472
|
-
}
|
|
473
|
-
componentDidLoad() {
|
|
474
|
-
const platformName = checkPlatform();
|
|
475
|
-
if (platformName) {
|
|
476
|
-
this.el.classList.add(platformName);
|
|
477
|
-
}
|
|
478
|
-
if (this.open) {
|
|
479
|
-
this.openModalAnimation();
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
openModalAnimation() {
|
|
483
|
-
if (!this.el.shadowRoot) {
|
|
484
|
-
this.renderedOpen = true;
|
|
485
|
-
return;
|
|
486
|
-
}
|
|
487
|
-
const modalChild = this.el.shadowRoot.querySelector('.modal-child');
|
|
488
|
-
modalChild.classList.add('loading');
|
|
489
|
-
modalChild.style.willChange = 'transform';
|
|
490
|
-
modalChild.addEventListener('transitionend', () => {
|
|
491
|
-
modalChild.style.willChange = 'auto';
|
|
492
|
-
modalChild.classList.remove('loading');
|
|
493
|
-
}, { once: true });
|
|
494
|
-
requestAnimationFrame(() => {
|
|
495
|
-
this.renderedOpen = true;
|
|
496
|
-
});
|
|
497
|
-
}
|
|
498
|
-
render() {
|
|
499
|
-
const { renderedOpen, showCloseButton } = this;
|
|
500
|
-
return (h(Host, { key: 'dee14229db3c17744ae5013e5f9aab813a77880b' }, h("div", { key: 'c82f4f18286a3d341932bacf09973da80ee2acdd', class: `modal-row${renderedOpen ? ' open' : ''}`, onClick: () => this.closeModal() }, h("div", { key: '20b5dc2db1509486e74ff2f6049f5c27de4d4793', class: "modal-child", onClick: e => e.stopPropagation() }, showCloseButton ? (h("div", { class: "modal-close-button-wrap" }, h("ion-icon", { name: "close", size: "large", class: "modal-close-button", onClick: () => this.closeModal() }))) : null, h("div", { key: '863c6285045ad9dcbfeb286ee8ffa8aa1581f90e', class: "modal-loading" }, h("svg", { key: 'ba5d9e80236600f4b64a7fa735d49241eb1c3f29', version: "1.1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 2400 2400" }, h("g", { key: '290f7a2e79dc54f36603fa4a6b7d3922e4d1f432', "stroke-width": "200", "stroke-linecap": "round", stroke: "currentColor", fill: "none", id: "spinner" }, h("line", { key: '92cafdfad5a2631046bdd5f1fb6431b623808961', x1: "1200", y1: "600", x2: "1200", y2: "100" }), h("line", { key: '8b6e7260dcc41f969c7bac0fec073928e8e146a7', opacity: "0.5", x1: "1200", y1: "2300", x2: "1200", y2: "1800" }), h("line", { key: 'a5eb02131aa60cd6126a2be5f874e8f3bf3b6d5f', opacity: "0.917", x1: "900", y1: "680.4", x2: "650", y2: "247.4" }), h("line", { key: '1052903918a67fc53c0df06af43ad564fc9180f7', opacity: "0.417", x1: "1750", y1: "2152.6", x2: "1500", y2: "1719.6" }), h("line", { key: 'ac37ac0104a2738375b8f71481b826ae63730dce', opacity: "0.833", x1: "680.4", y1: "900", x2: "247.4", y2: "650" }), h("line", { key: '0623f6448f636a6f5f65cb68387ab81381a56acf', opacity: "0.333", x1: "2152.6", y1: "1750", x2: "1719.6", y2: "1500" }), h("line", { key: 'f3dbc37979ad51676728ac79eccab6d7be4d9192', opacity: "0.75", x1: "600", y1: "1200", x2: "100", y2: "1200" }), h("line", { key: 'c5d92ff42dbe24d6c2136b24cdf2d57835f11b76', opacity: "0.25", x1: "2300", y1: "1200", x2: "1800", y2: "1200" }), h("line", { key: '3339f4fefcc7222050da34aa7b8b60c9ac511aea', opacity: "0.667", x1: "680.4", y1: "1500", x2: "247.4", y2: "1750" }), h("line", { key: '7ddc8d68d7f7deb0fe377b508180bc0b1123bf7f', opacity: "0.167", x1: "2152.6", y1: "650", x2: "1719.6", y2: "900" }), h("line", { key: '8825e19d81b7ade6d1ee327ac7b8bc24607a7c47', opacity: "0.583", x1: "900", y1: "1719.6", x2: "650", y2: "2152.6" }), h("line", { key: '9562d8c1dcc59a4884cff618edc35e951b19794c', opacity: "0.083", x1: "1750", y1: "247.4", x2: "1500", y2: "680.4" }), h("animateTransform", { key: '648f2a04edef2c2908782aa2296e4dba2b27d7b1', attributeName: "transform", attributeType: "XML", type: "rotate", keyTimes: "0;0.08333;0.16667;0.25;0.33333;0.41667;0.5;0.58333;0.66667;0.75;0.83333;0.91667", values: "0 1199 1199;30 1199 1199;60 1199 1199;90 1199 1199;120 1199 1199;150 1199 1199;180 1199 1199;210 1199 1199;240 1199 1199;270 1199 1199;300 1199 1199;330 1199 1199", dur: "0.83333s", begin: "0s", repeatCount: "indefinite", calcMode: "discrete" })))), h("div", { key: 'a86fb232eb5df0737c870e0e788c0c1e230b434e', class: "modal-content" }, h("slot", { key: 'b5ee41fc9dd113c3e2716f01350641fc2adebd7b' }))))));
|
|
501
|
-
}
|
|
502
|
-
get el() { return getElement(this); }
|
|
503
|
-
};
|
|
504
|
-
StripeModal.style = stripeModalCss();
|
|
505
|
-
|
|
506
|
-
export { StripeCardElement as stripe_card_element, StripeModal as stripe_modal };
|
|
440
|
+
export { StripeCardElement as stripe_card_element };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, a as createEvent, h, g as getElement } from './index-C6bbmyga.js';
|
|
2
|
-
import {
|
|
2
|
+
import { c as checkPlatform, i as i18n } from './i18n-B6JoQetF.js';
|
|
3
|
+
import { s as serviceFactory } from './factory-Cd6OGTWN.js';
|
|
3
4
|
import './index-CBXaOfXU.js';
|
|
4
5
|
|
|
5
6
|
const stripeCurrencySelectorCss = () => `:root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-input-border-shadow:rgba(228, 228, 230, 0.6);--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}:host{box-sizing:border-box}:host *:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:"Roboto", sans-serif;box-sizing:border-box}:host button{cursor:pointer}:host{display:block;width:100%}.stripe-currency-selector-wrap{width:100%;padding:0;margin:0}.stripe-currency-selector-wrap #currency-selector{width:100%;min-height:40px}.stripe-currency-selector-wrap #currency-selector-errors{margin-top:8px}`;
|
|
@@ -127,6 +128,13 @@ const StripeCurrencySelector = class {
|
|
|
127
128
|
// Dependency Injection via factory
|
|
128
129
|
this.stripeService = serviceFactory.createStripeService();
|
|
129
130
|
this.currencySelectorElementManager = serviceFactory.createCurrencySelectorElementManager(this.stripeService);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Props are not yet populated inside the constructor when the component is registered via
|
|
134
|
+
* the custom-elements build (`dist/components/*`), so initialization that depends on them
|
|
135
|
+
* must run in `componentWillLoad`, where both the lazy and custom-elements builds have them set.
|
|
136
|
+
*/
|
|
137
|
+
componentWillLoad() {
|
|
130
138
|
if (this.publishableKey) {
|
|
131
139
|
this.initStripe(this.publishableKey, {
|
|
132
140
|
stripeAccount: this.stripeAccount,
|
|
@@ -44,5 +44,5 @@ var patchCloneNodeFix = (HTMLElementPrototype) => {
|
|
|
44
44
|
|
|
45
45
|
patchBrowser().then(async (options) => {
|
|
46
46
|
await globalScripts();
|
|
47
|
-
return bootstrapLazy([["stripe-card-element-modal",[[0,"stripe-card-element-modal",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"intentType":[1,"intent-type"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"showCloseButton":[4,"show-close-button"],"zip":[4],"open":[4],"getStripeCardElementElement":[64],"present":[64],"updateProgress":[64],"destroy":[64],"setPaymentRequestButton":[64]}]]],["stripe-address-element",[[0,"stripe-address-element",{"mode":[1],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"defaultCountry":[1,"default-country"],"allowedCountries":[16],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getValue":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-currency-selector",[[0,"stripe-currency-selector",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"handleCurrencyChange":[1040],"stripeDidLoaded":[1040],"initStripe":[64],"setErrorMessage":[64],"getSelectedCurrency":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-express-checkout-element",[[0,"stripe-express-checkout-element",{"intentType":[1,"intent-type"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"amount":[2],"currency":[1],"buttonHeight":[1,"button-height"],"shouldUseDefaultConfirmAction":[4,"should-use-default-confirm-action"],"stripeDidLoaded":[1040],"progress":[32],"updateProgress":[64],"setErrorMessage":[64],"initStripe":[64],"updateElementOptions":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-link-authentication-element",[[0,"stripe-link-authentication-element",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"defaultEmail":[1,"default-email"],"handleChange":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getEmail":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-payment-element",[[0,"stripe-payment-element",{"intentType":[1,"intent-type"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"intentClientSecret":[1,"intent-client-secret"],"checkoutSessionClientSecret":[1,"checkout-session-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"initStripeWithCheckoutSession":[64],"updateProgress":[64],"setErrorMessage":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}],"intentClientSecret":[{"updateIntentClientSecret":0}],"checkoutSessionClientSecret":[{"updateCheckoutSessionClientSecret":0}]}]]],["
|
|
47
|
+
return bootstrapLazy([["stripe-card-element-modal",[[0,"stripe-card-element-modal",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"intentType":[1,"intent-type"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"showCloseButton":[4,"show-close-button"],"zip":[4],"open":[4],"getStripeCardElementElement":[64],"present":[64],"updateProgress":[64],"destroy":[64],"setPaymentRequestButton":[64]}]]],["stripe-payment-sheet",[[0,"stripe-payment-sheet",{"publishableKey":[1,"publishable-key"],"intentClientSecret":[1,"intent-client-secret"],"stripeAccount":[1,"stripe-account"],"open":[1540],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"applicationName":[1,"application-name"],"options":[16],"sheet":[32],"visible":[32],"errorMessage":[32],"present":[64]},null,{"publishableKey":[{"handleSecretChange":0}],"intentClientSecret":[{"handleSecretChange":0}],"stripeAccount":[{"handleSecretChange":0}],"open":[{"handleOpenChange":0}]}]]],["stripe-address-element",[[0,"stripe-address-element",{"mode":[1],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"defaultCountry":[1,"default-country"],"allowedCountries":[16],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getValue":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-currency-selector",[[0,"stripe-currency-selector",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"handleCurrencyChange":[1040],"stripeDidLoaded":[1040],"initStripe":[64],"setErrorMessage":[64],"getSelectedCurrency":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-express-checkout-element",[[0,"stripe-express-checkout-element",{"intentType":[1,"intent-type"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"amount":[2],"currency":[1],"buttonHeight":[1,"button-height"],"shouldUseDefaultConfirmAction":[4,"should-use-default-confirm-action"],"stripeDidLoaded":[1040],"progress":[32],"updateProgress":[64],"setErrorMessage":[64],"initStripe":[64],"updateElementOptions":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-link-authentication-element",[[0,"stripe-link-authentication-element",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"defaultEmail":[1,"default-email"],"handleChange":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getEmail":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-payment-element",[[0,"stripe-payment-element",{"intentType":[1,"intent-type"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"intentClientSecret":[1,"intent-client-secret"],"checkoutSessionClientSecret":[1,"checkout-session-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"initStripeWithCheckoutSession":[64],"updateProgress":[64],"setErrorMessage":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}],"intentClientSecret":[{"updateIntentClientSecret":0}],"checkoutSessionClientSecret":[{"updateCheckoutSessionClientSecret":0}]}]]],["stripe-payment-request-button",[[260,"stripe-payment-request-button",{"paymentMethodEventHandler":[16],"shippingOptionEventHandler":[16],"shippingAddressEventHandler":[16],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"stripeDidLoaded":[1040],"loadStripeStatus":[32],"stripe":[32],"paymentRequestOption":[32],"isAvailable":[64],"setPaymentMethodEventHandler":[64],"setPaymentRequestShippingOptionEventHandler":[64],"setPaymentRequestShippingAddressEventHandler":[64],"setPaymentRequestOption":[64],"initStripe":[64]}]]],["stripe-card-element",[[0,"stripe-card-element",{"intentType":[1,"intent-type"],"zip":[4],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"showPaymentRequestButton":[4,"show-payment-request-button"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"zipCode":[32],"paymentRequestOption":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"setPaymentRequestOption":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["ion-icon_2",[[257,"stripe-modal",{"showCloseButton":[4,"show-close-button"],"open":[1028],"renderedOpen":[32],"toggleModal":[64],"openModal":[64],"closeModal":[64]},null,{"open":[{"onOpenChange":0}]}],[1,"ion-icon",{"mode":[1025],"color":[1],"ios":[1],"md":[1],"flipRtl":[4,"flip-rtl"],"name":[513],"src":[1],"icon":[8],"size":[1],"lazy":[4],"sanitize":[4],"svgContent":[32],"isVisible":[32]},null,{"name":[{"loadIcon":0}],"src":[{"loadIcon":0}],"icon":[{"loadIcon":0}],"ios":[{"loadIcon":0}],"md":[{"loadIcon":0}]}]]]], options);
|
|
48
48
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, a as createEvent, h, g as getElement } from './index-C6bbmyga.js';
|
|
2
|
-
import {
|
|
2
|
+
import { c as checkPlatform, i as i18n } from './i18n-B6JoQetF.js';
|
|
3
|
+
import { s as serviceFactory } from './factory-Cd6OGTWN.js';
|
|
3
4
|
import { S as StripeAPIError } from './error-XRfh5Wrs.js';
|
|
4
5
|
import './index-CBXaOfXU.js';
|
|
5
6
|
|
|
@@ -71,6 +72,8 @@ const StripeExpressCheckoutElement = class {
|
|
|
71
72
|
await this.stripeService.initialize(publishableKey, {
|
|
72
73
|
stripeAccount: options === null || options === void 0 ? void 0 : options.stripeAccount,
|
|
73
74
|
applicationName: this.applicationName,
|
|
75
|
+
clientSecret: this.clientSecret,
|
|
76
|
+
elementsOptions: this.buildElementsOptions(),
|
|
74
77
|
});
|
|
75
78
|
// If already successfully loaded, initialize elements immediately
|
|
76
79
|
if (this.stripeService.state.loadStripeStatus === 'success') {
|
|
@@ -89,6 +92,22 @@ const StripeExpressCheckoutElement = class {
|
|
|
89
92
|
});
|
|
90
93
|
}
|
|
91
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Options for `stripe.elements()` when there is no client secret.
|
|
97
|
+
* Stripe.js reads mode / amount / currency from the Elements group, not from the element itself.
|
|
98
|
+
*/
|
|
99
|
+
buildElementsOptions() {
|
|
100
|
+
if (this.currency == null || this.currency === '') {
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
if (this.intentType === 'setup') {
|
|
104
|
+
return { mode: 'setup', currency: this.currency };
|
|
105
|
+
}
|
|
106
|
+
if (this.amount === undefined) {
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
return { mode: 'payment', amount: this.amount, currency: this.currency };
|
|
110
|
+
}
|
|
92
111
|
/**
|
|
93
112
|
* Update element options dynamically
|
|
94
113
|
* @param options - Partial options to update
|
|
@@ -149,6 +168,13 @@ const StripeExpressCheckoutElement = class {
|
|
|
149
168
|
// Dependency Injection via factory
|
|
150
169
|
this.stripeService = serviceFactory.createStripeService();
|
|
151
170
|
this.expressCheckoutManager = serviceFactory.createExpressCheckoutElementManager(this.stripeService);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Props are not yet populated inside the constructor when the component is registered via
|
|
174
|
+
* the custom-elements build (`dist/components/*`), so initialization that depends on them
|
|
175
|
+
* must run in `componentWillLoad`, where both the lazy and custom-elements builds have them set.
|
|
176
|
+
*/
|
|
177
|
+
componentWillLoad() {
|
|
152
178
|
if (this.publishableKey != null && this.publishableKey !== '') {
|
|
153
179
|
this.initStripe(this.publishableKey, {
|
|
154
180
|
stripeAccount: this.stripeAccount,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, a as createEvent, h, g as getElement } from './index-C6bbmyga.js';
|
|
2
|
-
import {
|
|
2
|
+
import { c as checkPlatform, i as i18n } from './i18n-B6JoQetF.js';
|
|
3
|
+
import { s as serviceFactory } from './factory-Cd6OGTWN.js';
|
|
3
4
|
import './index-CBXaOfXU.js';
|
|
4
5
|
|
|
5
6
|
const stripeLinkAuthenticationElementCss = () => `:root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-input-border-shadow:rgba(228, 228, 230, 0.6);--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}.stripe-link-authentication-wrap{box-sizing:border-box}.stripe-link-authentication-wrap *:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:"Roboto", sans-serif;box-sizing:border-box}.stripe-link-authentication-wrap button{cursor:pointer}.stripe-link-authentication-wrap{display:block;width:100%;background:#fff;padding:16px}.stripe-link-authentication-wrap .stripe-link-authentication-container #link-authentication-element .StripeElement{padding:8px 16px;min-height:64px;border-radius:6px;display:flex;justify-content:center;align-items:center}.stripe-link-authentication-wrap .stripe-link-authentication-container #link-authentication-element .StripeElement>.__PrivateStripeElement{width:100%}.stripe-link-authentication-wrap .stripe-link-authentication-container .stripe-element-errors{margin-top:8px;font-size:14px;color:var(--color-text-error)}`;
|
|
@@ -168,6 +169,13 @@ const StripeLinkAuthenticationElement = class {
|
|
|
168
169
|
// Dependency Injection via factory
|
|
169
170
|
this.stripeService = serviceFactory.createStripeService();
|
|
170
171
|
this.linkAuthenticationElementManager = serviceFactory.createLinkAuthenticationElementManager(this.stripeService);
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Props are not yet populated inside the constructor when the component is registered via
|
|
175
|
+
* the custom-elements build (`dist/components/*`), so initialization that depends on them
|
|
176
|
+
* must run in `componentWillLoad`, where both the lazy and custom-elements builds have them set.
|
|
177
|
+
*/
|
|
178
|
+
componentWillLoad() {
|
|
171
179
|
if (this.publishableKey) {
|
|
172
180
|
this.initStripe(this.publishableKey, {
|
|
173
181
|
stripeAccount: this.stripeAccount,
|