stripe-pwa-elements 4.0.1 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/factory-tenFFIul.js +1200 -0
- package/dist/cjs/{factory-Cd2VI_N2.js → i18n-FhEOc8vz.js} +6 -1149
- package/dist/cjs/ion-icon_2.cjs.entry.js +723 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/stripe-address-element.cjs.entry.js +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-DukP33RI.js +122 -0
- package/dist/cjs/stripe-payment-request-button.cjs.entry.js +2 -2
- package/dist/cjs/stripe-payment-sheet.cjs.entry.js +506 -0
- package/dist/collection/collection-manifest.json +2 -1
- 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 +23 -1
- package/dist/collection/components/stripe-modal/stripe-modal.js +130 -1
- 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 +179 -0
- package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.css +68 -0
- package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.helpers.js +90 -0
- package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.js +544 -0
- package/dist/collection/services/express-checkout-element-manager.js +36 -2
- package/dist/collection/services/stripe-service.js +20 -6
- package/dist/collection/utils/focus.js +76 -0
- package/dist/collection/utils/i18n.js +6 -0
- package/dist/components/factory.js +1 -1
- package/dist/components/i18n.js +1 -0
- package/dist/components/stripe-address-element.js +1 -1
- package/dist/components/stripe-card-element-modal.js +1 -1
- package/dist/components/stripe-card-element2.js +1 -1
- package/dist/components/stripe-currency-selector.js +1 -1
- package/dist/components/stripe-express-checkout-element.js +1 -1
- package/dist/components/stripe-link-authentication-element.js +1 -1
- package/dist/components/stripe-modal2.js +1 -1
- package/dist/components/stripe-payment-element.helpers.js +1 -0
- package/dist/components/stripe-payment-element.js +1 -1
- package/dist/components/stripe-payment-request-button2.js +1 -1
- package/dist/components/stripe-payment-sheet.d.ts +11 -0
- package/dist/components/stripe-payment-sheet.js +1 -0
- package/dist/esm/factory-Cd6OGTWN.js +1198 -0
- package/dist/esm/{factory-VTa1Gc94.js → i18n-B6JoQetF.js} +7 -1149
- package/dist/esm/ion-icon_2.entry.js +720 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/stripe-address-element.entry.js +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-CipV87b8.js +117 -0
- package/dist/esm/stripe-payment-request-button.entry.js +2 -2
- package/dist/esm/stripe-payment-sheet.entry.js +504 -0
- package/dist/stripe-elements/{p-ae0c336e.entry.js → p-4891edf0.entry.js} +1 -1
- package/dist/stripe-elements/p-5338bc5e.entry.js +1 -0
- package/dist/stripe-elements/p-6a9c8b7a.entry.js +1 -0
- package/dist/stripe-elements/p-7fe4a287.entry.js +1 -0
- package/dist/stripe-elements/p-915b86ed.entry.js +1 -0
- package/dist/stripe-elements/p-B6JoQetF.js +1 -0
- package/dist/stripe-elements/p-C7MQk9FK.js +1 -0
- package/dist/stripe-elements/p-DFAhQS0n.js +1 -0
- package/dist/stripe-elements/p-b06a254f.entry.js +1 -0
- package/dist/stripe-elements/p-b91c4fa7.entry.js +1 -0
- package/dist/stripe-elements/p-ba791c8f.entry.js +1 -0
- package/dist/stripe-elements/p-e7372ca7.entry.js +1 -0
- package/dist/stripe-elements/p-f892e375.entry.js +1 -0
- package/dist/stripe-elements/stripe-elements.esm.js +1 -1
- package/dist/types/components/stripe-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-request-button/stripe-payment-request-button.d.ts +1 -1
- package/dist/types/components/stripe-payment-sheet/payment-sheet-state.d.ts +104 -0
- package/dist/types/components/stripe-payment-sheet/stripe-payment-sheet.d.ts +112 -0
- package/dist/types/components/stripe-payment-sheet/stripe-payment-sheet.helpers.d.ts +95 -0
- package/dist/types/components.d.ts +169 -10
- package/dist/types/index.d.ts +2 -0
- package/dist/types/services/interfaces.d.ts +1 -0
- package/dist/types/services/stripe-service.d.ts +7 -2
- package/dist/types/utils/focus.d.ts +15 -0
- package/package.json +5 -3
- package/readme.md +42 -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/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["stripe-card-element-modal",[[0,"stripe-card-element-modal",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"intentType":[1,"intent-type"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"showCloseButton":[4,"show-close-button"],"zip":[4],"open":[4],"getStripeCardElementElement":[64],"present":[64],"updateProgress":[64],"destroy":[64],"setPaymentRequestButton":[64]}]]],["stripe-address-element",[[0,"stripe-address-element",{"mode":[1],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"defaultCountry":[1,"default-country"],"allowedCountries":[16],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getValue":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-currency-selector",[[0,"stripe-currency-selector",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"handleCurrencyChange":[1040],"stripeDidLoaded":[1040],"initStripe":[64],"setErrorMessage":[64],"getSelectedCurrency":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-express-checkout-element",[[0,"stripe-express-checkout-element",{"intentType":[1,"intent-type"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"amount":[2],"currency":[1],"buttonHeight":[1,"button-height"],"shouldUseDefaultConfirmAction":[4,"should-use-default-confirm-action"],"stripeDidLoaded":[1040],"progress":[32],"updateProgress":[64],"setErrorMessage":[64],"initStripe":[64],"updateElementOptions":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-link-authentication-element",[[0,"stripe-link-authentication-element",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"defaultEmail":[1,"default-email"],"handleChange":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getEmail":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-payment-element",[[0,"stripe-payment-element",{"intentType":[1,"intent-type"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"intentClientSecret":[1,"intent-client-secret"],"checkoutSessionClientSecret":[1,"checkout-session-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"initStripeWithCheckoutSession":[64],"updateProgress":[64],"setErrorMessage":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}],"intentClientSecret":[{"updateIntentClientSecret":0}],"checkoutSessionClientSecret":[{"updateCheckoutSessionClientSecret":0}]}]]],["
|
|
8
|
+
return bootstrapLazy([["stripe-card-element-modal",[[0,"stripe-card-element-modal",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"intentType":[1,"intent-type"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"showCloseButton":[4,"show-close-button"],"zip":[4],"open":[4],"getStripeCardElementElement":[64],"present":[64],"updateProgress":[64],"destroy":[64],"setPaymentRequestButton":[64]}]]],["stripe-payment-sheet",[[0,"stripe-payment-sheet",{"publishableKey":[1,"publishable-key"],"intentClientSecret":[1,"intent-client-secret"],"stripeAccount":[1,"stripe-account"],"open":[1540],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"applicationName":[1,"application-name"],"options":[16],"sheet":[32],"visible":[32],"errorMessage":[32],"present":[64]},null,{"publishableKey":[{"handleSecretChange":0}],"intentClientSecret":[{"handleSecretChange":0}],"stripeAccount":[{"handleSecretChange":0}],"open":[{"handleOpenChange":0}]}]]],["stripe-address-element",[[0,"stripe-address-element",{"mode":[1],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"defaultCountry":[1,"default-country"],"allowedCountries":[16],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getValue":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-currency-selector",[[0,"stripe-currency-selector",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"handleCurrencyChange":[1040],"stripeDidLoaded":[1040],"initStripe":[64],"setErrorMessage":[64],"getSelectedCurrency":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-express-checkout-element",[[0,"stripe-express-checkout-element",{"intentType":[1,"intent-type"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"amount":[2],"currency":[1],"buttonHeight":[1,"button-height"],"shouldUseDefaultConfirmAction":[4,"should-use-default-confirm-action"],"stripeDidLoaded":[1040],"progress":[32],"updateProgress":[64],"setErrorMessage":[64],"initStripe":[64],"updateElementOptions":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-link-authentication-element",[[0,"stripe-link-authentication-element",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"defaultEmail":[1,"default-email"],"handleChange":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getEmail":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-payment-element",[[0,"stripe-payment-element",{"intentType":[1,"intent-type"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"intentClientSecret":[1,"intent-client-secret"],"checkoutSessionClientSecret":[1,"checkout-session-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"initStripeWithCheckoutSession":[64],"updateProgress":[64],"setErrorMessage":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}],"intentClientSecret":[{"updateIntentClientSecret":0}],"checkoutSessionClientSecret":[{"updateCheckoutSessionClientSecret":0}]}]]],["stripe-payment-request-button",[[260,"stripe-payment-request-button",{"paymentMethodEventHandler":[16],"shippingOptionEventHandler":[16],"shippingAddressEventHandler":[16],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"stripeDidLoaded":[1040],"loadStripeStatus":[32],"stripe":[32],"paymentRequestOption":[32],"isAvailable":[64],"setPaymentMethodEventHandler":[64],"setPaymentRequestShippingOptionEventHandler":[64],"setPaymentRequestShippingAddressEventHandler":[64],"setPaymentRequestOption":[64],"initStripe":[64]}]]],["stripe-card-element",[[0,"stripe-card-element",{"intentType":[1,"intent-type"],"zip":[4],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"showPaymentRequestButton":[4,"show-payment-request-button"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"zipCode":[32],"paymentRequestOption":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"setPaymentRequestOption":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["ion-icon_2",[[257,"stripe-modal",{"showCloseButton":[4,"show-close-button"],"open":[1028],"renderedOpen":[32],"toggleModal":[64],"openModal":[64],"closeModal":[64]},null,{"open":[{"onOpenChange":0}]}],[1,"ion-icon",{"mode":[1025],"color":[1],"ios":[1],"md":[1],"flipRtl":[4,"flip-rtl"],"name":[513],"src":[1],"icon":[8],"size":[1],"lazy":[4],"sanitize":[4],"svgContent":[32],"isVisible":[32]},null,{"name":[{"loadIcon":0}],"src":[{"loadIcon":0}],"icon":[{"loadIcon":0}],"ios":[{"loadIcon":0}],"md":[{"loadIcon":0}]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, a as createEvent, h, g as getElement } from './index-C6bbmyga.js';
|
|
2
|
-
import {
|
|
2
|
+
import { c as checkPlatform, i as i18n } from './i18n-B6JoQetF.js';
|
|
3
|
+
import { s as serviceFactory } from './factory-Cd6OGTWN.js';
|
|
3
4
|
import './index-CBXaOfXU.js';
|
|
4
5
|
|
|
5
6
|
const stripeAddressElementCss = () => `:root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-input-border-shadow:rgba(228, 228, 230, 0.6);--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}.stripe-payment-sheet-wrap{box-sizing:border-box}.stripe-payment-sheet-wrap *:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:"Roboto", sans-serif;box-sizing:border-box}.stripe-payment-sheet-wrap button{cursor:pointer}.stripe-payment-sheet-wrap{display:block;width:100%;background:#fff;padding:32px 16px}.stripe-payment-sheet-wrap #address-element{margin-top:16px}.stripe-payment-sheet-wrap .stripe-heading{font-size:24px;font-weight:bold;color:var(--color-heading-text);margin-bottom:24px}.stripe-payment-sheet-wrap .stripe-section-title{font-size:14px;font-weight:bold;color:var(--color-label);margin-bottom:8px}.stripe-payment-sheet-wrap .payment-info.address{margin-bottom:16px}.stripe-payment-sheet-wrap .stripe-element-errors{margin-top:8px;font-size:14px;color:var(--color-text-error)}.stripe-payment-sheet-wrap .submit-button-wrapper{margin-top:32px}.stripe-payment-sheet-wrap button{display:block;color:var(--color-button-text);background-color:var(--color-primary);width:100%;text-align:center;padding:16px 16px;font-size:18px;border-radius:6px;min-height:42px}.stripe-payment-sheet-wrap button:disabled{color:var(--color-button-text-disabled)}`;
|
|
@@ -11,7 +11,8 @@ const StripeCardElementModal = class {
|
|
|
11
11
|
*/
|
|
12
12
|
this.showLabel = false;
|
|
13
13
|
/**
|
|
14
|
-
* The component will
|
|
14
|
+
* The component will confirm the intent for you: `stripe.confirmCardPayment` when `intentType` is `'payment'`,
|
|
15
|
+
* `stripe.confirmCardSetup` when it is `'setup'`.
|
|
15
16
|
* If you want to customize the behavior, should set false.
|
|
16
17
|
* And listen the 'formSubmit' event on the element
|
|
17
18
|
*/
|
|
@@ -99,7 +100,7 @@ const StripeCardElementModal = class {
|
|
|
99
100
|
cardElement.setPaymentRequestOption(options);
|
|
100
101
|
}
|
|
101
102
|
render() {
|
|
102
|
-
return (h("stripe-modal", { key: '
|
|
103
|
+
return (h("stripe-modal", { key: '4904f57b562da9ce4fc348fb376f931cac707540', open: this.open, showCloseButton: this.showCloseButton }, h("stripe-card-element", { key: '8707fa6e32ca82b700f53fc2a257b8af1cc7b45c', showLabel: this.showLabel, publishableKey: this.publishableKey, intentClientSecret: this.intentClientSecret, shouldUseDefaultFormSubmitAction: this.shouldUseDefaultFormSubmitAction, handleSubmit: this.handleSubmit, stripeDidLoaded: this.stripeDidLoaded, intentType: this.intentType, zip: this.zip, buttonLabel: this.buttonLabel, sheetTitle: this.sheetTitle, applicationName: this.applicationName })));
|
|
103
104
|
}
|
|
104
105
|
get el() { return getElement(this); }
|
|
105
106
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, a as createEvent, h, g as getElement
|
|
2
|
-
import {
|
|
1
|
+
import { r as registerInstance, a as createEvent, h, g as getElement } from './index-C6bbmyga.js';
|
|
2
|
+
import { c as checkPlatform, i as i18n } from './i18n-B6JoQetF.js';
|
|
3
|
+
import { s as serviceFactory } from './factory-Cd6OGTWN.js';
|
|
3
4
|
import { S as StripeAPIError } from './error-XRfh5Wrs.js';
|
|
4
5
|
import './index-CBXaOfXU.js';
|
|
5
6
|
|
|
@@ -291,7 +292,8 @@ const StripeCardElement = class {
|
|
|
291
292
|
*/
|
|
292
293
|
this.showLabel = false;
|
|
293
294
|
/**
|
|
294
|
-
* The component will
|
|
295
|
+
* The component will confirm the intent for you: `stripe.confirmCardPayment` when `intentType` is `'payment'`,
|
|
296
|
+
* `stripe.confirmCardSetup` when it is `'setup'`.
|
|
295
297
|
* If you want to customize the behavior, should set false.
|
|
296
298
|
* And listen the 'formSubmit' event on the element
|
|
297
299
|
*/
|
|
@@ -435,90 +437,4 @@ const StripeCardElement = class {
|
|
|
435
437
|
};
|
|
436
438
|
StripeCardElement.style = stripeCardElementCss();
|
|
437
439
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
const StripeModal = class {
|
|
441
|
-
constructor(hostRef) {
|
|
442
|
-
registerInstance(this, hostRef);
|
|
443
|
-
this.close = createEvent(this, "close", 7);
|
|
444
|
-
/**
|
|
445
|
-
* If true, the modal display close button
|
|
446
|
-
*/
|
|
447
|
-
this.showCloseButton = true;
|
|
448
|
-
/**
|
|
449
|
-
* Modal state.
|
|
450
|
-
* If true, the modal will open
|
|
451
|
-
*/
|
|
452
|
-
this.open = false;
|
|
453
|
-
/**
|
|
454
|
-
* Effect `this.open`. This is for animation.
|
|
455
|
-
* Ionic Ref: https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/accordion/accordion.tsx#L83
|
|
456
|
-
*/
|
|
457
|
-
this.renderedOpen = false;
|
|
458
|
-
}
|
|
459
|
-
onOpenChange(open) {
|
|
460
|
-
if (open) {
|
|
461
|
-
this.openModalAnimation();
|
|
462
|
-
}
|
|
463
|
-
else {
|
|
464
|
-
this.renderedOpen = false;
|
|
465
|
-
this.close.emit();
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
/**
|
|
469
|
-
* Toggle modal state
|
|
470
|
-
*/
|
|
471
|
-
async toggleModal() {
|
|
472
|
-
this.open ? await this.closeModal() : await this.openModal();
|
|
473
|
-
}
|
|
474
|
-
/**
|
|
475
|
-
* Open the modal
|
|
476
|
-
*/
|
|
477
|
-
async openModal() {
|
|
478
|
-
this.open = true;
|
|
479
|
-
}
|
|
480
|
-
/**
|
|
481
|
-
* Close the modal
|
|
482
|
-
*/
|
|
483
|
-
async closeModal() {
|
|
484
|
-
this.open = false;
|
|
485
|
-
}
|
|
486
|
-
componentDidLoad() {
|
|
487
|
-
const platformName = checkPlatform();
|
|
488
|
-
if (platformName) {
|
|
489
|
-
this.el.classList.add(platformName);
|
|
490
|
-
}
|
|
491
|
-
if (this.open) {
|
|
492
|
-
this.openModalAnimation();
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
openModalAnimation() {
|
|
496
|
-
if (!this.el.shadowRoot) {
|
|
497
|
-
this.renderedOpen = true;
|
|
498
|
-
return;
|
|
499
|
-
}
|
|
500
|
-
const modalChild = this.el.shadowRoot.querySelector('.modal-child');
|
|
501
|
-
modalChild.classList.add('loading');
|
|
502
|
-
modalChild.style.willChange = 'transform';
|
|
503
|
-
modalChild.addEventListener('transitionend', () => {
|
|
504
|
-
modalChild.style.willChange = 'auto';
|
|
505
|
-
modalChild.classList.remove('loading');
|
|
506
|
-
}, { once: true });
|
|
507
|
-
requestAnimationFrame(() => {
|
|
508
|
-
this.renderedOpen = this.open;
|
|
509
|
-
});
|
|
510
|
-
}
|
|
511
|
-
render() {
|
|
512
|
-
const { renderedOpen, showCloseButton } = this;
|
|
513
|
-
return (h(Host, { key: '38fb86acf7cf5887a426c67b1a1271f7fae7048c' }, h("div", { key: 'f751d92c327ee2e564edfcd4d18f4dca43c20c37', class: `modal-row${renderedOpen ? ' open' : ''}`, onClick: () => this.closeModal() }, h("div", { key: '11519ccd44a5069df3247c530a2c1e114eab7aef', class: "modal-child", onClick: e => e.stopPropagation() }, showCloseButton ? (h("div", { class: "modal-close-button-wrap" }, h("ion-icon", { name: "close", size: "large", class: "modal-close-button", onClick: () => this.closeModal() }))) : null, h("div", { key: 'a41f7f263b488b5bbc2a999cbabf6b9e407bca85', class: "modal-loading" }, h("svg", { key: '0b3b25cb2812bc4d837fb4b7e6af4a5f42f0247e', version: "1.1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 2400 2400" }, h("g", { key: '10a9f9ec59699e6d2988b9c65cd02da1754fd760', "stroke-width": "200", "stroke-linecap": "round", stroke: "currentColor", fill: "none", id: "spinner" }, h("line", { key: 'ed271fa584b930ceed5397c271b31e0d48c72f72', x1: "1200", y1: "600", x2: "1200", y2: "100" }), h("line", { key: '3cf855a84f3ab58b914b7aeb784fbc5b95d8ae94', opacity: "0.5", x1: "1200", y1: "2300", x2: "1200", y2: "1800" }), h("line", { key: '2cce4b62a276399235509e94f47a63acf9c69a0f', opacity: "0.917", x1: "900", y1: "680.4", x2: "650", y2: "247.4" }), h("line", { key: '64c175ef068591417b043f7630a44d34eae7cb59', opacity: "0.417", x1: "1750", y1: "2152.6", x2: "1500", y2: "1719.6" }), h("line", { key: '0856a654e3aa756dfb1e9fc316b8b379fa9d5a4e', opacity: "0.833", x1: "680.4", y1: "900", x2: "247.4", y2: "650" }), h("line", { key: 'c60f1f8495df9b8cdcc8941255d08c01a0e1c02f', opacity: "0.333", x1: "2152.6", y1: "1750", x2: "1719.6", y2: "1500" }), h("line", { key: '204bc2a7765e43b86f91c3fb9b1e72a3a39bb323', opacity: "0.75", x1: "600", y1: "1200", x2: "100", y2: "1200" }), h("line", { key: '7584b272f9efd7f746c1bcc5c8a5576098b02381', opacity: "0.25", x1: "2300", y1: "1200", x2: "1800", y2: "1200" }), h("line", { key: '7a053e9eb5f0da3fbf6fb7c9680bf73073bb126d', opacity: "0.667", x1: "680.4", y1: "1500", x2: "247.4", y2: "1750" }), h("line", { key: 'f8b817095143d739589e45c99b03c7afbdfc8293', opacity: "0.167", x1: "2152.6", y1: "650", x2: "1719.6", y2: "900" }), h("line", { key: 'aae0e36dbdfff44196f9758c8a5ed2337139ebe0', opacity: "0.583", x1: "900", y1: "1719.6", x2: "650", y2: "2152.6" }), h("line", { key: '3a257b30cb289f29ba386ccca7519bcdc22c3786', opacity: "0.083", x1: "1750", y1: "247.4", x2: "1500", y2: "680.4" }), 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" })))), h("div", { key: 'da5ef8031e5b826d854a065d8172389cdd84fbf0', class: "modal-content" }, h("slot", { key: 'fbe97a3a4d5489de5ae6f49342c58d537b317842' }))))));
|
|
514
|
-
}
|
|
515
|
-
get el() { return getElement(this); }
|
|
516
|
-
static get watchers() { return {
|
|
517
|
-
"open": [{
|
|
518
|
-
"onOpenChange": 0
|
|
519
|
-
}]
|
|
520
|
-
}; }
|
|
521
|
-
};
|
|
522
|
-
StripeModal.style = stripeModalCss();
|
|
523
|
-
|
|
524
|
-
export { StripeCardElement as stripe_card_element, StripeModal as stripe_modal };
|
|
440
|
+
export { StripeCardElement as stripe_card_element };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, a as createEvent, h, g as getElement } from './index-C6bbmyga.js';
|
|
2
|
-
import {
|
|
2
|
+
import { c as checkPlatform, i as i18n } from './i18n-B6JoQetF.js';
|
|
3
|
+
import { s as serviceFactory } from './factory-Cd6OGTWN.js';
|
|
3
4
|
import './index-CBXaOfXU.js';
|
|
4
5
|
|
|
5
6
|
const stripeCurrencySelectorCss = () => `:root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-input-border-shadow:rgba(228, 228, 230, 0.6);--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}:host{box-sizing:border-box}:host *:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:"Roboto", sans-serif;box-sizing:border-box}:host button{cursor:pointer}:host{display:block;width:100%}.stripe-currency-selector-wrap{width:100%;padding:0;margin:0}.stripe-currency-selector-wrap #currency-selector{width:100%;min-height:40px}.stripe-currency-selector-wrap #currency-selector-errors{margin-top:8px}`;
|
|
@@ -44,5 +44,5 @@ var patchCloneNodeFix = (HTMLElementPrototype) => {
|
|
|
44
44
|
|
|
45
45
|
patchBrowser().then(async (options) => {
|
|
46
46
|
await globalScripts();
|
|
47
|
-
return bootstrapLazy([["stripe-card-element-modal",[[0,"stripe-card-element-modal",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"intentType":[1,"intent-type"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"showCloseButton":[4,"show-close-button"],"zip":[4],"open":[4],"getStripeCardElementElement":[64],"present":[64],"updateProgress":[64],"destroy":[64],"setPaymentRequestButton":[64]}]]],["stripe-address-element",[[0,"stripe-address-element",{"mode":[1],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"defaultCountry":[1,"default-country"],"allowedCountries":[16],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getValue":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-currency-selector",[[0,"stripe-currency-selector",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"handleCurrencyChange":[1040],"stripeDidLoaded":[1040],"initStripe":[64],"setErrorMessage":[64],"getSelectedCurrency":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-express-checkout-element",[[0,"stripe-express-checkout-element",{"intentType":[1,"intent-type"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"amount":[2],"currency":[1],"buttonHeight":[1,"button-height"],"shouldUseDefaultConfirmAction":[4,"should-use-default-confirm-action"],"stripeDidLoaded":[1040],"progress":[32],"updateProgress":[64],"setErrorMessage":[64],"initStripe":[64],"updateElementOptions":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-link-authentication-element",[[0,"stripe-link-authentication-element",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"defaultEmail":[1,"default-email"],"handleChange":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getEmail":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-payment-element",[[0,"stripe-payment-element",{"intentType":[1,"intent-type"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"intentClientSecret":[1,"intent-client-secret"],"checkoutSessionClientSecret":[1,"checkout-session-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"initStripeWithCheckoutSession":[64],"updateProgress":[64],"setErrorMessage":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}],"intentClientSecret":[{"updateIntentClientSecret":0}],"checkoutSessionClientSecret":[{"updateCheckoutSessionClientSecret":0}]}]]],["
|
|
47
|
+
return bootstrapLazy([["stripe-card-element-modal",[[0,"stripe-card-element-modal",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"intentType":[1,"intent-type"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"showCloseButton":[4,"show-close-button"],"zip":[4],"open":[4],"getStripeCardElementElement":[64],"present":[64],"updateProgress":[64],"destroy":[64],"setPaymentRequestButton":[64]}]]],["stripe-payment-sheet",[[0,"stripe-payment-sheet",{"publishableKey":[1,"publishable-key"],"intentClientSecret":[1,"intent-client-secret"],"stripeAccount":[1,"stripe-account"],"open":[1540],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"applicationName":[1,"application-name"],"options":[16],"sheet":[32],"visible":[32],"errorMessage":[32],"present":[64]},null,{"publishableKey":[{"handleSecretChange":0}],"intentClientSecret":[{"handleSecretChange":0}],"stripeAccount":[{"handleSecretChange":0}],"open":[{"handleOpenChange":0}]}]]],["stripe-address-element",[[0,"stripe-address-element",{"mode":[1],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"defaultCountry":[1,"default-country"],"allowedCountries":[16],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getValue":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-currency-selector",[[0,"stripe-currency-selector",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"handleCurrencyChange":[1040],"stripeDidLoaded":[1040],"initStripe":[64],"setErrorMessage":[64],"getSelectedCurrency":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-express-checkout-element",[[0,"stripe-express-checkout-element",{"intentType":[1,"intent-type"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"clientSecret":[1,"client-secret"],"amount":[2],"currency":[1],"buttonHeight":[1,"button-height"],"shouldUseDefaultConfirmAction":[4,"should-use-default-confirm-action"],"stripeDidLoaded":[1040],"progress":[32],"updateProgress":[64],"setErrorMessage":[64],"initStripe":[64],"updateElementOptions":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-link-authentication-element",[[0,"stripe-link-authentication-element",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"defaultEmail":[1,"default-email"],"handleChange":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"getEmail":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["stripe-payment-element",[[0,"stripe-payment-element",{"intentType":[1,"intent-type"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"intentClientSecret":[1,"intent-client-secret"],"checkoutSessionClientSecret":[1,"checkout-session-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"initStripe":[64],"initStripeWithCheckoutSession":[64],"updateProgress":[64],"setErrorMessage":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}],"intentClientSecret":[{"updateIntentClientSecret":0}],"checkoutSessionClientSecret":[{"updateCheckoutSessionClientSecret":0}]}]]],["stripe-payment-request-button",[[260,"stripe-payment-request-button",{"paymentMethodEventHandler":[16],"shippingOptionEventHandler":[16],"shippingAddressEventHandler":[16],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"stripeDidLoaded":[1040],"loadStripeStatus":[32],"stripe":[32],"paymentRequestOption":[32],"isAvailable":[64],"setPaymentMethodEventHandler":[64],"setPaymentRequestShippingOptionEventHandler":[64],"setPaymentRequestShippingAddressEventHandler":[64],"setPaymentRequestOption":[64],"initStripe":[64]}]]],["stripe-card-element",[[0,"stripe-card-element",{"intentType":[1,"intent-type"],"zip":[4],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"showPaymentRequestButton":[4,"show-payment-request-button"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"progress":[32],"zipCode":[32],"paymentRequestOption":[32],"initStripe":[64],"updateProgress":[64],"setErrorMessage":[64],"setPaymentRequestOption":[64]},null,{"publishableKey":[{"updatePublishableKey":0}],"stripeAccount":[{"updateStripeAccountId":0}]}]]],["ion-icon_2",[[257,"stripe-modal",{"showCloseButton":[4,"show-close-button"],"open":[1028],"renderedOpen":[32],"toggleModal":[64],"openModal":[64],"closeModal":[64]},null,{"open":[{"onOpenChange":0}]}],[1,"ion-icon",{"mode":[1025],"color":[1],"ios":[1],"md":[1],"flipRtl":[4,"flip-rtl"],"name":[513],"src":[1],"icon":[8],"size":[1],"lazy":[4],"sanitize":[4],"svgContent":[32],"isVisible":[32]},null,{"name":[{"loadIcon":0}],"src":[{"loadIcon":0}],"icon":[{"loadIcon":0}],"ios":[{"loadIcon":0}],"md":[{"loadIcon":0}]}]]]], options);
|
|
48
48
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, a as createEvent, h, g as getElement } from './index-C6bbmyga.js';
|
|
2
|
-
import {
|
|
2
|
+
import { c as checkPlatform, i as i18n } from './i18n-B6JoQetF.js';
|
|
3
|
+
import { s as serviceFactory } from './factory-Cd6OGTWN.js';
|
|
3
4
|
import { S as StripeAPIError } from './error-XRfh5Wrs.js';
|
|
4
5
|
import './index-CBXaOfXU.js';
|
|
5
6
|
|
|
@@ -71,6 +72,8 @@ const StripeExpressCheckoutElement = class {
|
|
|
71
72
|
await this.stripeService.initialize(publishableKey, {
|
|
72
73
|
stripeAccount: options === null || options === void 0 ? void 0 : options.stripeAccount,
|
|
73
74
|
applicationName: this.applicationName,
|
|
75
|
+
clientSecret: this.clientSecret,
|
|
76
|
+
elementsOptions: this.buildElementsOptions(),
|
|
74
77
|
});
|
|
75
78
|
// If already successfully loaded, initialize elements immediately
|
|
76
79
|
if (this.stripeService.state.loadStripeStatus === 'success') {
|
|
@@ -89,6 +92,22 @@ const StripeExpressCheckoutElement = class {
|
|
|
89
92
|
});
|
|
90
93
|
}
|
|
91
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Options for `stripe.elements()` when there is no client secret.
|
|
97
|
+
* Stripe.js reads mode / amount / currency from the Elements group, not from the element itself.
|
|
98
|
+
*/
|
|
99
|
+
buildElementsOptions() {
|
|
100
|
+
if (this.currency == null || this.currency === '') {
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
if (this.intentType === 'setup') {
|
|
104
|
+
return { mode: 'setup', currency: this.currency };
|
|
105
|
+
}
|
|
106
|
+
if (this.amount === undefined) {
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
return { mode: 'payment', amount: this.amount, currency: this.currency };
|
|
110
|
+
}
|
|
92
111
|
/**
|
|
93
112
|
* Update element options dynamically
|
|
94
113
|
* @param options - Partial options to update
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, a as createEvent, h, g as getElement } from './index-C6bbmyga.js';
|
|
2
|
-
import {
|
|
2
|
+
import { c as checkPlatform, i as i18n } from './i18n-B6JoQetF.js';
|
|
3
|
+
import { s as serviceFactory } from './factory-Cd6OGTWN.js';
|
|
3
4
|
import './index-CBXaOfXU.js';
|
|
4
5
|
|
|
5
6
|
const stripeLinkAuthenticationElementCss = () => `:root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-input-border-shadow:rgba(228, 228, 230, 0.6);--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}.stripe-link-authentication-wrap{box-sizing:border-box}.stripe-link-authentication-wrap *:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:"Roboto", sans-serif;box-sizing:border-box}.stripe-link-authentication-wrap button{cursor:pointer}.stripe-link-authentication-wrap{display:block;width:100%;background:#fff;padding:16px}.stripe-link-authentication-wrap .stripe-link-authentication-container #link-authentication-element .StripeElement{padding:8px 16px;min-height:64px;border-radius:6px;display:flex;justify-content:center;align-items:center}.stripe-link-authentication-wrap .stripe-link-authentication-container #link-authentication-element .StripeElement>.__PrivateStripeElement{width:100%}.stripe-link-authentication-wrap .stripe-link-authentication-container .stripe-element-errors{margin-top:8px;font-size:14px;color:var(--color-text-error)}`;
|
|
@@ -1,121 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, a as createEvent, h, g as getElement } from './index-C6bbmyga.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { c as checkPlatform, i as i18n } from './i18n-B6JoQetF.js';
|
|
3
|
+
import { s as serviceFactory } from './factory-Cd6OGTWN.js';
|
|
4
|
+
import { b as buildSubmitEventProps, c as confirmPaymentOrSetup, a as confirmCheckoutSession, i as isSubmitButtonDisabled } from './stripe-payment-element.helpers-CipV87b8.js';
|
|
4
5
|
import './index-CBXaOfXU.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Determine whether the submit button should be disabled.
|
|
8
|
-
* For Checkout Session mode: the checkout is ready once Stripe finished loading.
|
|
9
|
-
* For Payment Intent / Setup Intent mode: an intent client secret must be present.
|
|
10
|
-
* @param params progress / loading state and the current mode information
|
|
11
|
-
* @returns true when the submit button should be disabled
|
|
12
|
-
*/
|
|
13
|
-
const isSubmitButtonDisabled = (params) => {
|
|
14
|
-
const { progress, isCheckoutSession, loadStripeStatus, intentClientSecret } = params;
|
|
15
|
-
const hasValidSecret = isCheckoutSession ? loadStripeStatus === 'success' : intentClientSecret != null && intentClientSecret !== '';
|
|
16
|
-
return progress === 'loading' || !hasValidSecret;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Run the default Stripe confirmation flow for Payment Intent / Setup Intent mode.
|
|
20
|
-
* Calls `confirmPayment` or `confirmSetup` depending on the intent type.
|
|
21
|
-
* @param stripe the loaded Stripe.js instance
|
|
22
|
-
* @param elements the Stripe Elements instance bound to the payment element
|
|
23
|
-
* @param intentType the configured intent type
|
|
24
|
-
* @param returnUrl the URL Stripe should redirect back to when required
|
|
25
|
-
* @returns the confirmation result
|
|
26
|
-
* @throws StripeAPIError when Stripe returns an error
|
|
27
|
-
*/
|
|
28
|
-
const confirmPaymentOrSetup = async (stripe, elements, intentType, returnUrl) => {
|
|
29
|
-
const result = await (() => {
|
|
30
|
-
if (intentType === 'payment') {
|
|
31
|
-
return stripe.confirmPayment({
|
|
32
|
-
elements,
|
|
33
|
-
confirmParams: {
|
|
34
|
-
return_url: returnUrl,
|
|
35
|
-
},
|
|
36
|
-
redirect: 'if_required',
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
return stripe.confirmSetup({
|
|
40
|
-
elements,
|
|
41
|
-
confirmParams: {
|
|
42
|
-
return_url: returnUrl,
|
|
43
|
-
},
|
|
44
|
-
redirect: 'if_required',
|
|
45
|
-
});
|
|
46
|
-
})();
|
|
47
|
-
if (result.error) {
|
|
48
|
-
throw new StripeAPIError(result.error);
|
|
49
|
-
}
|
|
50
|
-
return result;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Confirm a Checkout Session payment using the checkout actions.
|
|
54
|
-
* @param checkout the Stripe Checkout instance
|
|
55
|
-
* @param returnUrl the URL Stripe should redirect back to when required
|
|
56
|
-
* @returns the confirmation result
|
|
57
|
-
* @throws StripeAPIError when loading actions or confirming fails
|
|
58
|
-
*/
|
|
59
|
-
const confirmCheckoutSession = async (checkout, returnUrl) => {
|
|
60
|
-
var _a;
|
|
61
|
-
// Load actions from the checkout session
|
|
62
|
-
const loadActionsResult = await checkout.loadActions();
|
|
63
|
-
if (loadActionsResult.type === 'error') {
|
|
64
|
-
// Create a StripeError-compatible object from the Checkout Session error
|
|
65
|
-
const stripeError = {
|
|
66
|
-
type: 'api_error',
|
|
67
|
-
code: loadActionsResult.error.code || 'checkout_session_error',
|
|
68
|
-
message: loadActionsResult.error.message,
|
|
69
|
-
};
|
|
70
|
-
throw new StripeAPIError(stripeError);
|
|
71
|
-
}
|
|
72
|
-
const { actions } = loadActionsResult;
|
|
73
|
-
// Confirm the payment using checkout session actions
|
|
74
|
-
const result = await actions.confirm({
|
|
75
|
-
returnUrl,
|
|
76
|
-
redirect: 'if_required',
|
|
77
|
-
});
|
|
78
|
-
if (result.type === 'error') {
|
|
79
|
-
// Create a StripeError-compatible object from the confirm error
|
|
80
|
-
const stripeError = {
|
|
81
|
-
type: 'card_error',
|
|
82
|
-
code: result.error.code || 'payment_failed',
|
|
83
|
-
message: result.error.message,
|
|
84
|
-
decline_code: result.error.code === 'paymentFailed' ? (_a = result.error.paymentFailed) === null || _a === void 0 ? void 0 : _a.declineCode : undefined,
|
|
85
|
-
};
|
|
86
|
-
throw new StripeAPIError(stripeError);
|
|
87
|
-
}
|
|
88
|
-
return result;
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* Resolve the mode-specific properties for a submit event.
|
|
92
|
-
* Picks the Checkout or Elements payload depending on the active mode and
|
|
93
|
-
* reports a descriptive error string when the required instance is missing.
|
|
94
|
-
* @param params the resolved Stripe instances and client secrets for the current mode
|
|
95
|
-
* @returns the submit event props, or an error message when an instance is missing
|
|
96
|
-
*/
|
|
97
|
-
const buildSubmitEventProps = (params) => {
|
|
98
|
-
const { stripe, isCheckoutSession, checkout, checkoutSessionClientSecret, elements, intentClientSecret } = params;
|
|
99
|
-
const props = {
|
|
100
|
-
stripe,
|
|
101
|
-
};
|
|
102
|
-
if (isCheckoutSession) {
|
|
103
|
-
// Checkout Session mode
|
|
104
|
-
if (checkout == null) {
|
|
105
|
-
return { error: 'Checkout not properly initialized' };
|
|
106
|
-
}
|
|
107
|
-
props.checkout = checkout;
|
|
108
|
-
props.checkoutSessionClientSecret = checkoutSessionClientSecret;
|
|
109
|
-
return { props };
|
|
110
|
-
}
|
|
111
|
-
// Payment Intent / Setup Intent mode
|
|
112
|
-
if (elements == null) {
|
|
113
|
-
return { error: 'Elements not properly initialized' };
|
|
114
|
-
}
|
|
115
|
-
props.elements = elements;
|
|
116
|
-
props.intentClientSecret = intentClientSecret;
|
|
117
|
-
return { props };
|
|
118
|
-
};
|
|
6
|
+
import './error-XRfh5Wrs.js';
|
|
119
7
|
|
|
120
8
|
const stripePaymentElementCss = () => `: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 .StripeElement{padding:8px 16px;min-height:64px;border-radius:6px;display:flex;justify-content:center;align-items:center}.stripe-payment-sheet-wrap .StripeElement>.__PrivateStripeElement{width:100%}.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{margin-top:8px}.stripe-payment-sheet-wrap .stripe-element-errors{margin-top:8px;font-size:14px;color:var(--color-text-error)}.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)}`;
|
|
121
9
|
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { S as StripeAPIError } from './error-XRfh5Wrs.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Determine whether the submit button should be disabled.
|
|
5
|
+
* For Checkout Session mode: the checkout is ready once Stripe finished loading.
|
|
6
|
+
* For Payment Intent / Setup Intent mode: an intent client secret must be present.
|
|
7
|
+
* @param params progress / loading state and the current mode information
|
|
8
|
+
* @returns true when the submit button should be disabled
|
|
9
|
+
*/
|
|
10
|
+
const isSubmitButtonDisabled = (params) => {
|
|
11
|
+
const { progress, isCheckoutSession, loadStripeStatus, intentClientSecret } = params;
|
|
12
|
+
const hasValidSecret = isCheckoutSession ? loadStripeStatus === 'success' : intentClientSecret != null && intentClientSecret !== '';
|
|
13
|
+
return progress === 'loading' || !hasValidSecret;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Run the default Stripe confirmation flow for Payment Intent / Setup Intent mode.
|
|
17
|
+
* Calls `confirmPayment` or `confirmSetup` depending on the intent type.
|
|
18
|
+
* @param stripe the loaded Stripe.js instance
|
|
19
|
+
* @param elements the Stripe Elements instance bound to the payment element
|
|
20
|
+
* @param intentType the configured intent type
|
|
21
|
+
* @param returnUrl the URL Stripe should redirect back to when required
|
|
22
|
+
* @returns the confirmation result
|
|
23
|
+
* @throws StripeAPIError when Stripe returns an error
|
|
24
|
+
*/
|
|
25
|
+
const confirmPaymentOrSetup = async (stripe, elements, intentType, returnUrl) => {
|
|
26
|
+
const result = await (() => {
|
|
27
|
+
if (intentType === 'payment') {
|
|
28
|
+
return stripe.confirmPayment({
|
|
29
|
+
elements,
|
|
30
|
+
confirmParams: {
|
|
31
|
+
return_url: returnUrl,
|
|
32
|
+
},
|
|
33
|
+
redirect: 'if_required',
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return stripe.confirmSetup({
|
|
37
|
+
elements,
|
|
38
|
+
confirmParams: {
|
|
39
|
+
return_url: returnUrl,
|
|
40
|
+
},
|
|
41
|
+
redirect: 'if_required',
|
|
42
|
+
});
|
|
43
|
+
})();
|
|
44
|
+
if (result.error) {
|
|
45
|
+
throw new StripeAPIError(result.error);
|
|
46
|
+
}
|
|
47
|
+
return result;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Confirm a Checkout Session payment using the checkout actions.
|
|
51
|
+
* @param checkout the Stripe Checkout instance
|
|
52
|
+
* @param returnUrl the URL Stripe should redirect back to when required
|
|
53
|
+
* @returns the confirmation result
|
|
54
|
+
* @throws StripeAPIError when loading actions or confirming fails
|
|
55
|
+
*/
|
|
56
|
+
const confirmCheckoutSession = async (checkout, returnUrl) => {
|
|
57
|
+
var _a;
|
|
58
|
+
// Load actions from the checkout session
|
|
59
|
+
const loadActionsResult = await checkout.loadActions();
|
|
60
|
+
if (loadActionsResult.type === 'error') {
|
|
61
|
+
// Create a StripeError-compatible object from the Checkout Session error
|
|
62
|
+
const stripeError = {
|
|
63
|
+
type: 'api_error',
|
|
64
|
+
code: loadActionsResult.error.code || 'checkout_session_error',
|
|
65
|
+
message: loadActionsResult.error.message,
|
|
66
|
+
};
|
|
67
|
+
throw new StripeAPIError(stripeError);
|
|
68
|
+
}
|
|
69
|
+
const { actions } = loadActionsResult;
|
|
70
|
+
// Confirm the payment using checkout session actions
|
|
71
|
+
const result = await actions.confirm({
|
|
72
|
+
returnUrl,
|
|
73
|
+
redirect: 'if_required',
|
|
74
|
+
});
|
|
75
|
+
if (result.type === 'error') {
|
|
76
|
+
// Create a StripeError-compatible object from the confirm error
|
|
77
|
+
const stripeError = {
|
|
78
|
+
type: 'card_error',
|
|
79
|
+
code: result.error.code || 'payment_failed',
|
|
80
|
+
message: result.error.message,
|
|
81
|
+
decline_code: result.error.code === 'paymentFailed' ? (_a = result.error.paymentFailed) === null || _a === void 0 ? void 0 : _a.declineCode : undefined,
|
|
82
|
+
};
|
|
83
|
+
throw new StripeAPIError(stripeError);
|
|
84
|
+
}
|
|
85
|
+
return result;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Resolve the mode-specific properties for a submit event.
|
|
89
|
+
* Picks the Checkout or Elements payload depending on the active mode and
|
|
90
|
+
* reports a descriptive error string when the required instance is missing.
|
|
91
|
+
* @param params the resolved Stripe instances and client secrets for the current mode
|
|
92
|
+
* @returns the submit event props, or an error message when an instance is missing
|
|
93
|
+
*/
|
|
94
|
+
const buildSubmitEventProps = (params) => {
|
|
95
|
+
const { stripe, isCheckoutSession, checkout, checkoutSessionClientSecret, elements, intentClientSecret } = params;
|
|
96
|
+
const props = {
|
|
97
|
+
stripe,
|
|
98
|
+
};
|
|
99
|
+
if (isCheckoutSession) {
|
|
100
|
+
// Checkout Session mode
|
|
101
|
+
if (checkout == null) {
|
|
102
|
+
return { error: 'Checkout not properly initialized' };
|
|
103
|
+
}
|
|
104
|
+
props.checkout = checkout;
|
|
105
|
+
props.checkoutSessionClientSecret = checkoutSessionClientSecret;
|
|
106
|
+
return { props };
|
|
107
|
+
}
|
|
108
|
+
// Payment Intent / Setup Intent mode
|
|
109
|
+
if (elements == null) {
|
|
110
|
+
return { error: 'Elements not properly initialized' };
|
|
111
|
+
}
|
|
112
|
+
props.elements = elements;
|
|
113
|
+
props.intentClientSecret = intentClientSecret;
|
|
114
|
+
return { props };
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export { confirmCheckoutSession as a, buildSubmitEventProps as b, confirmPaymentOrSetup as c, isSubmitButtonDisabled as i };
|
|
@@ -85,7 +85,7 @@ const StripePaymentRequestButton = class {
|
|
|
85
85
|
console.warn('[stripe-pwa-elements] <stripe-payment-request-button> is deprecated. ' +
|
|
86
86
|
'stripe.paymentRequest() is being removed in Stripe.js 9.x (deprecated 2025-09-30 / removed 2026-03-25). ' +
|
|
87
87
|
'Please migrate to <stripe-express-checkout-element>, which supports Apple Pay, Google Pay, Link, PayPal, and more. ' +
|
|
88
|
-
'Migration guide: https://
|
|
88
|
+
'Migration guide: https://stripe-pwa-elements-docs.wp-kyoto.workers.dev/guides/migrate-payment-request-button-to-express-checkout/');
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
91
|
* @param option
|
|
@@ -192,7 +192,7 @@ const StripePaymentRequestButton = class {
|
|
|
192
192
|
this.stripe = undefined;
|
|
193
193
|
}
|
|
194
194
|
render() {
|
|
195
|
-
return (h(Host, { key: '
|
|
195
|
+
return (h(Host, { key: '644a4b729c72e87b42df5e1b43262d3195e7ebc6' }, h("div", { key: 'aff26789868bbec0f1f6abc463fb14d7f3e73c1b', id: "payment-request" }, h("div", { key: '074a25f3c5b2575696ddaeacf2715935212964a5', id: "payment-request-button" })), h("slot", { key: '5173400bd63ab201f02934cea4edcab4bb7eed9c' })));
|
|
196
196
|
}
|
|
197
197
|
get el() { return getElement(this); }
|
|
198
198
|
};
|