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/cjs/loader.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
|
6
6
|
const defineCustomElements = async (win, options) => {
|
|
7
7
|
if (typeof window === 'undefined') return undefined;
|
|
8
8
|
await appGlobals.globalScripts();
|
|
9
|
-
return index.bootstrapLazy([["stripe-card-element-modal.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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}]}]]],["
|
|
9
|
+
return index.bootstrapLazy([["stripe-card-element-modal.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-Dkb0SxZc.js');
|
|
4
|
-
var
|
|
4
|
+
var i18n = require('./i18n-FhEOc8vz.js');
|
|
5
|
+
var factory = require('./factory-tenFFIul.js');
|
|
5
6
|
require('./index-CYbA1N_k.js');
|
|
6
7
|
|
|
7
8
|
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)}`;
|
|
@@ -191,6 +192,13 @@ const StripeAddressElement = class {
|
|
|
191
192
|
// Dependency Injection via factory
|
|
192
193
|
this.stripeService = factory.serviceFactory.createStripeService();
|
|
193
194
|
this.addressElementManager = factory.serviceFactory.createAddressElementManager(this.stripeService);
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Props are not yet populated inside the constructor when the component is registered via
|
|
198
|
+
* the custom-elements build (`dist/components/*`), so initialization that depends on them
|
|
199
|
+
* must run in `componentWillLoad`, where both the lazy and custom-elements builds have them set.
|
|
200
|
+
*/
|
|
201
|
+
componentWillLoad() {
|
|
194
202
|
if (this.publishableKey != null && this.publishableKey !== '') {
|
|
195
203
|
this.initStripe(this.publishableKey, {
|
|
196
204
|
stripeAccount: this.stripeAccount,
|
|
@@ -255,7 +263,7 @@ const StripeAddressElement = class {
|
|
|
255
263
|
formElement.addEventListener('submit', this.formSubmitListener);
|
|
256
264
|
}
|
|
257
265
|
componentDidLoad() {
|
|
258
|
-
this.el.classList.add(
|
|
266
|
+
this.el.classList.add(i18n.checkPlatform());
|
|
259
267
|
}
|
|
260
268
|
disconnectedCallback() {
|
|
261
269
|
// Remove form submit listener
|
|
@@ -272,14 +280,14 @@ const StripeAddressElement = class {
|
|
|
272
280
|
const { loadStripeStatus } = this.stripeService.state;
|
|
273
281
|
const { errorMessage } = this.addressElementManager.getState();
|
|
274
282
|
if (loadStripeStatus === 'failure') {
|
|
275
|
-
return index.h("p", null,
|
|
283
|
+
return index.h("p", null, i18n.i18n.t('Failed to load Stripe'));
|
|
276
284
|
}
|
|
277
285
|
const disabled = this.progress === 'loading';
|
|
278
286
|
// NOTE: `stripe-payment-sheet-wrap` below is a legacy CSS class kept for backward
|
|
279
287
|
// compatibility (leftover from a former component name). It is part of the public
|
|
280
288
|
// DOM contract — consumers may target it in their own stylesheets — so it must
|
|
281
289
|
// remain in the rendered output. Do not remove it.
|
|
282
|
-
return (index.h("div", { class: "stripe-payment-sheet-wrap" }, index.h("form", { id: "stripe-address-element-form" }, index.h("div", { class: "stripe-heading" },
|
|
290
|
+
return (index.h("div", { class: "stripe-payment-sheet-wrap" }, index.h("form", { id: "stripe-address-element-form" }, index.h("div", { class: "stripe-heading" }, i18n.i18n.t(this.sheetTitle)), index.h("div", { class: "payment-info address visible" }, index.h("div", { id: "address-element" })), index.h("div", { id: "address-errors", class: "stripe-element-errors" }, errorMessage), index.h("div", { class: "submit-button-wrapper" }, index.h("button", { type: "submit", disabled: disabled }, this.progress === 'loading' ? i18n.i18n.t('Loading') : i18n.i18n.t(this.buttonLabel))))));
|
|
283
291
|
}
|
|
284
292
|
get el() { return index.getElement(this); }
|
|
285
293
|
static get watchers() { return {
|
|
@@ -13,7 +13,8 @@ const StripeCardElementModal = class {
|
|
|
13
13
|
*/
|
|
14
14
|
this.showLabel = false;
|
|
15
15
|
/**
|
|
16
|
-
* The component will
|
|
16
|
+
* The component will confirm the intent for you: `stripe.confirmCardPayment` when `intentType` is `'payment'`,
|
|
17
|
+
* `stripe.confirmCardSetup` when it is `'setup'`.
|
|
17
18
|
* If you want to customize the behavior, should set false.
|
|
18
19
|
* And listen the 'formSubmit' event on the element
|
|
19
20
|
*/
|
|
@@ -101,7 +102,7 @@ const StripeCardElementModal = class {
|
|
|
101
102
|
cardElement.setPaymentRequestOption(options);
|
|
102
103
|
}
|
|
103
104
|
render() {
|
|
104
|
-
return (index.h("stripe-modal", { key: '
|
|
105
|
+
return (index.h("stripe-modal", { key: '4904f57b562da9ce4fc348fb376f931cac707540', open: this.open, showCloseButton: this.showCloseButton }, index.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 })));
|
|
105
106
|
}
|
|
106
107
|
get el() { return index.getElement(this); }
|
|
107
108
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-Dkb0SxZc.js');
|
|
4
|
-
var
|
|
4
|
+
var i18n = require('./i18n-FhEOc8vz.js');
|
|
5
|
+
var factory = require('./factory-tenFFIul.js');
|
|
5
6
|
var error = require('./error-FFC4kSs5.js');
|
|
6
7
|
require('./index-CYbA1N_k.js');
|
|
7
8
|
|
|
@@ -293,7 +294,8 @@ const StripeCardElement = class {
|
|
|
293
294
|
*/
|
|
294
295
|
this.showLabel = false;
|
|
295
296
|
/**
|
|
296
|
-
* The component will
|
|
297
|
+
* The component will confirm the intent for you: `stripe.confirmCardPayment` when `intentType` is `'payment'`,
|
|
298
|
+
* `stripe.confirmCardSetup` when it is `'setup'`.
|
|
297
299
|
* If you want to customize the behavior, should set false.
|
|
298
300
|
* And listen the 'formSubmit' event on the element
|
|
299
301
|
*/
|
|
@@ -301,6 +303,13 @@ const StripeCardElement = class {
|
|
|
301
303
|
// Dependency Injection via factory
|
|
302
304
|
this.stripeService = factory.serviceFactory.createStripeService();
|
|
303
305
|
this.cardElementManager = factory.serviceFactory.createCardElementManager(this.stripeService);
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Props are not yet populated inside the constructor when the component is registered via
|
|
309
|
+
* the custom-elements build (`dist/components/*`), so initialization that depends on them
|
|
310
|
+
* must run in `componentWillLoad`, where both the lazy and custom-elements builds have them set.
|
|
311
|
+
*/
|
|
312
|
+
componentWillLoad() {
|
|
304
313
|
if (this.publishableKey != null && this.publishableKey !== '') {
|
|
305
314
|
this.initStripe(this.publishableKey, buildInitStripeOptionsFromAccount(this.stripeAccount));
|
|
306
315
|
}
|
|
@@ -356,7 +365,7 @@ const StripeCardElement = class {
|
|
|
356
365
|
});
|
|
357
366
|
}
|
|
358
367
|
componentDidLoad() {
|
|
359
|
-
this.el.classList.add(
|
|
368
|
+
this.el.classList.add(i18n.checkPlatform());
|
|
360
369
|
}
|
|
361
370
|
componentDidRender() {
|
|
362
371
|
// Safely create payment request button after DOM is ready
|
|
@@ -407,16 +416,16 @@ const StripeCardElement = class {
|
|
|
407
416
|
const { loadStripeStatus } = this.stripeService.state;
|
|
408
417
|
const { errorMessage } = this.cardElementManager.getState();
|
|
409
418
|
if (loadStripeStatus === 'failure') {
|
|
410
|
-
return index.h("p", null,
|
|
419
|
+
return index.h("p", null, i18n.i18n.t('Failed to load Stripe'));
|
|
411
420
|
}
|
|
412
421
|
const disabled = this.progress === 'loading';
|
|
413
422
|
return (
|
|
414
423
|
// NOTE: `stripe-payment-sheet-wrap` is a legacy class name (leftover from a former
|
|
415
424
|
// component name). External consumers may target it in their own CSS, so it is a
|
|
416
425
|
// public DOM contract that MUST be kept for backward compatibility. Do not remove it.
|
|
417
|
-
index.h("div", { class: "stripe-payment-sheet-wrap" }, index.h("form", { id: "stripe-card-element" }, index.h("div", { class: "stripe-heading" },
|
|
426
|
+
index.h("div", { class: "stripe-payment-sheet-wrap" }, index.h("form", { id: "stripe-card-element" }, index.h("div", { class: "stripe-heading" }, i18n.i18n.t(this.sheetTitle)), index.h("div", { id: "stripe-payment-request-button" }), index.h("div", null, index.h("div", { class: "stripe-section-title" }, i18n.i18n.t('Card information'))), index.h("div", { class: "payment-info card visible" }, index.h("fieldset", { class: "stripe-input-box" }, index.h("div", null, index.h("label", null, this.showLabel ? index.h("lenged", null, i18n.i18n.t('Card Number')) : null, index.h("div", { id: "card-number" }))), index.h("div", { class: "stripe-input-column", style: { display: 'flex' } }, index.h("label", { style: { width: '50%' } }, this.showLabel ? index.h("lenged", null, i18n.i18n.t('MM / YY')) : null, index.h("div", { id: "card-expiry" })), index.h("label", { style: { width: '50%' } }, this.showLabel ? index.h("lenged", null, i18n.i18n.t('CVC')) : null, index.h("div", { id: "card-cvc" }))))), index.h("div", { id: "card-errors", class: "stripe-element-errors" }, errorMessage), this.zip ? (index.h("div", { style: { marginTop: '1.5rem' } }, index.h("div", { class: "stripe-section-title" }, i18n.i18n.t('Country or region')))) : null, this.zip ? (index.h("div", { class: "payment-info card visible" }, index.h("fieldset", { class: "stripe-input-box" }, index.h("div", null, index.h("label", null, this.showLabel ? index.h("lenged", null, i18n.i18n.t('Postal Code')) : null, index.h("input", { id: "zip", name: "zip", type: "text", inputmode: "numeric", class: "StripeElement", style: { width: '100%' }, placeholder: i18n.i18n.t('Postal Code'), value: this.zipCode, onInput: e => {
|
|
418
427
|
this.zipCode = e.target.value;
|
|
419
|
-
} })))))) : null, index.h("div", { style: { marginTop: '32px' } }, index.h("button", { type: "submit", disabled: disabled }, this.progress === 'loading' ?
|
|
428
|
+
} })))))) : null, index.h("div", { style: { marginTop: '32px' } }, index.h("button", { type: "submit", disabled: disabled }, this.progress === 'loading' ? i18n.i18n.t('Loading') : i18n.i18n.t(this.buttonLabel))))));
|
|
420
429
|
}
|
|
421
430
|
get el() { return index.getElement(this); }
|
|
422
431
|
static get watchers() { return {
|
|
@@ -430,80 +439,4 @@ const StripeCardElement = class {
|
|
|
430
439
|
};
|
|
431
440
|
StripeCardElement.style = stripeCardElementCss();
|
|
432
441
|
|
|
433
|
-
const stripeModalCss = () => `: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}.modal-row{opacity:0;pointer-events:none;will-change:transform}.modal-row.open{opacity:1;pointer-events:auto;position:fixed;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:1ch;background:rgba(0, 0, 0, 0.3)}.modal-row .modal-child{transform:translateY(100%);transition:transform 420ms ease;position:relative}.modal-row .modal-child .modal-loading{display:none;position:absolute;top:160px;left:50%;transform:translateX(-50%);width:24px;height:24px}.modal-row .modal-child.loading .modal-loading{display:flex;justify-content:center;align-items:center}.modal-row .modal-child.loading .modal-loading svg{width:24px;height:24px}.modal-row .modal-child.loading .modal-content{visibility:hidden}.modal-row.open .modal-child{transform:translateY(0%)}.modal-child{padding:16px 8px 24px;background-color:#fff;width:100%}.modal-close-button-wrap{padding-left:8px}.modal-close-button-wrap .modal-close-button{width:32px;display:block;fill:var(--color-label);cursor:pointer}`;
|
|
434
|
-
|
|
435
|
-
const StripeModal = class {
|
|
436
|
-
constructor(hostRef) {
|
|
437
|
-
index.registerInstance(this, hostRef);
|
|
438
|
-
this.close = index.createEvent(this, "close", 7);
|
|
439
|
-
/**
|
|
440
|
-
* If true, the modal display close button
|
|
441
|
-
*/
|
|
442
|
-
this.showCloseButton = true;
|
|
443
|
-
/**
|
|
444
|
-
* Modal state.
|
|
445
|
-
* If true, the modal will open
|
|
446
|
-
*/
|
|
447
|
-
this.open = false;
|
|
448
|
-
/**
|
|
449
|
-
* Effect `this.open`. This is for animation.
|
|
450
|
-
* Ionic Ref: https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/accordion/accordion.tsx#L83
|
|
451
|
-
*/
|
|
452
|
-
this.renderedOpen = false;
|
|
453
|
-
}
|
|
454
|
-
/**
|
|
455
|
-
* Toggle modal state
|
|
456
|
-
*/
|
|
457
|
-
async toggleModal() {
|
|
458
|
-
this.open ? await this.closeModal() : await this.openModal();
|
|
459
|
-
}
|
|
460
|
-
/**
|
|
461
|
-
* Open the modal
|
|
462
|
-
*/
|
|
463
|
-
async openModal() {
|
|
464
|
-
this.open = true;
|
|
465
|
-
this.openModalAnimation();
|
|
466
|
-
}
|
|
467
|
-
/**
|
|
468
|
-
* Close the modal
|
|
469
|
-
*/
|
|
470
|
-
async closeModal() {
|
|
471
|
-
this.open = false;
|
|
472
|
-
this.renderedOpen = false;
|
|
473
|
-
this.close.emit();
|
|
474
|
-
}
|
|
475
|
-
componentDidLoad() {
|
|
476
|
-
const platformName = factory.checkPlatform();
|
|
477
|
-
if (platformName) {
|
|
478
|
-
this.el.classList.add(platformName);
|
|
479
|
-
}
|
|
480
|
-
if (this.open) {
|
|
481
|
-
this.openModalAnimation();
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
openModalAnimation() {
|
|
485
|
-
if (!this.el.shadowRoot) {
|
|
486
|
-
this.renderedOpen = true;
|
|
487
|
-
return;
|
|
488
|
-
}
|
|
489
|
-
const modalChild = this.el.shadowRoot.querySelector('.modal-child');
|
|
490
|
-
modalChild.classList.add('loading');
|
|
491
|
-
modalChild.style.willChange = 'transform';
|
|
492
|
-
modalChild.addEventListener('transitionend', () => {
|
|
493
|
-
modalChild.style.willChange = 'auto';
|
|
494
|
-
modalChild.classList.remove('loading');
|
|
495
|
-
}, { once: true });
|
|
496
|
-
requestAnimationFrame(() => {
|
|
497
|
-
this.renderedOpen = true;
|
|
498
|
-
});
|
|
499
|
-
}
|
|
500
|
-
render() {
|
|
501
|
-
const { renderedOpen, showCloseButton } = this;
|
|
502
|
-
return (index.h(index.Host, { key: 'dee14229db3c17744ae5013e5f9aab813a77880b' }, index.h("div", { key: 'c82f4f18286a3d341932bacf09973da80ee2acdd', class: `modal-row${renderedOpen ? ' open' : ''}`, onClick: () => this.closeModal() }, index.h("div", { key: '20b5dc2db1509486e74ff2f6049f5c27de4d4793', class: "modal-child", onClick: e => e.stopPropagation() }, showCloseButton ? (index.h("div", { class: "modal-close-button-wrap" }, index.h("ion-icon", { name: "close", size: "large", class: "modal-close-button", onClick: () => this.closeModal() }))) : null, index.h("div", { key: '863c6285045ad9dcbfeb286ee8ffa8aa1581f90e', class: "modal-loading" }, index.h("svg", { key: 'ba5d9e80236600f4b64a7fa735d49241eb1c3f29', version: "1.1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 2400 2400" }, index.h("g", { key: '290f7a2e79dc54f36603fa4a6b7d3922e4d1f432', "stroke-width": "200", "stroke-linecap": "round", stroke: "currentColor", fill: "none", id: "spinner" }, index.h("line", { key: '92cafdfad5a2631046bdd5f1fb6431b623808961', x1: "1200", y1: "600", x2: "1200", y2: "100" }), index.h("line", { key: '8b6e7260dcc41f969c7bac0fec073928e8e146a7', opacity: "0.5", x1: "1200", y1: "2300", x2: "1200", y2: "1800" }), index.h("line", { key: 'a5eb02131aa60cd6126a2be5f874e8f3bf3b6d5f', opacity: "0.917", x1: "900", y1: "680.4", x2: "650", y2: "247.4" }), index.h("line", { key: '1052903918a67fc53c0df06af43ad564fc9180f7', opacity: "0.417", x1: "1750", y1: "2152.6", x2: "1500", y2: "1719.6" }), index.h("line", { key: 'ac37ac0104a2738375b8f71481b826ae63730dce', opacity: "0.833", x1: "680.4", y1: "900", x2: "247.4", y2: "650" }), index.h("line", { key: '0623f6448f636a6f5f65cb68387ab81381a56acf', opacity: "0.333", x1: "2152.6", y1: "1750", x2: "1719.6", y2: "1500" }), index.h("line", { key: 'f3dbc37979ad51676728ac79eccab6d7be4d9192', opacity: "0.75", x1: "600", y1: "1200", x2: "100", y2: "1200" }), index.h("line", { key: 'c5d92ff42dbe24d6c2136b24cdf2d57835f11b76', opacity: "0.25", x1: "2300", y1: "1200", x2: "1800", y2: "1200" }), index.h("line", { key: '3339f4fefcc7222050da34aa7b8b60c9ac511aea', opacity: "0.667", x1: "680.4", y1: "1500", x2: "247.4", y2: "1750" }), index.h("line", { key: '7ddc8d68d7f7deb0fe377b508180bc0b1123bf7f', opacity: "0.167", x1: "2152.6", y1: "650", x2: "1719.6", y2: "900" }), index.h("line", { key: '8825e19d81b7ade6d1ee327ac7b8bc24607a7c47', opacity: "0.583", x1: "900", y1: "1719.6", x2: "650", y2: "2152.6" }), index.h("line", { key: '9562d8c1dcc59a4884cff618edc35e951b19794c', opacity: "0.083", x1: "1750", y1: "247.4", x2: "1500", y2: "680.4" }), index.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" })))), index.h("div", { key: 'a86fb232eb5df0737c870e0e788c0c1e230b434e', class: "modal-content" }, index.h("slot", { key: 'b5ee41fc9dd113c3e2716f01350641fc2adebd7b' }))))));
|
|
503
|
-
}
|
|
504
|
-
get el() { return index.getElement(this); }
|
|
505
|
-
};
|
|
506
|
-
StripeModal.style = stripeModalCss();
|
|
507
|
-
|
|
508
442
|
exports.stripe_card_element = StripeCardElement;
|
|
509
|
-
exports.stripe_modal = StripeModal;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-Dkb0SxZc.js');
|
|
4
|
-
var
|
|
4
|
+
var i18n = require('./i18n-FhEOc8vz.js');
|
|
5
|
+
var factory = require('./factory-tenFFIul.js');
|
|
5
6
|
require('./index-CYbA1N_k.js');
|
|
6
7
|
|
|
7
8
|
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}`;
|
|
@@ -129,6 +130,13 @@ const StripeCurrencySelector = class {
|
|
|
129
130
|
// Dependency Injection via factory
|
|
130
131
|
this.stripeService = factory.serviceFactory.createStripeService();
|
|
131
132
|
this.currencySelectorElementManager = factory.serviceFactory.createCurrencySelectorElementManager(this.stripeService);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Props are not yet populated inside the constructor when the component is registered via
|
|
136
|
+
* the custom-elements build (`dist/components/*`), so initialization that depends on them
|
|
137
|
+
* must run in `componentWillLoad`, where both the lazy and custom-elements builds have them set.
|
|
138
|
+
*/
|
|
139
|
+
componentWillLoad() {
|
|
132
140
|
if (this.publishableKey) {
|
|
133
141
|
this.initStripe(this.publishableKey, {
|
|
134
142
|
stripeAccount: this.stripeAccount,
|
|
@@ -158,7 +166,7 @@ const StripeCurrencySelector = class {
|
|
|
158
166
|
});
|
|
159
167
|
}
|
|
160
168
|
componentDidLoad() {
|
|
161
|
-
const platform =
|
|
169
|
+
const platform = i18n.checkPlatform();
|
|
162
170
|
if (platform) {
|
|
163
171
|
this.el.classList.add(platform);
|
|
164
172
|
}
|
|
@@ -170,7 +178,7 @@ const StripeCurrencySelector = class {
|
|
|
170
178
|
const { loadStripeStatus } = this.stripeService.state;
|
|
171
179
|
const { errorMessage } = this.currencySelectorElementManager.getState();
|
|
172
180
|
if (loadStripeStatus === 'failure') {
|
|
173
|
-
return index.h("p", null,
|
|
181
|
+
return index.h("p", null, i18n.i18n.t('Failed to load Stripe'));
|
|
174
182
|
}
|
|
175
183
|
return (index.h("div", { class: "stripe-currency-selector-wrap" }, index.h("div", { id: "currency-selector" }), errorMessage ? (index.h("div", { id: "currency-selector-errors", class: "stripe-element-errors" }, errorMessage)) : null));
|
|
176
184
|
}
|
|
@@ -46,7 +46,7 @@ var patchCloneNodeFix = (HTMLElementPrototype) => {
|
|
|
46
46
|
|
|
47
47
|
patchBrowser().then(async (options) => {
|
|
48
48
|
await appGlobals.globalScripts();
|
|
49
|
-
return index.bootstrapLazy([["stripe-card-element-modal.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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}]}]]],["
|
|
49
|
+
return index.bootstrapLazy([["stripe-card-element-modal.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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);
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
exports.setNonce = index.setNonce;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-Dkb0SxZc.js');
|
|
4
|
-
var
|
|
4
|
+
var i18n = require('./i18n-FhEOc8vz.js');
|
|
5
|
+
var factory = require('./factory-tenFFIul.js');
|
|
5
6
|
var error = require('./error-FFC4kSs5.js');
|
|
6
7
|
require('./index-CYbA1N_k.js');
|
|
7
8
|
|
|
@@ -73,6 +74,8 @@ const StripeExpressCheckoutElement = class {
|
|
|
73
74
|
await this.stripeService.initialize(publishableKey, {
|
|
74
75
|
stripeAccount: options === null || options === void 0 ? void 0 : options.stripeAccount,
|
|
75
76
|
applicationName: this.applicationName,
|
|
77
|
+
clientSecret: this.clientSecret,
|
|
78
|
+
elementsOptions: this.buildElementsOptions(),
|
|
76
79
|
});
|
|
77
80
|
// If already successfully loaded, initialize elements immediately
|
|
78
81
|
if (this.stripeService.state.loadStripeStatus === 'success') {
|
|
@@ -91,6 +94,22 @@ const StripeExpressCheckoutElement = class {
|
|
|
91
94
|
});
|
|
92
95
|
}
|
|
93
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Options for `stripe.elements()` when there is no client secret.
|
|
99
|
+
* Stripe.js reads mode / amount / currency from the Elements group, not from the element itself.
|
|
100
|
+
*/
|
|
101
|
+
buildElementsOptions() {
|
|
102
|
+
if (this.currency == null || this.currency === '') {
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
if (this.intentType === 'setup') {
|
|
106
|
+
return { mode: 'setup', currency: this.currency };
|
|
107
|
+
}
|
|
108
|
+
if (this.amount === undefined) {
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
return { mode: 'payment', amount: this.amount, currency: this.currency };
|
|
112
|
+
}
|
|
94
113
|
/**
|
|
95
114
|
* Update element options dynamically
|
|
96
115
|
* @param options - Partial options to update
|
|
@@ -151,6 +170,13 @@ const StripeExpressCheckoutElement = class {
|
|
|
151
170
|
// Dependency Injection via factory
|
|
152
171
|
this.stripeService = factory.serviceFactory.createStripeService();
|
|
153
172
|
this.expressCheckoutManager = factory.serviceFactory.createExpressCheckoutElementManager(this.stripeService);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Props are not yet populated inside the constructor when the component is registered via
|
|
176
|
+
* the custom-elements build (`dist/components/*`), so initialization that depends on them
|
|
177
|
+
* must run in `componentWillLoad`, where both the lazy and custom-elements builds have them set.
|
|
178
|
+
*/
|
|
179
|
+
componentWillLoad() {
|
|
154
180
|
if (this.publishableKey != null && this.publishableKey !== '') {
|
|
155
181
|
this.initStripe(this.publishableKey, {
|
|
156
182
|
stripeAccount: this.stripeAccount,
|
|
@@ -266,7 +292,7 @@ const StripeExpressCheckoutElement = class {
|
|
|
266
292
|
});
|
|
267
293
|
}
|
|
268
294
|
componentDidLoad() {
|
|
269
|
-
this.el.classList.add(
|
|
295
|
+
this.el.classList.add(i18n.checkPlatform());
|
|
270
296
|
}
|
|
271
297
|
disconnectedCallback() {
|
|
272
298
|
this.expressCheckoutManager.unmount();
|
|
@@ -275,12 +301,12 @@ const StripeExpressCheckoutElement = class {
|
|
|
275
301
|
const { loadStripeStatus } = this.stripeService.state;
|
|
276
302
|
const { errorMessage, isReady } = this.expressCheckoutManager.getState();
|
|
277
303
|
if (loadStripeStatus === 'failure') {
|
|
278
|
-
return index.h("p", null,
|
|
304
|
+
return index.h("p", null, i18n.i18n.t('Failed to load Stripe'));
|
|
279
305
|
}
|
|
280
306
|
if (loadStripeStatus === 'loading') {
|
|
281
|
-
return index.h("p", null,
|
|
307
|
+
return index.h("p", null, i18n.i18n.t('Loading'));
|
|
282
308
|
}
|
|
283
|
-
return (index.h("div", { class: "stripe-express-checkout-wrap" }, index.h("div", { id: "express-checkout-element" }), errorMessage && (index.h("div", { id: "express-checkout-errors", class: "stripe-element-errors" }, errorMessage)), !isReady && loadStripeStatus === 'success' && index.h("div", { class: "stripe-express-checkout-loading" },
|
|
309
|
+
return (index.h("div", { class: "stripe-express-checkout-wrap" }, index.h("div", { id: "express-checkout-element" }), errorMessage && (index.h("div", { id: "express-checkout-errors", class: "stripe-element-errors" }, errorMessage)), !isReady && loadStripeStatus === 'success' && index.h("div", { class: "stripe-express-checkout-loading" }, i18n.i18n.t('Loading'))));
|
|
284
310
|
}
|
|
285
311
|
get el() { return index.getElement(this); }
|
|
286
312
|
static get watchers() { return {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-Dkb0SxZc.js');
|
|
4
|
-
var
|
|
4
|
+
var i18n = require('./i18n-FhEOc8vz.js');
|
|
5
|
+
var factory = require('./factory-tenFFIul.js');
|
|
5
6
|
require('./index-CYbA1N_k.js');
|
|
6
7
|
|
|
7
8
|
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)}`;
|
|
@@ -170,6 +171,13 @@ const StripeLinkAuthenticationElement = class {
|
|
|
170
171
|
// Dependency Injection via factory
|
|
171
172
|
this.stripeService = factory.serviceFactory.createStripeService();
|
|
172
173
|
this.linkAuthenticationElementManager = factory.serviceFactory.createLinkAuthenticationElementManager(this.stripeService);
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Props are not yet populated inside the constructor when the component is registered via
|
|
177
|
+
* the custom-elements build (`dist/components/*`), so initialization that depends on them
|
|
178
|
+
* must run in `componentWillLoad`, where both the lazy and custom-elements builds have them set.
|
|
179
|
+
*/
|
|
180
|
+
componentWillLoad() {
|
|
173
181
|
if (this.publishableKey) {
|
|
174
182
|
this.initStripe(this.publishableKey, {
|
|
175
183
|
stripeAccount: this.stripeAccount,
|
|
@@ -194,7 +202,7 @@ const StripeLinkAuthenticationElement = class {
|
|
|
194
202
|
});
|
|
195
203
|
}
|
|
196
204
|
componentDidLoad() {
|
|
197
|
-
const platform =
|
|
205
|
+
const platform = i18n.checkPlatform();
|
|
198
206
|
if (platform) {
|
|
199
207
|
this.el.classList.add(platform);
|
|
200
208
|
}
|
|
@@ -206,7 +214,7 @@ const StripeLinkAuthenticationElement = class {
|
|
|
206
214
|
const { loadStripeStatus } = this.stripeService.state;
|
|
207
215
|
const { errorMessage } = this.linkAuthenticationElementManager.getState();
|
|
208
216
|
if (loadStripeStatus === 'failure') {
|
|
209
|
-
return index.h("p", null,
|
|
217
|
+
return index.h("p", null, i18n.i18n.t('Failed to load Stripe'));
|
|
210
218
|
}
|
|
211
219
|
return (index.h("div", { class: "stripe-link-authentication-wrap" }, index.h("div", { class: "stripe-link-authentication-container" }, index.h("div", { id: "link-authentication-element" }), index.h("div", { id: "link-authentication-errors", class: "stripe-element-errors" }, errorMessage))));
|
|
212
220
|
}
|