stripe-pwa-elements 4.0.4 → 4.1.0
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 → factory-yd5HDEZn.js} +2 -1
- package/dist/cjs/{i18n-lBbOeQt4.js → i18n-CWEsGqxV.js} +2 -2
- package/dist/cjs/ion-icon_2.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/stripe-address-element.cjs.entry.js +2 -2
- package/dist/cjs/stripe-card-element.cjs.entry.js +3 -3
- package/dist/cjs/stripe-currency-selector.cjs.entry.js +2 -2
- package/dist/cjs/stripe-elements.cjs.js +1 -1
- package/dist/cjs/stripe-express-checkout-element.cjs.entry.js +2 -2
- package/dist/cjs/stripe-link-authentication-element.cjs.entry.js +2 -2
- package/dist/cjs/stripe-payment-element.cjs.entry.js +19 -8
- package/dist/cjs/stripe-payment-element.helpers-D1JnhTa-.js +182 -0
- package/dist/cjs/stripe-payment-sheet.cjs.entry.js +73 -58
- package/dist/collection/components/stripe-card-element/stripe-card-element.js +2 -2
- package/dist/collection/components/stripe-payment-element/stripe-payment-element.helpers.js +9 -32
- package/dist/collection/components/stripe-payment-element/stripe-payment-element.js +88 -6
- package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.checkout.js +60 -48
- package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.js +5 -2
- package/dist/collection/services/stripe-service.js +1 -0
- package/dist/collection/utils/checkout-confirm.js +84 -0
- package/dist/collection/utils/i18n.js +2 -2
- package/dist/components/factory.js +1 -1
- package/dist/components/i18n.js +1 -1
- package/dist/components/stripe-card-element2.js +1 -1
- package/dist/components/stripe-payment-element.helpers.js +1 -1
- package/dist/components/stripe-payment-element.js +1 -1
- package/dist/components/stripe-payment-sheet.js +1 -1
- package/dist/esm/{factory-BaGv8K_i.js → factory-B_WxdnxM.js} +2 -1
- package/dist/esm/{i18n-CL5n3bOb.js → i18n-HWdALSvT.js} +2 -2
- package/dist/esm/ion-icon_2.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/stripe-address-element.entry.js +2 -2
- package/dist/esm/stripe-card-element.entry.js +3 -3
- package/dist/esm/stripe-currency-selector.entry.js +2 -2
- package/dist/esm/stripe-elements.js +1 -1
- package/dist/esm/stripe-express-checkout-element.entry.js +2 -2
- package/dist/esm/stripe-link-authentication-element.entry.js +2 -2
- package/dist/esm/stripe-payment-element.entry.js +19 -8
- package/dist/esm/stripe-payment-element.helpers-PuWxhMNR.js +176 -0
- package/dist/esm/stripe-payment-sheet.entry.js +73 -58
- package/dist/stripe-elements/{p-f5552c81.entry.js → p-2e2bf0fe.entry.js} +1 -1
- package/dist/stripe-elements/{p-3fc4583a.entry.js → p-32a2d5a4.entry.js} +1 -1
- package/dist/stripe-elements/{p-b62c9dae.entry.js → p-84d45b48.entry.js} +1 -1
- package/dist/stripe-elements/{p-CL5n3bOb.js → p-HWdALSvT.js} +1 -1
- package/dist/stripe-elements/{p-5d3d93ec.entry.js → p-a266da6f.entry.js} +1 -1
- package/dist/stripe-elements/{p-7e826964.entry.js → p-b4faa9db.entry.js} +1 -1
- package/dist/stripe-elements/p-c4a0e310.entry.js +1 -0
- package/dist/stripe-elements/{p-2e41699e.entry.js → p-e660d76a.entry.js} +1 -1
- package/dist/stripe-elements/p-eeebfbbf.entry.js +1 -0
- package/dist/stripe-elements/p-n0XJSLU3.js +1 -0
- package/dist/stripe-elements/p-wrjrFokg.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 +5 -0
- package/dist/types/components/stripe-payment-element/stripe-payment-element.d.ts +38 -0
- package/dist/types/components/stripe-payment-element/stripe-payment-element.helpers.d.ts +8 -2
- package/dist/types/components/stripe-payment-sheet/stripe-payment-sheet.checkout.d.ts +19 -11
- package/dist/types/components.d.ts +36 -4
- package/dist/types/services/interfaces.d.ts +3 -1
- package/dist/types/utils/checkout-confirm.d.ts +35 -0
- package/package.json +1 -1
- package/dist/cjs/stripe-payment-element.helpers-lafmSRmb.js +0 -121
- package/dist/esm/stripe-payment-element.helpers-CklK5RlF.js +0 -116
- package/dist/stripe-elements/p-7a8f783c.entry.js +0 -1
- package/dist/stripe-elements/p-BoZLkOAy.js +0 -1
- package/dist/stripe-elements/p-DlMEZwSe.js +0 -1
- package/dist/stripe-elements/p-b69f6103.entry.js +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-Dkb0SxZc.js');
|
|
4
4
|
var index$1 = require('./index-CYbA1N_k.js');
|
|
5
|
-
var i18n = require('./i18n-
|
|
5
|
+
var i18n = require('./i18n-CWEsGqxV.js');
|
|
6
6
|
|
|
7
7
|
const appendToMap = (map, propName, value) => {
|
|
8
8
|
let refs = map.get(propName);
|
|
@@ -415,6 +415,7 @@ class StripeServiceClass {
|
|
|
415
415
|
const checkout = stripe.initCheckoutElementsSdk({
|
|
416
416
|
clientSecret: checkoutSessionClientSecret,
|
|
417
417
|
elementsOptions: options === null || options === void 0 ? void 0 : options.elementsOptions,
|
|
418
|
+
defaultValues: options === null || options === void 0 ? void 0 : options.defaultValues,
|
|
418
419
|
});
|
|
419
420
|
this.store.state.checkout = checkout;
|
|
420
421
|
this.store.state.elements = undefined;
|
|
@@ -2771,6 +2771,8 @@ Browser.type = 'languageDetector';
|
|
|
2771
2771
|
instance.use(Browser).init({
|
|
2772
2772
|
fallbackLng: 'en',
|
|
2773
2773
|
debug: false,
|
|
2774
|
+
// i18next prints a one-time Locize promo to the console unless this is false
|
|
2775
|
+
showSupportNotice: false,
|
|
2774
2776
|
resources: {
|
|
2775
2777
|
'en': {
|
|
2776
2778
|
translation: {},
|
|
@@ -2787,7 +2789,6 @@ instance.use(Browser).init({
|
|
|
2787
2789
|
'Card Number': 'カード番号',
|
|
2788
2790
|
'MM / YY': '月 / 年',
|
|
2789
2791
|
'CVC': 'セキュリティコード(CVC)',
|
|
2790
|
-
'Country or region': '地域',
|
|
2791
2792
|
'Postal Code': '郵便番号',
|
|
2792
2793
|
'Close': '閉じる',
|
|
2793
2794
|
'Loading': '読み込み中',
|
|
@@ -2811,7 +2812,6 @@ instance.use(Browser).init({
|
|
|
2811
2812
|
'Card Number': 'Número do Cartão',
|
|
2812
2813
|
'MM / YY': 'MM / AA',
|
|
2813
2814
|
'CVC': 'Número de Segurança(CVC)',
|
|
2814
|
-
'Country or region': 'País ou região',
|
|
2815
2815
|
'Postal Code': 'Cep',
|
|
2816
2816
|
'Close': 'Fechar',
|
|
2817
2817
|
'Please complete your billing address.': 'Preencha seu endereço de cobrança.',
|
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-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}],"intentClientSecret":[{"updateIntentClientSecret":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);
|
|
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"],"checkoutSessionReturnUrl":[1,"checkout-session-return-url"],"checkoutSessionEmail":[1,"checkout-session-email"],"checkoutSessionDefaultValues":[16],"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}],"intentClientSecret":[{"updateIntentClientSecret":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,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-Dkb0SxZc.js');
|
|
4
|
-
var i18n = require('./i18n-
|
|
5
|
-
var factory = require('./factory-
|
|
4
|
+
var i18n = require('./i18n-CWEsGqxV.js');
|
|
5
|
+
var factory = require('./factory-yd5HDEZn.js');
|
|
6
6
|
require('./index-CYbA1N_k.js');
|
|
7
7
|
|
|
8
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)}`;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-Dkb0SxZc.js');
|
|
4
|
-
var i18n = require('./i18n-
|
|
5
|
-
var factory = require('./factory-
|
|
4
|
+
var i18n = require('./i18n-CWEsGqxV.js');
|
|
5
|
+
var factory = require('./factory-yd5HDEZn.js');
|
|
6
6
|
var error = require('./error-FFC4kSs5.js');
|
|
7
7
|
require('./index-CYbA1N_k.js');
|
|
8
8
|
|
|
@@ -430,7 +430,7 @@ const StripeCardElement = class {
|
|
|
430
430
|
// NOTE: `stripe-payment-sheet-wrap` is a legacy class name (leftover from a former
|
|
431
431
|
// component name). External consumers may target it in their own CSS, so it is a
|
|
432
432
|
// public DOM contract that MUST be kept for backward compatibility. Do not remove it.
|
|
433
|
-
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('
|
|
433
|
+
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('Postal Code')))) : 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 => {
|
|
434
434
|
this.zipCode = e.target.value;
|
|
435
435
|
} })))))) : 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))))));
|
|
436
436
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-Dkb0SxZc.js');
|
|
4
|
-
var i18n = require('./i18n-
|
|
5
|
-
var factory = require('./factory-
|
|
4
|
+
var i18n = require('./i18n-CWEsGqxV.js');
|
|
5
|
+
var factory = require('./factory-yd5HDEZn.js');
|
|
6
6
|
require('./index-CYbA1N_k.js');
|
|
7
7
|
|
|
8
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}`;
|
|
@@ -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-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}],"intentClientSecret":[{"updateIntentClientSecret":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);
|
|
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"],"checkoutSessionReturnUrl":[1,"checkout-session-return-url"],"checkoutSessionEmail":[1,"checkout-session-email"],"checkoutSessionDefaultValues":[16],"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}],"intentClientSecret":[{"updateIntentClientSecret":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,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-Dkb0SxZc.js');
|
|
4
|
-
var i18n = require('./i18n-
|
|
5
|
-
var factory = require('./factory-
|
|
4
|
+
var i18n = require('./i18n-CWEsGqxV.js');
|
|
5
|
+
var factory = require('./factory-yd5HDEZn.js');
|
|
6
6
|
var error = require('./error-FFC4kSs5.js');
|
|
7
7
|
require('./index-CYbA1N_k.js');
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-Dkb0SxZc.js');
|
|
4
|
-
var i18n = require('./i18n-
|
|
5
|
-
var factory = require('./factory-
|
|
4
|
+
var i18n = require('./i18n-CWEsGqxV.js');
|
|
5
|
+
var factory = require('./factory-yd5HDEZn.js');
|
|
6
6
|
require('./index-CYbA1N_k.js');
|
|
7
7
|
|
|
8
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)}`;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-Dkb0SxZc.js');
|
|
4
|
-
var i18n = require('./i18n-
|
|
5
|
-
var factory = require('./factory-
|
|
6
|
-
var stripePaymentElement_helpers = require('./stripe-payment-element.helpers-
|
|
4
|
+
var i18n = require('./i18n-CWEsGqxV.js');
|
|
5
|
+
var factory = require('./factory-yd5HDEZn.js');
|
|
6
|
+
var stripePaymentElement_helpers = require('./stripe-payment-element.helpers-D1JnhTa-.js');
|
|
7
7
|
require('./index-CYbA1N_k.js');
|
|
8
8
|
require('./error-FFC4kSs5.js');
|
|
9
9
|
|
|
@@ -59,6 +59,7 @@ const StripePaymentElement = class {
|
|
|
59
59
|
stripeAccount: options === null || options === void 0 ? void 0 : options.stripeAccount,
|
|
60
60
|
applicationName: this.applicationName,
|
|
61
61
|
elementsOptions: options === null || options === void 0 ? void 0 : options.elementsOptions,
|
|
62
|
+
defaultValues: options === null || options === void 0 ? void 0 : options.defaultValues,
|
|
62
63
|
});
|
|
63
64
|
await this.mountWhenLoaded(generation);
|
|
64
65
|
}
|
|
@@ -103,14 +104,20 @@ const StripePaymentElement = class {
|
|
|
103
104
|
options.stripeAccount = this.stripeService.state.stripeAccount;
|
|
104
105
|
const hasOptionValue = Object.values(options).filter(value => value != null && value !== '').length > 0;
|
|
105
106
|
if (this.hasCheckoutSessionClientSecret()) {
|
|
106
|
-
this.initStripeWithCheckoutSession(publishableKey, this.checkoutSessionClientSecret, {
|
|
107
|
+
this.initStripeWithCheckoutSession(publishableKey, this.checkoutSessionClientSecret, {
|
|
108
|
+
stripeAccount: options.stripeAccount,
|
|
109
|
+
defaultValues: this.checkoutSessionDefaultValues,
|
|
110
|
+
});
|
|
107
111
|
return;
|
|
108
112
|
}
|
|
109
113
|
this.initStripe(publishableKey, hasOptionValue ? options : undefined);
|
|
110
114
|
}
|
|
111
115
|
updateStripeAccountId(stripeAccount) {
|
|
112
116
|
if (this.hasCheckoutSessionClientSecret()) {
|
|
113
|
-
this.initStripeWithCheckoutSession(this.stripeService.state.publishableKey, this.checkoutSessionClientSecret, {
|
|
117
|
+
this.initStripeWithCheckoutSession(this.stripeService.state.publishableKey, this.checkoutSessionClientSecret, {
|
|
118
|
+
stripeAccount: stripeAccount,
|
|
119
|
+
defaultValues: this.checkoutSessionDefaultValues,
|
|
120
|
+
});
|
|
114
121
|
return;
|
|
115
122
|
}
|
|
116
123
|
this.initStripe(this.stripeService.state.publishableKey, {
|
|
@@ -138,6 +145,7 @@ const StripePaymentElement = class {
|
|
|
138
145
|
if (this.publishableKey != null && this.publishableKey !== '' && newValue != null && newValue !== '') {
|
|
139
146
|
await this.initStripeWithCheckoutSession(this.publishableKey, newValue, {
|
|
140
147
|
stripeAccount: this.stripeAccount,
|
|
148
|
+
defaultValues: this.checkoutSessionDefaultValues,
|
|
141
149
|
});
|
|
142
150
|
// A new secret starts a fresh payment, so re-enable the submit button after a previous success
|
|
143
151
|
if (this.progress === 'success') {
|
|
@@ -193,6 +201,7 @@ const StripePaymentElement = class {
|
|
|
193
201
|
if (this.checkoutSessionClientSecret != null && this.checkoutSessionClientSecret !== '') {
|
|
194
202
|
this.initStripeWithCheckoutSession(this.stripeService.state.publishableKey, this.checkoutSessionClientSecret, {
|
|
195
203
|
stripeAccount: this.stripeService.state.stripeAccount,
|
|
204
|
+
defaultValues: this.checkoutSessionDefaultValues,
|
|
196
205
|
});
|
|
197
206
|
return;
|
|
198
207
|
}
|
|
@@ -228,11 +237,12 @@ const StripePaymentElement = class {
|
|
|
228
237
|
* @param checkout - The Stripe Checkout instance
|
|
229
238
|
*/
|
|
230
239
|
async checkoutSessionFormSubmitAction(event, checkout) {
|
|
240
|
+
var _a;
|
|
231
241
|
event.preventDefault();
|
|
232
242
|
try {
|
|
233
|
-
//
|
|
234
|
-
|
|
235
|
-
const result = await stripePaymentElement_helpers.confirmCheckoutSession(checkout,
|
|
243
|
+
// returnUrl defaults to the current page; confirmCheckoutSession retries without it when the
|
|
244
|
+
// session was created with `return_url` (which rejects the argument before processing)
|
|
245
|
+
const result = await stripePaymentElement_helpers.confirmCheckoutSession(checkout, (_a = this.checkoutSessionReturnUrl) !== null && _a !== void 0 ? _a : window.location.href, this.checkoutSessionEmail);
|
|
236
246
|
this.checkoutSessionConfirmResultHandler(result);
|
|
237
247
|
}
|
|
238
248
|
catch (e) {
|
|
@@ -349,6 +359,7 @@ const StripePaymentElement = class {
|
|
|
349
359
|
if (this.checkoutSessionClientSecret != null && this.checkoutSessionClientSecret !== '') {
|
|
350
360
|
this.initStripeWithCheckoutSession(this.publishableKey, this.checkoutSessionClientSecret, {
|
|
351
361
|
stripeAccount: this.stripeAccount,
|
|
362
|
+
defaultValues: this.checkoutSessionDefaultValues,
|
|
352
363
|
});
|
|
353
364
|
return;
|
|
354
365
|
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var error = require('./error-FFC4kSs5.js');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Whether a confirm failure means the session was created with `return_url`, which rejects `returnUrl`.
|
|
7
|
+
* Stripe raises this before any payment processing, so retrying without `returnUrl` is safe.
|
|
8
|
+
* `actions.confirm()` reports it both as a thrown `IntegrationError` and as an error result depending on the SDK version.
|
|
9
|
+
* @param error - Error thrown by `actions.confirm()` or the error of its result
|
|
10
|
+
*/
|
|
11
|
+
const isCheckoutReturnUrlConflict = (error) => {
|
|
12
|
+
const message = error instanceof Error ? error.message : error === null || error === void 0 ? void 0 : error.message;
|
|
13
|
+
return typeof message === 'string' && message.includes('cannot provide `returnUrl`');
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Throw when the session can no longer be paid. Stripe documents an `expired` session as "No further processing will occur",
|
|
17
|
+
* and a `complete` one is already paid or being paid, so confirming again cannot succeed.
|
|
18
|
+
* @param status - `session.status` from `getSession()`; undefined when it cannot be read
|
|
19
|
+
* @param message - Message of the confirm error, if any
|
|
20
|
+
* @throws StripeAPIError of type `invalid_request_error` (unrecoverable), with the code `checkout_session_expired` or `checkout_session_complete`
|
|
21
|
+
*/
|
|
22
|
+
const assertCheckoutSessionOpen = (status, message) => {
|
|
23
|
+
if (status == null || status.type === 'open') {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
throw new error.StripeAPIError({
|
|
27
|
+
type: 'invalid_request_error',
|
|
28
|
+
code: `checkout_session_${status.type}`,
|
|
29
|
+
message: message !== null && message !== void 0 ? message : `The Checkout Session is ${status.type} and can no longer be paid.`,
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Confirm a Checkout Session through the checkout actions.
|
|
34
|
+
*
|
|
35
|
+
* Stripe requires exactly one of `returnUrl` (confirm argument) or the session's `return_url`, and the client
|
|
36
|
+
* cannot tell which one a session has (`getSession()` does not expose it). So the first attempt passes
|
|
37
|
+
* `returnUrl`, and when Stripe rejects it because the session already has `return_url`, the confirmation is
|
|
38
|
+
* retried without `returnUrl` (Stripe then redirects to the session's `return_url` automatically).
|
|
39
|
+
*
|
|
40
|
+
* Errors are thrown as `StripeAPIError`:
|
|
41
|
+
* - session `expired` or `complete` (before confirming or after a failed confirm): `invalid_request_error`
|
|
42
|
+
* - `paymentFailed` on an open session (a decline): `card_error`
|
|
43
|
+
* - any other confirm error on an open session, or a failure to load the actions: `api_error`
|
|
44
|
+
* @param checkout - The Checkout instance from `initCheckoutElementsSdk`
|
|
45
|
+
* @param returnUrl - Where Stripe redirects after a redirect-based payment method, when the session has no `return_url`
|
|
46
|
+
* @param email - Customer email; needed when the session was created without `customer_email` or `customer`
|
|
47
|
+
* @returns The confirmation result
|
|
48
|
+
* @throws StripeAPIError when the actions cannot be loaded, the session can no longer be paid, or the confirmation fails
|
|
49
|
+
*/
|
|
50
|
+
const confirmCheckoutActions = async (checkout, returnUrl, email) => {
|
|
51
|
+
const loadActionsResult = await checkout.loadActions();
|
|
52
|
+
if (loadActionsResult.type === 'error') {
|
|
53
|
+
throw new error.StripeAPIError({
|
|
54
|
+
type: 'api_error',
|
|
55
|
+
code: 'checkout_session_error',
|
|
56
|
+
message: loadActionsResult.error.message,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const { actions } = loadActionsResult;
|
|
60
|
+
const sessionStatus = () => { var _a, _b; return (_b = (_a = actions.getSession) === null || _a === void 0 ? void 0 : _a.call(actions)) === null || _b === void 0 ? void 0 : _b.status; };
|
|
61
|
+
assertCheckoutSessionOpen(sessionStatus());
|
|
62
|
+
const confirmWith = (withReturnUrl) => actions.confirm(Object.assign(Object.assign({ redirect: 'if_required' }, (withReturnUrl && returnUrl !== '' ? { returnUrl } : {})), (email != null && email !== '' ? { email } : {})));
|
|
63
|
+
// First attempt with returnUrl; a session created with `return_url` rejects it before processing.
|
|
64
|
+
// The rejection can arrive either as a thrown error or as an error result, so both are retried without it.
|
|
65
|
+
let result;
|
|
66
|
+
try {
|
|
67
|
+
result = await confirmWith(true);
|
|
68
|
+
if (result.type === 'error' && isCheckoutReturnUrlConflict(result.error)) {
|
|
69
|
+
result = await confirmWith(false);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch (e) {
|
|
73
|
+
if (!isCheckoutReturnUrlConflict(e)) {
|
|
74
|
+
throw e;
|
|
75
|
+
}
|
|
76
|
+
result = await confirmWith(false);
|
|
77
|
+
}
|
|
78
|
+
if (result.type === 'error') {
|
|
79
|
+
const { code, message } = result.error;
|
|
80
|
+
assertCheckoutSessionOpen(sessionStatus(), message);
|
|
81
|
+
if (code === 'paymentFailed') {
|
|
82
|
+
throw new error.StripeAPIError({ type: 'card_error', code, message });
|
|
83
|
+
}
|
|
84
|
+
throw new error.StripeAPIError({ type: 'api_error', code: 'checkout_session_error', message });
|
|
85
|
+
}
|
|
86
|
+
return result;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Determine whether the submit button should be disabled.
|
|
91
|
+
* For Checkout Session mode: the checkout is ready once Stripe finished loading.
|
|
92
|
+
* For Payment Intent / Setup Intent mode: an intent client secret must be present.
|
|
93
|
+
* The button stays disabled after a successful payment as well: the intent or
|
|
94
|
+
* checkout is already confirmed and cannot be submitted again.
|
|
95
|
+
* @param params progress / loading state and the current mode information
|
|
96
|
+
* @returns true when the submit button should be disabled
|
|
97
|
+
*/
|
|
98
|
+
const isSubmitButtonDisabled = (params) => {
|
|
99
|
+
const { progress, isCheckoutSession, loadStripeStatus, intentClientSecret } = params;
|
|
100
|
+
const hasValidSecret = isCheckoutSession ? loadStripeStatus === 'success' : intentClientSecret != null && intentClientSecret !== '';
|
|
101
|
+
return progress === 'loading' || progress === 'success' || !hasValidSecret;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Run the default Stripe confirmation flow for Payment Intent / Setup Intent mode.
|
|
105
|
+
* Calls `confirmPayment` or `confirmSetup` depending on the intent type.
|
|
106
|
+
* @param stripe the loaded Stripe.js instance
|
|
107
|
+
* @param elements the Stripe Elements instance bound to the payment element
|
|
108
|
+
* @param intentType the configured intent type
|
|
109
|
+
* @param returnUrl the URL Stripe should redirect back to when required
|
|
110
|
+
* @param extraConfirmParams optional params merged into `confirmParams` (for example `payment_method_data.billing_details`)
|
|
111
|
+
* @returns the confirmation result
|
|
112
|
+
* @throws StripeAPIError when Stripe returns an error
|
|
113
|
+
*/
|
|
114
|
+
const confirmPaymentOrSetup = async (stripe, elements, intentType, returnUrl, extraConfirmParams) => {
|
|
115
|
+
const result = await (() => {
|
|
116
|
+
if (intentType === 'payment') {
|
|
117
|
+
return stripe.confirmPayment({
|
|
118
|
+
elements,
|
|
119
|
+
confirmParams: Object.assign({ return_url: returnUrl }, extraConfirmParams),
|
|
120
|
+
redirect: 'if_required',
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return stripe.confirmSetup({
|
|
124
|
+
elements,
|
|
125
|
+
confirmParams: Object.assign({ return_url: returnUrl }, extraConfirmParams),
|
|
126
|
+
redirect: 'if_required',
|
|
127
|
+
});
|
|
128
|
+
})();
|
|
129
|
+
if (result.error) {
|
|
130
|
+
throw new error.StripeAPIError(result.error);
|
|
131
|
+
}
|
|
132
|
+
return result;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Confirm a Checkout Session payment using the checkout actions.
|
|
136
|
+
*
|
|
137
|
+
* Stripe requires exactly one of `returnUrl` (confirm argument) or the session's `return_url`, and the client
|
|
138
|
+
* cannot tell which one a session has (`getSession()` does not expose it). The shared implementation passes
|
|
139
|
+
* `returnUrl` first and retries without it when Stripe rejects it because the session already has
|
|
140
|
+
* `return_url`. See `confirmCheckoutActions` for the full behavior and error classification.
|
|
141
|
+
* @param checkout the Stripe Checkout instance
|
|
142
|
+
* @param returnUrl URL Stripe should redirect back to when the session has no `return_url`
|
|
143
|
+
* @param email customer email, required when the session was created without `customer_email` or `customer`
|
|
144
|
+
* @returns the confirmation result
|
|
145
|
+
* @throws StripeAPIError when loading actions or confirming fails
|
|
146
|
+
*/
|
|
147
|
+
const confirmCheckoutSession = async (checkout, returnUrl, email) => confirmCheckoutActions(checkout, returnUrl, email);
|
|
148
|
+
/**
|
|
149
|
+
* Resolve the mode-specific properties for a submit event.
|
|
150
|
+
* Picks the Checkout or Elements payload depending on the active mode and
|
|
151
|
+
* reports a descriptive error string when the required instance is missing.
|
|
152
|
+
* @param params the resolved Stripe instances and client secrets for the current mode
|
|
153
|
+
* @returns the submit event props, or an error message when an instance is missing
|
|
154
|
+
*/
|
|
155
|
+
const buildSubmitEventProps = (params) => {
|
|
156
|
+
const { stripe, isCheckoutSession, checkout, checkoutSessionClientSecret, elements, intentClientSecret } = params;
|
|
157
|
+
const props = {
|
|
158
|
+
stripe,
|
|
159
|
+
};
|
|
160
|
+
if (isCheckoutSession) {
|
|
161
|
+
// Checkout Session mode
|
|
162
|
+
if (checkout == null) {
|
|
163
|
+
return { error: 'Checkout not properly initialized' };
|
|
164
|
+
}
|
|
165
|
+
props.checkout = checkout;
|
|
166
|
+
props.checkoutSessionClientSecret = checkoutSessionClientSecret;
|
|
167
|
+
return { props };
|
|
168
|
+
}
|
|
169
|
+
// Payment Intent / Setup Intent mode
|
|
170
|
+
if (elements == null) {
|
|
171
|
+
return { error: 'Elements not properly initialized' };
|
|
172
|
+
}
|
|
173
|
+
props.elements = elements;
|
|
174
|
+
props.intentClientSecret = intentClientSecret;
|
|
175
|
+
return { props };
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
exports.buildSubmitEventProps = buildSubmitEventProps;
|
|
179
|
+
exports.confirmCheckoutActions = confirmCheckoutActions;
|
|
180
|
+
exports.confirmCheckoutSession = confirmCheckoutSession;
|
|
181
|
+
exports.confirmPaymentOrSetup = confirmPaymentOrSetup;
|
|
182
|
+
exports.isSubmitButtonDisabled = isSubmitButtonDisabled;
|