stripe-pwa-elements 4.0.1 → 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/factory-Cm6zUD7R.js +1206 -0
- package/dist/cjs/{factory-Cd2VI_N2.js → i18n-lBbOeQt4.js} +12 -1149
- package/dist/cjs/ion-icon_2.cjs.entry.js +725 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/stripe-address-element.cjs.entry.js +5 -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} +8 -93
- package/dist/cjs/stripe-currency-selector.cjs.entry.js +4 -3
- package/dist/cjs/stripe-elements.cjs.js +1 -1
- package/dist/cjs/stripe-express-checkout-element.cjs.entry.js +24 -5
- package/dist/cjs/stripe-link-authentication-element.cjs.entry.js +4 -3
- package/dist/cjs/stripe-payment-element.cjs.entry.js +12 -124
- package/dist/cjs/stripe-payment-element.helpers-CvAhIqLt.js +119 -0
- package/dist/cjs/stripe-payment-request-button.cjs.entry.js +2 -2
- package/dist/cjs/stripe-payment-sheet.cjs.entry.js +987 -0
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/stripe-address-element/stripe-address-element.js +2 -2
- package/dist/collection/components/stripe-card-element/stripe-card-element.js +3 -2
- package/dist/collection/components/stripe-card-element-modal/stripe-card-element-modal.js +4 -3
- package/dist/collection/components/stripe-express-checkout-element/stripe-express-checkout-element.js +18 -0
- package/dist/collection/components/stripe-modal/stripe-modal.css +27 -1
- package/dist/collection/components/stripe-modal/stripe-modal.js +132 -1
- package/dist/collection/components/stripe-payment-element/stripe-payment-element.helpers.js +4 -7
- package/dist/collection/components/stripe-payment-element/stripe-payment-element.js +4 -4
- package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js +3 -3
- package/dist/collection/components/stripe-payment-sheet/payment-sheet-state.js +193 -0
- package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.checkout.js +94 -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 +274 -0
- package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.js +763 -0
- package/dist/collection/services/express-checkout-element-manager.js +36 -2
- package/dist/collection/services/link-authentication-element-manager.js +5 -0
- package/dist/collection/services/stripe-service.js +20 -6
- package/dist/collection/utils/focus.js +76 -0
- package/dist/collection/utils/i18n.js +12 -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-BaGv8K_i.js +1203 -0
- package/dist/esm/{factory-VTa1Gc94.js → i18n-CL5n3bOb.js} +13 -1149
- package/dist/esm/ion-icon_2.entry.js +722 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/stripe-address-element.entry.js +2 -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} +6 -90
- package/dist/esm/stripe-currency-selector.entry.js +2 -1
- package/dist/esm/stripe-elements.js +1 -1
- package/dist/esm/stripe-express-checkout-element.entry.js +20 -1
- package/dist/esm/stripe-link-authentication-element.entry.js +2 -1
- package/dist/esm/stripe-payment-element.entry.js +4 -116
- package/dist/esm/stripe-payment-element.helpers-Bu9RfxS4.js +114 -0
- package/dist/esm/stripe-payment-request-button.entry.js +2 -2
- package/dist/esm/stripe-payment-sheet.entry.js +985 -0
- package/dist/stripe-elements/p-2e41699e.entry.js +1 -0
- package/dist/stripe-elements/p-3fc4583a.entry.js +1 -0
- package/dist/stripe-elements/{p-ae0c336e.entry.js → p-4891edf0.entry.js} +1 -1
- package/dist/stripe-elements/p-7e826964.entry.js +1 -0
- package/dist/stripe-elements/p-BhKXGROE.js +1 -0
- package/dist/stripe-elements/p-CL5n3bOb.js +1 -0
- package/dist/stripe-elements/p-DlMEZwSe.js +1 -0
- package/dist/stripe-elements/p-a395a5d1.entry.js +1 -0
- package/dist/stripe-elements/p-b62c9dae.entry.js +1 -0
- package/dist/stripe-elements/p-b7c20e8e.entry.js +1 -0
- package/dist/stripe-elements/p-ba791c8f.entry.js +1 -0
- package/dist/stripe-elements/p-bec62526.entry.js +1 -0
- package/dist/stripe-elements/p-f5552c81.entry.js +1 -0
- package/dist/stripe-elements/stripe-elements.esm.js +1 -1
- package/dist/types/components/stripe-card-element/stripe-card-element.d.ts +2 -1
- package/dist/types/components/stripe-card-element-modal/stripe-card-element-modal.d.ts +2 -1
- package/dist/types/components/stripe-express-checkout-element/stripe-express-checkout-element.d.ts +5 -0
- package/dist/types/components/stripe-modal/stripe-modal.d.ts +43 -0
- package/dist/types/components/stripe-payment-element/stripe-payment-element.helpers.d.ts +7 -2
- package/dist/types/components/stripe-payment-request-button/stripe-payment-request-button.d.ts +1 -1
- package/dist/types/components/stripe-payment-sheet/payment-sheet-state.d.ts +121 -0
- package/dist/types/components/stripe-payment-sheet/stripe-payment-sheet.checkout.d.ts +39 -0
- package/dist/types/components/stripe-payment-sheet/stripe-payment-sheet.d.ts +157 -0
- package/dist/types/components/stripe-payment-sheet/stripe-payment-sheet.helpers.d.ts +153 -0
- package/dist/types/components.d.ts +182 -10
- package/dist/types/index.d.ts +2 -0
- package/dist/types/services/interfaces.d.ts +3 -0
- package/dist/types/services/stripe-service.d.ts +7 -2
- package/dist/types/utils/focus.d.ts +15 -0
- package/package.json +7 -3
- package/readme.md +59 -6
- 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-1bd46766.entry.js +0 -1
- package/dist/stripe-elements/p-1c6e0a45.entry.js +0 -1
- package/dist/stripe-elements/p-3f42ca0c.entry.js +0 -1
- package/dist/stripe-elements/p-5cf62945.entry.js +0 -1
- package/dist/stripe-elements/p-74de1556.entry.js +0 -1
- package/dist/stripe-elements/p-76e57d78.entry.js +0 -1
- package/dist/stripe-elements/p-840d499f.entry.js +0 -1
- package/dist/stripe-elements/p-CrjrbGJ3.js +0 -1
- package/dist/stripe-elements/p-cfd8e081.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"],"checkoutSessionClientSecret":[1,"checkout-session-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],"collection":[32],"present":[64]},null,{"publishableKey":[{"handleSecretChange":0}],"intentClientSecret":[{"handleSecretChange":0}],"checkoutSessionClientSecret":[{"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-lBbOeQt4.js');
|
|
5
|
+
var factory = require('./factory-Cm6zUD7R.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)}`;
|
|
@@ -262,7 +263,7 @@ const StripeAddressElement = class {
|
|
|
262
263
|
formElement.addEventListener('submit', this.formSubmitListener);
|
|
263
264
|
}
|
|
264
265
|
componentDidLoad() {
|
|
265
|
-
this.el.classList.add(
|
|
266
|
+
this.el.classList.add(i18n.checkPlatform());
|
|
266
267
|
}
|
|
267
268
|
disconnectedCallback() {
|
|
268
269
|
// Remove form submit listener
|
|
@@ -279,14 +280,14 @@ const StripeAddressElement = class {
|
|
|
279
280
|
const { loadStripeStatus } = this.stripeService.state;
|
|
280
281
|
const { errorMessage } = this.addressElementManager.getState();
|
|
281
282
|
if (loadStripeStatus === 'failure') {
|
|
282
|
-
return index.h("p", null,
|
|
283
|
+
return index.h("p", null, i18n.i18n.t('Failed to load Stripe'));
|
|
283
284
|
}
|
|
284
285
|
const disabled = this.progress === 'loading';
|
|
285
286
|
// NOTE: `stripe-payment-sheet-wrap` below is a legacy CSS class kept for backward
|
|
286
287
|
// compatibility (leftover from a former component name). It is part of the public
|
|
287
288
|
// DOM contract — consumers may target it in their own stylesheets — so it must
|
|
288
289
|
// remain in the rendered output. Do not remove it.
|
|
289
|
-
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))))));
|
|
290
291
|
}
|
|
291
292
|
get el() { return index.getElement(this); }
|
|
292
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-lBbOeQt4.js');
|
|
5
|
+
var factory = require('./factory-Cm6zUD7R.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
|
*/
|
|
@@ -363,7 +365,7 @@ const StripeCardElement = class {
|
|
|
363
365
|
});
|
|
364
366
|
}
|
|
365
367
|
componentDidLoad() {
|
|
366
|
-
this.el.classList.add(
|
|
368
|
+
this.el.classList.add(i18n.checkPlatform());
|
|
367
369
|
}
|
|
368
370
|
componentDidRender() {
|
|
369
371
|
// Safely create payment request button after DOM is ready
|
|
@@ -414,16 +416,16 @@ const StripeCardElement = class {
|
|
|
414
416
|
const { loadStripeStatus } = this.stripeService.state;
|
|
415
417
|
const { errorMessage } = this.cardElementManager.getState();
|
|
416
418
|
if (loadStripeStatus === 'failure') {
|
|
417
|
-
return index.h("p", null,
|
|
419
|
+
return index.h("p", null, i18n.i18n.t('Failed to load Stripe'));
|
|
418
420
|
}
|
|
419
421
|
const disabled = this.progress === 'loading';
|
|
420
422
|
return (
|
|
421
423
|
// NOTE: `stripe-payment-sheet-wrap` is a legacy class name (leftover from a former
|
|
422
424
|
// component name). External consumers may target it in their own CSS, so it is a
|
|
423
425
|
// public DOM contract that MUST be kept for backward compatibility. Do not remove it.
|
|
424
|
-
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 => {
|
|
425
427
|
this.zipCode = e.target.value;
|
|
426
|
-
} })))))) : 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))))));
|
|
427
429
|
}
|
|
428
430
|
get el() { return index.getElement(this); }
|
|
429
431
|
static get watchers() { return {
|
|
@@ -437,91 +439,4 @@ const StripeCardElement = class {
|
|
|
437
439
|
};
|
|
438
440
|
StripeCardElement.style = stripeCardElementCss();
|
|
439
441
|
|
|
440
|
-
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}`;
|
|
441
|
-
|
|
442
|
-
const StripeModal = class {
|
|
443
|
-
constructor(hostRef) {
|
|
444
|
-
index.registerInstance(this, hostRef);
|
|
445
|
-
this.close = index.createEvent(this, "close", 7);
|
|
446
|
-
/**
|
|
447
|
-
* If true, the modal display close button
|
|
448
|
-
*/
|
|
449
|
-
this.showCloseButton = true;
|
|
450
|
-
/**
|
|
451
|
-
* Modal state.
|
|
452
|
-
* If true, the modal will open
|
|
453
|
-
*/
|
|
454
|
-
this.open = false;
|
|
455
|
-
/**
|
|
456
|
-
* Effect `this.open`. This is for animation.
|
|
457
|
-
* Ionic Ref: https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/accordion/accordion.tsx#L83
|
|
458
|
-
*/
|
|
459
|
-
this.renderedOpen = false;
|
|
460
|
-
}
|
|
461
|
-
onOpenChange(open) {
|
|
462
|
-
if (open) {
|
|
463
|
-
this.openModalAnimation();
|
|
464
|
-
}
|
|
465
|
-
else {
|
|
466
|
-
this.renderedOpen = false;
|
|
467
|
-
this.close.emit();
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
/**
|
|
471
|
-
* Toggle modal state
|
|
472
|
-
*/
|
|
473
|
-
async toggleModal() {
|
|
474
|
-
this.open ? await this.closeModal() : await this.openModal();
|
|
475
|
-
}
|
|
476
|
-
/**
|
|
477
|
-
* Open the modal
|
|
478
|
-
*/
|
|
479
|
-
async openModal() {
|
|
480
|
-
this.open = true;
|
|
481
|
-
}
|
|
482
|
-
/**
|
|
483
|
-
* Close the modal
|
|
484
|
-
*/
|
|
485
|
-
async closeModal() {
|
|
486
|
-
this.open = false;
|
|
487
|
-
}
|
|
488
|
-
componentDidLoad() {
|
|
489
|
-
const platformName = factory.checkPlatform();
|
|
490
|
-
if (platformName) {
|
|
491
|
-
this.el.classList.add(platformName);
|
|
492
|
-
}
|
|
493
|
-
if (this.open) {
|
|
494
|
-
this.openModalAnimation();
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
openModalAnimation() {
|
|
498
|
-
if (!this.el.shadowRoot) {
|
|
499
|
-
this.renderedOpen = true;
|
|
500
|
-
return;
|
|
501
|
-
}
|
|
502
|
-
const modalChild = this.el.shadowRoot.querySelector('.modal-child');
|
|
503
|
-
modalChild.classList.add('loading');
|
|
504
|
-
modalChild.style.willChange = 'transform';
|
|
505
|
-
modalChild.addEventListener('transitionend', () => {
|
|
506
|
-
modalChild.style.willChange = 'auto';
|
|
507
|
-
modalChild.classList.remove('loading');
|
|
508
|
-
}, { once: true });
|
|
509
|
-
requestAnimationFrame(() => {
|
|
510
|
-
this.renderedOpen = this.open;
|
|
511
|
-
});
|
|
512
|
-
}
|
|
513
|
-
render() {
|
|
514
|
-
const { renderedOpen, showCloseButton } = this;
|
|
515
|
-
return (index.h(index.Host, { key: '38fb86acf7cf5887a426c67b1a1271f7fae7048c' }, index.h("div", { key: 'f751d92c327ee2e564edfcd4d18f4dca43c20c37', class: `modal-row${renderedOpen ? ' open' : ''}`, onClick: () => this.closeModal() }, index.h("div", { key: '11519ccd44a5069df3247c530a2c1e114eab7aef', 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: 'a41f7f263b488b5bbc2a999cbabf6b9e407bca85', class: "modal-loading" }, index.h("svg", { key: '0b3b25cb2812bc4d837fb4b7e6af4a5f42f0247e', version: "1.1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 2400 2400" }, index.h("g", { key: '10a9f9ec59699e6d2988b9c65cd02da1754fd760', "stroke-width": "200", "stroke-linecap": "round", stroke: "currentColor", fill: "none", id: "spinner" }, index.h("line", { key: 'ed271fa584b930ceed5397c271b31e0d48c72f72', x1: "1200", y1: "600", x2: "1200", y2: "100" }), index.h("line", { key: '3cf855a84f3ab58b914b7aeb784fbc5b95d8ae94', opacity: "0.5", x1: "1200", y1: "2300", x2: "1200", y2: "1800" }), index.h("line", { key: '2cce4b62a276399235509e94f47a63acf9c69a0f', opacity: "0.917", x1: "900", y1: "680.4", x2: "650", y2: "247.4" }), index.h("line", { key: '64c175ef068591417b043f7630a44d34eae7cb59', opacity: "0.417", x1: "1750", y1: "2152.6", x2: "1500", y2: "1719.6" }), index.h("line", { key: '0856a654e3aa756dfb1e9fc316b8b379fa9d5a4e', opacity: "0.833", x1: "680.4", y1: "900", x2: "247.4", y2: "650" }), index.h("line", { key: 'c60f1f8495df9b8cdcc8941255d08c01a0e1c02f', opacity: "0.333", x1: "2152.6", y1: "1750", x2: "1719.6", y2: "1500" }), index.h("line", { key: '204bc2a7765e43b86f91c3fb9b1e72a3a39bb323', opacity: "0.75", x1: "600", y1: "1200", x2: "100", y2: "1200" }), index.h("line", { key: '7584b272f9efd7f746c1bcc5c8a5576098b02381', opacity: "0.25", x1: "2300", y1: "1200", x2: "1800", y2: "1200" }), index.h("line", { key: '7a053e9eb5f0da3fbf6fb7c9680bf73073bb126d', opacity: "0.667", x1: "680.4", y1: "1500", x2: "247.4", y2: "1750" }), index.h("line", { key: 'f8b817095143d739589e45c99b03c7afbdfc8293', opacity: "0.167", x1: "2152.6", y1: "650", x2: "1719.6", y2: "900" }), index.h("line", { key: 'aae0e36dbdfff44196f9758c8a5ed2337139ebe0', opacity: "0.583", x1: "900", y1: "1719.6", x2: "650", y2: "2152.6" }), index.h("line", { key: '3a257b30cb289f29ba386ccca7519bcdc22c3786', opacity: "0.083", x1: "1750", y1: "247.4", x2: "1500", y2: "680.4" }), index.h("animateTransform", { key: 'c6b8e73025589403dd3d08f84b02eb824763d056', 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: 'da5ef8031e5b826d854a065d8172389cdd84fbf0', class: "modal-content" }, index.h("slot", { key: 'fbe97a3a4d5489de5ae6f49342c58d537b317842' }))))));
|
|
516
|
-
}
|
|
517
|
-
get el() { return index.getElement(this); }
|
|
518
|
-
static get watchers() { return {
|
|
519
|
-
"open": [{
|
|
520
|
-
"onOpenChange": 0
|
|
521
|
-
}]
|
|
522
|
-
}; }
|
|
523
|
-
};
|
|
524
|
-
StripeModal.style = stripeModalCss();
|
|
525
|
-
|
|
526
442
|
exports.stripe_card_element = StripeCardElement;
|
|
527
|
-
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-lBbOeQt4.js');
|
|
5
|
+
var factory = require('./factory-Cm6zUD7R.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}`;
|
|
@@ -165,7 +166,7 @@ const StripeCurrencySelector = class {
|
|
|
165
166
|
});
|
|
166
167
|
}
|
|
167
168
|
componentDidLoad() {
|
|
168
|
-
const platform =
|
|
169
|
+
const platform = i18n.checkPlatform();
|
|
169
170
|
if (platform) {
|
|
170
171
|
this.el.classList.add(platform);
|
|
171
172
|
}
|
|
@@ -177,7 +178,7 @@ const StripeCurrencySelector = class {
|
|
|
177
178
|
const { loadStripeStatus } = this.stripeService.state;
|
|
178
179
|
const { errorMessage } = this.currencySelectorElementManager.getState();
|
|
179
180
|
if (loadStripeStatus === 'failure') {
|
|
180
|
-
return index.h("p", null,
|
|
181
|
+
return index.h("p", null, i18n.i18n.t('Failed to load Stripe'));
|
|
181
182
|
}
|
|
182
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));
|
|
183
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"],"checkoutSessionClientSecret":[1,"checkout-session-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],"collection":[32],"present":[64]},null,{"publishableKey":[{"handleSecretChange":0}],"intentClientSecret":[{"handleSecretChange":0}],"checkoutSessionClientSecret":[{"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-lBbOeQt4.js');
|
|
5
|
+
var factory = require('./factory-Cm6zUD7R.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
|
|
@@ -273,7 +292,7 @@ const StripeExpressCheckoutElement = class {
|
|
|
273
292
|
});
|
|
274
293
|
}
|
|
275
294
|
componentDidLoad() {
|
|
276
|
-
this.el.classList.add(
|
|
295
|
+
this.el.classList.add(i18n.checkPlatform());
|
|
277
296
|
}
|
|
278
297
|
disconnectedCallback() {
|
|
279
298
|
this.expressCheckoutManager.unmount();
|
|
@@ -282,12 +301,12 @@ const StripeExpressCheckoutElement = class {
|
|
|
282
301
|
const { loadStripeStatus } = this.stripeService.state;
|
|
283
302
|
const { errorMessage, isReady } = this.expressCheckoutManager.getState();
|
|
284
303
|
if (loadStripeStatus === 'failure') {
|
|
285
|
-
return index.h("p", null,
|
|
304
|
+
return index.h("p", null, i18n.i18n.t('Failed to load Stripe'));
|
|
286
305
|
}
|
|
287
306
|
if (loadStripeStatus === 'loading') {
|
|
288
|
-
return index.h("p", null,
|
|
307
|
+
return index.h("p", null, i18n.i18n.t('Loading'));
|
|
289
308
|
}
|
|
290
|
-
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'))));
|
|
291
310
|
}
|
|
292
311
|
get el() { return index.getElement(this); }
|
|
293
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-lBbOeQt4.js');
|
|
5
|
+
var factory = require('./factory-Cm6zUD7R.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)}`;
|
|
@@ -201,7 +202,7 @@ const StripeLinkAuthenticationElement = class {
|
|
|
201
202
|
});
|
|
202
203
|
}
|
|
203
204
|
componentDidLoad() {
|
|
204
|
-
const platform =
|
|
205
|
+
const platform = i18n.checkPlatform();
|
|
205
206
|
if (platform) {
|
|
206
207
|
this.el.classList.add(platform);
|
|
207
208
|
}
|
|
@@ -213,7 +214,7 @@ const StripeLinkAuthenticationElement = class {
|
|
|
213
214
|
const { loadStripeStatus } = this.stripeService.state;
|
|
214
215
|
const { errorMessage } = this.linkAuthenticationElementManager.getState();
|
|
215
216
|
if (loadStripeStatus === 'failure') {
|
|
216
|
-
return index.h("p", null,
|
|
217
|
+
return index.h("p", null, i18n.i18n.t('Failed to load Stripe'));
|
|
217
218
|
}
|
|
218
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))));
|
|
219
220
|
}
|