stripe-pwa-elements 3.1.0 → 4.0.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/app-globals-V2Kpy_OQ.js +0 -3
- package/dist/cjs/error-FFC4kSs5.js +0 -3
- package/dist/cjs/{factory-Hsw0e7-d.js → factory-da3xAKkz.js} +194 -73
- package/dist/cjs/{index-Ba1pBePA.js → index-CYbA1N_k.js} +24 -6
- package/dist/cjs/index-Dkb0SxZc.js +4694 -0
- package/dist/cjs/index.cjs.js +0 -1
- package/dist/cjs/ion-icon.cjs.entry.js +22 -13
- package/dist/cjs/loader.cjs.js +2 -3
- package/dist/cjs/stripe-address-element.cjs.entry.js +34 -26
- package/dist/cjs/stripe-card-element-modal.cjs.entry.js +6 -7
- package/dist/cjs/stripe-card-element_2.cjs.entry.js +135 -73
- package/dist/cjs/stripe-currency-selector.cjs.entry.js +13 -10
- package/dist/cjs/stripe-elements.cjs.js +31 -5
- package/dist/cjs/stripe-express-checkout-element.cjs.entry.js +25 -22
- package/dist/cjs/stripe-link-authentication-element.cjs.entry.js +13 -10
- package/dist/cjs/stripe-payment-element.cjs.entry.js +190 -131
- package/dist/cjs/stripe-payment-request-button.cjs.entry.js +12 -7
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/stripe-address-element/stripe-address-element.js +29 -21
- package/dist/collection/components/stripe-card-element/stripe-card-element.helpers.js +57 -0
- package/dist/collection/components/stripe-card-element/stripe-card-element.js +55 -68
- package/dist/collection/components/stripe-card-element-modal/stripe-card-element-modal.css +2 -2
- package/dist/collection/components/stripe-card-element-modal/stripe-card-element-modal.js +16 -12
- package/dist/collection/components/stripe-currency-selector/stripe-currency-selector.js +10 -6
- package/dist/collection/components/stripe-express-checkout-element/stripe-express-checkout-element.js +28 -20
- package/dist/collection/components/stripe-link-authentication-element/stripe-link-authentication-element.js +12 -7
- package/dist/collection/components/stripe-modal/stripe-modal.css +36 -2
- package/dist/collection/components/stripe-modal/stripe-modal.js +34 -7
- package/dist/collection/components/stripe-payment-element/stripe-payment-element.helpers.js +114 -0
- package/dist/collection/components/stripe-payment-element/stripe-payment-element.js +69 -126
- package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js +34 -12
- package/dist/collection/index.js +0 -1
- package/dist/collection/interfaces.js +0 -1
- package/dist/collection/services/address-element-manager.js +3 -4
- package/dist/collection/services/card-element-manager.js +3 -4
- package/dist/collection/services/currency-selector-element-manager.js +3 -4
- package/dist/collection/services/express-checkout-element-manager.js +9 -10
- package/dist/collection/services/factory.js +0 -1
- package/dist/collection/services/interfaces.js +0 -1
- package/dist/collection/services/link-authentication-element-manager.js +3 -4
- package/dist/collection/services/payment-element-manager.js +4 -5
- package/dist/collection/services/stripe-service.js +5 -6
- package/dist/collection/utils/element-finder.js +2 -3
- package/dist/collection/utils/error.js +0 -1
- package/dist/collection/utils/i18n.js +0 -1
- package/dist/collection/utils/platform.js +0 -1
- package/dist/collection/utils/test-setup.js +5 -0
- package/dist/collection/utils/utils.js +2 -3
- package/dist/components/error.js +1 -16
- package/dist/components/factory.js +1 -3736
- package/dist/components/icon.js +1 -459
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -4
- package/dist/components/index2.js +1 -192
- package/dist/components/ion-icon.js +1 -9
- package/dist/components/stripe-address-element.js +1 -327
- package/dist/components/stripe-card-element-modal.js +1 -174
- package/dist/components/stripe-card-element.js +1 -9
- package/dist/components/stripe-card-element2.js +1 -440
- package/dist/components/stripe-currency-selector.js +1 -218
- package/dist/components/stripe-express-checkout-element.js +1 -332
- package/dist/components/stripe-link-authentication-element.js +1 -256
- package/dist/components/stripe-modal.js +1 -9
- package/dist/components/stripe-modal2.js +1 -88
- package/dist/components/stripe-payment-element.js +1 -510
- package/dist/components/stripe-payment-request-button.js +1 -9
- package/dist/components/stripe-payment-request-button2.js +1 -224
- package/dist/components/utils.js +1 -89
- package/dist/esm/app-globals-DQuL1Twl.js +0 -3
- package/dist/esm/error-XRfh5Wrs.js +0 -3
- package/dist/esm/{factory-Li_TGt9P.js → factory-DeqoYLf_.js} +194 -73
- package/dist/esm/index-C6bbmyga.js +4677 -0
- package/dist/esm/{index-BHDCxQOb.js → index-CBXaOfXU.js} +24 -6
- package/dist/esm/index.js +0 -1
- package/dist/esm/ion-icon.entry.js +22 -13
- package/dist/esm/loader.js +3 -4
- package/dist/esm/stripe-address-element.entry.js +34 -26
- package/dist/esm/stripe-card-element-modal.entry.js +6 -7
- package/dist/esm/stripe-card-element_2.entry.js +135 -73
- package/dist/esm/stripe-currency-selector.entry.js +13 -10
- package/dist/esm/stripe-elements.js +32 -6
- package/dist/esm/stripe-express-checkout-element.entry.js +25 -22
- package/dist/esm/stripe-link-authentication-element.entry.js +13 -10
- package/dist/esm/stripe-payment-element.entry.js +190 -131
- package/dist/esm/stripe-payment-request-button.entry.js +12 -7
- package/dist/stripe-elements/index.esm.js +0 -2
- package/dist/stripe-elements/p--sA2m1ad.js +1 -0
- package/dist/stripe-elements/p-38e7b187.entry.js +1 -0
- package/dist/stripe-elements/p-44495284.entry.js +1 -0
- package/dist/stripe-elements/p-4ba675fa.entry.js +1 -0
- package/dist/stripe-elements/p-5cf62945.entry.js +1 -0
- package/dist/stripe-elements/p-C6bbmyga.js +2 -0
- package/dist/stripe-elements/p-CBXaOfXU.js +1 -0
- package/dist/stripe-elements/p-DQuL1Twl.js +1 -2
- package/dist/stripe-elements/p-XRfh5Wrs.js +1 -2
- package/dist/stripe-elements/p-c24ae181.entry.js +1 -0
- package/dist/stripe-elements/p-d9e86451.entry.js +1 -0
- package/dist/stripe-elements/p-f09c86a0.entry.js +1 -0
- package/dist/stripe-elements/p-f64f394d.entry.js +1 -0
- package/dist/stripe-elements/p-f6d2425e.entry.js +1 -0
- package/dist/stripe-elements/stripe-elements.esm.js +1 -2
- package/dist/stripe-elements/svg/.gitignore +4 -0
- package/dist/types/components/stripe-card-element/stripe-card-element.d.ts +5 -1
- package/dist/types/components/stripe-card-element/stripe-card-element.helpers.d.ts +29 -0
- package/dist/types/components/stripe-card-element-modal/stripe-card-element-modal.d.ts +4 -4
- package/dist/types/components/stripe-modal/stripe-modal.d.ts +6 -0
- package/dist/types/components/stripe-payment-element/stripe-payment-element.d.ts +2 -2
- package/dist/types/components/stripe-payment-element/stripe-payment-element.helpers.d.ts +54 -0
- package/dist/types/components/stripe-payment-request-button/stripe-payment-request-button.d.ts +8 -0
- package/dist/types/components.d.ts +139 -29
- package/dist/types/index.d.ts +1 -0
- package/dist/types/services/interfaces.d.ts +3 -3
- package/dist/types/services/stripe-service.d.ts +2 -2
- package/dist/types/stencil-public-runtime.d.ts +110 -5
- package/dist/types/utils/test-setup.d.ts +1 -0
- package/package.json +50 -30
- package/readme.md +386 -133
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +0 -1
- package/dist/cjs/error-FFC4kSs5.js.map +0 -1
- package/dist/cjs/factory-Hsw0e7-d.js.map +0 -1
- package/dist/cjs/index-Ba1pBePA.js.map +0 -1
- package/dist/cjs/index-C1haN5iF.js +0 -1907
- package/dist/cjs/index-C1haN5iF.js.map +0 -1
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/ion-icon.entry.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/stripe-address-element.entry.cjs.js.map +0 -1
- package/dist/cjs/stripe-card-element-modal.entry.cjs.js.map +0 -1
- package/dist/cjs/stripe-card-element.stripe-modal.entry.cjs.js.map +0 -1
- package/dist/cjs/stripe-currency-selector.entry.cjs.js.map +0 -1
- package/dist/cjs/stripe-elements.cjs.js.map +0 -1
- package/dist/cjs/stripe-express-checkout-element.entry.cjs.js.map +0 -1
- package/dist/cjs/stripe-link-authentication-element.entry.cjs.js.map +0 -1
- package/dist/cjs/stripe-payment-element.entry.cjs.js.map +0 -1
- package/dist/cjs/stripe-payment-request-button.entry.cjs.js.map +0 -1
- package/dist/collection/components/stripe-address-element/stripe-address-element.js.map +0 -1
- package/dist/collection/components/stripe-card-element/stripe-card-element.js.map +0 -1
- package/dist/collection/components/stripe-card-element-modal/stripe-card-element-modal.js.map +0 -1
- package/dist/collection/components/stripe-currency-selector/stripe-currency-selector.js.map +0 -1
- package/dist/collection/components/stripe-express-checkout-element/stripe-express-checkout-element.js.map +0 -1
- package/dist/collection/components/stripe-link-authentication-element/stripe-link-authentication-element.js.map +0 -1
- package/dist/collection/components/stripe-modal/stripe-modal.js.map +0 -1
- package/dist/collection/components/stripe-payment-element/stripe-payment-element.js.map +0 -1
- package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js.map +0 -1
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/interfaces.js.map +0 -1
- package/dist/collection/services/address-element-manager.js.map +0 -1
- package/dist/collection/services/card-element-manager.js.map +0 -1
- package/dist/collection/services/currency-selector-element-manager.js.map +0 -1
- package/dist/collection/services/express-checkout-element-manager.js.map +0 -1
- package/dist/collection/services/factory.js.map +0 -1
- package/dist/collection/services/interfaces.js.map +0 -1
- package/dist/collection/services/link-authentication-element-manager.js.map +0 -1
- package/dist/collection/services/payment-element-manager.js.map +0 -1
- package/dist/collection/services/stripe-service.js.map +0 -1
- package/dist/collection/utils/element-finder.js.map +0 -1
- package/dist/collection/utils/error.js.map +0 -1
- package/dist/collection/utils/i18n.js.map +0 -1
- package/dist/collection/utils/platform.js.map +0 -1
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/error.js.map +0 -1
- package/dist/components/factory.js.map +0 -1
- package/dist/components/icon.js.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/components/index2.js.map +0 -1
- package/dist/components/ion-icon.js.map +0 -1
- package/dist/components/stripe-address-element.js.map +0 -1
- package/dist/components/stripe-card-element-modal.js.map +0 -1
- package/dist/components/stripe-card-element.js.map +0 -1
- package/dist/components/stripe-card-element2.js.map +0 -1
- package/dist/components/stripe-currency-selector.js.map +0 -1
- package/dist/components/stripe-express-checkout-element.js.map +0 -1
- package/dist/components/stripe-link-authentication-element.js.map +0 -1
- package/dist/components/stripe-modal.js.map +0 -1
- package/dist/components/stripe-modal2.js.map +0 -1
- package/dist/components/stripe-payment-element.js.map +0 -1
- package/dist/components/stripe-payment-request-button.js.map +0 -1
- package/dist/components/stripe-payment-request-button2.js.map +0 -1
- package/dist/components/utils.js.map +0 -1
- package/dist/esm/app-globals-DQuL1Twl.js.map +0 -1
- package/dist/esm/error-XRfh5Wrs.js.map +0 -1
- package/dist/esm/factory-Li_TGt9P.js.map +0 -1
- package/dist/esm/index-BHDCxQOb.js.map +0 -1
- package/dist/esm/index-Dkis4t79.js +0 -1895
- package/dist/esm/index-Dkis4t79.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/ion-icon.entry.js.map +0 -1
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/stripe-address-element.entry.js.map +0 -1
- package/dist/esm/stripe-card-element-modal.entry.js.map +0 -1
- package/dist/esm/stripe-card-element.stripe-modal.entry.js.map +0 -1
- package/dist/esm/stripe-currency-selector.entry.js.map +0 -1
- package/dist/esm/stripe-elements.js.map +0 -1
- package/dist/esm/stripe-express-checkout-element.entry.js.map +0 -1
- package/dist/esm/stripe-link-authentication-element.entry.js.map +0 -1
- package/dist/esm/stripe-payment-element.entry.js.map +0 -1
- package/dist/esm/stripe-payment-request-button.entry.js.map +0 -1
- package/dist/stripe-elements/index.esm.js.map +0 -1
- package/dist/stripe-elements/ion-icon.entry.esm.js.map +0 -1
- package/dist/stripe-elements/loader.esm.js.map +0 -1
- package/dist/stripe-elements/p-01d63033.entry.js +0 -2
- package/dist/stripe-elements/p-01d63033.entry.js.map +0 -1
- package/dist/stripe-elements/p-1b8f9c7f.entry.js +0 -2
- package/dist/stripe-elements/p-1b8f9c7f.entry.js.map +0 -1
- package/dist/stripe-elements/p-37008853.entry.js +0 -2
- package/dist/stripe-elements/p-37008853.entry.js.map +0 -1
- package/dist/stripe-elements/p-5d152193.entry.js +0 -2
- package/dist/stripe-elements/p-5d152193.entry.js.map +0 -1
- package/dist/stripe-elements/p-623f13e6.entry.js +0 -2
- package/dist/stripe-elements/p-623f13e6.entry.js.map +0 -1
- package/dist/stripe-elements/p-809c9f2f.entry.js +0 -2
- package/dist/stripe-elements/p-809c9f2f.entry.js.map +0 -1
- package/dist/stripe-elements/p-BHDCxQOb.js +0 -2
- package/dist/stripe-elements/p-BHDCxQOb.js.map +0 -1
- package/dist/stripe-elements/p-DQuL1Twl.js.map +0 -1
- package/dist/stripe-elements/p-Dkis4t79.js +0 -3
- package/dist/stripe-elements/p-Dkis4t79.js.map +0 -1
- package/dist/stripe-elements/p-WnA32N4v.js +0 -2
- package/dist/stripe-elements/p-WnA32N4v.js.map +0 -1
- package/dist/stripe-elements/p-XRfh5Wrs.js.map +0 -1
- package/dist/stripe-elements/p-ba41e196.entry.js +0 -2
- package/dist/stripe-elements/p-ba41e196.entry.js.map +0 -1
- package/dist/stripe-elements/p-bb1bc49a.entry.js +0 -2
- package/dist/stripe-elements/p-bb1bc49a.entry.js.map +0 -1
- package/dist/stripe-elements/p-f21ea941.entry.js +0 -2
- package/dist/stripe-elements/p-f21ea941.entry.js.map +0 -1
- package/dist/stripe-elements/stripe-address-element.entry.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-card-element-modal.entry.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-card-element.stripe-modal.entry.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-currency-selector.entry.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-elements.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-express-checkout-element.entry.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-link-authentication-element.entry.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-payment-element.entry.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-payment-request-button.entry.esm.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,a as e,h as i,g as s}from"./p-C6bbmyga.js";import{s as r,c as n,i as o}from"./p--sA2m1ad.js";import{S as a}from"./p-XRfh5Wrs.js";import"./p-CBXaOfXU.js";const c=t=>{const{stripe:e,isCheckoutSession:i,checkout:s,checkoutSessionClientSecret:r,elements:n,intentClientSecret:o}=t,a={stripe:e};return i?null==s?{error:"Checkout not properly initialized"}:(a.checkout=s,a.checkoutSessionClientSecret=r,{props:a}):null==n?{error:"Elements not properly initialized"}:(a.elements=n,a.intentClientSecret=o,{props:a})},l=class{async initStripe(t,e){if(await this.stripeService.initialize(t,{stripeAccount:null==e?void 0:e.stripeAccount,applicationName:this.applicationName}),"success"===this.stripeService.state.loadStripeStatus)await this.initElement(),this.stripeLoadedEventHandler();else{const t=this.stripeService.onChange("loadStripeStatus",(async e=>{"success"===e&&(await this.initElement(),this.stripeLoadedEventHandler(),t())}))}}async initStripeWithCheckoutSession(t,e,i){if(await this.stripeService.initializeWithCheckoutSession(t,e,{stripeAccount:null==i?void 0:i.stripeAccount,applicationName:this.applicationName,elementsOptions:null==i?void 0:i.elementsOptions}),"success"===this.stripeService.state.loadStripeStatus)await this.initElement(),this.stripeLoadedEventHandler();else{const t=this.stripeService.onChange("loadStripeStatus",(async e=>{"success"===e&&(await this.initElement(),this.stripeLoadedEventHandler(),t())}))}}async updateProgress(t){return this.progress=t,this}async setErrorMessage(t){return this.paymentElementManager.setError(t),this}updatePublishableKey(t){const e={};e.stripeAccount=this.stripeService.state.stripeAccount;const i=Object.values(e).filter((t=>null!=t&&""!==t)).length>0;this.initStripe(t,i?e:void 0)}updateStripeAccountId(t){this.initStripe(this.stripeService.state.publishableKey,{stripeAccount:t})}async updateIntentClientSecret(){"success"===this.stripeService.state.loadStripeStatus&&await this.initElement()}async updateCheckoutSessionClientSecret(t){null!=this.publishableKey&&""!==this.publishableKey&&null!=t&&""!==t&&await this.initStripeWithCheckoutSession(this.publishableKey,t,{stripeAccount:this.stripeAccount})}stripeLoadedEventHandler(){const t={stripe:this.stripeService.getStripe()};null!=this.stripeDidLoaded&&this.stripeDidLoaded(t),this.stripeLoaded.emit(t)}async formSubmitEventHandler(){const t=this.stripeService.getStripe(),e=!0===this.stripeService.state.isCheckoutSession;if(null==t)return void console.error("Stripe not properly initialized");const i=c({stripe:t,isCheckoutSession:e,checkout:this.stripeService.getCheckout(),checkoutSessionClientSecret:this.checkoutSessionClientSecret,elements:this.stripeService.getElements(),intentClientSecret:this.intentClientSecret});"error"in i?console.error(i.error):this.formSubmit.emit(i.props)}async defaultFormSubmitResultHandler(t){this.defaultFormSubmitResult.emit(t)}async checkoutSessionConfirmResultHandler(t){this.checkoutSessionConfirmResult.emit(t)}componentWillRender(){const{publishableKey:t}=this.stripeService.state;null!=t&&""!==t&&(["success","loading"].includes(this.stripeService.state.loadStripeStatus)||this.initStripe(this.stripeService.state.publishableKey,{stripeAccount:this.stripeService.state.stripeAccount}))}async defaultFormSubmitAction(t,{stripe:e,elements:i}){t.preventDefault();try{const t=window.location.href,s=await(async(t,e,i,s)=>{const r=await("payment"===i?t.confirmPayment({elements:e,confirmParams:{return_url:s},redirect:"if_required"}):t.confirmSetup({elements:e,confirmParams:{return_url:s},redirect:"if_required"}));if(r.error)throw new a(r.error);return r})(e,i,this.intentType,t);this.defaultFormSubmitResultHandler(s)}catch(t){throw console.error(t),this.defaultFormSubmitResultHandler(t),t}}async checkoutSessionFormSubmitAction(t,e){t.preventDefault();try{const t=window.location.href,i=await(async(t,e)=>{var i;const s=await t.loadActions();if("error"===s.type)throw new a({type:"api_error",code:s.error.code||"checkout_session_error",message:s.error.message});const{actions:r}=s,n=await r.confirm({returnUrl:e,redirect:"if_required"});if("error"===n.type){const t={type:"card_error",code:n.error.code||"payment_failed",message:n.error.message,decline_code:"paymentFailed"===n.error.code?null===(i=n.error.paymentFailed)||void 0===i?void 0:i.declineCode:void 0};throw new a(t)}return n})(e,t);this.checkoutSessionConfirmResultHandler(i)}catch(t){throw console.error(t),this.checkoutSessionConfirmResultHandler(t instanceof Error?t:new Error(String(t))),t}}constructor(i){t(this,i),this.stripeLoaded=e(this,"stripeLoaded",7),this.formSubmit=e(this,"formSubmit",7),this.defaultFormSubmitResult=e(this,"defaultFormSubmitResult",7),this.checkoutSessionConfirmResult=e(this,"checkoutSessionConfirmResult",7),this.intentType="payment",this.sheetTitle="Add your payment information",this.buttonLabel="Pay",this.progress="",this.applicationName="stripe-pwa-elements",this.shouldUseDefaultFormSubmitAction=!0,this.stripeService=r.createStripeService(),this.paymentElementManager=r.createPaymentElementManager(this.stripeService),null!=this.publishableKey&&""!==this.publishableKey&&this.initStripe(this.publishableKey,{stripeAccount:this.stripeAccount})}async initElement(){await this.paymentElementManager.initialize(this.el);const t=this.el.querySelector("#stripe-payment-element");null!=t?(null!=this._submitHandler&&t.removeEventListener("submit",this._submitHandler),this._submitHandler=async t=>{const e=this.stripeService.getStripe(),i=!0===this.stripeService.state.isCheckoutSession;if(null==e)return void console.error("Stripe not properly initialized");const s=c({stripe:e,isCheckoutSession:i,checkout:this.stripeService.getCheckout(),checkoutSessionClientSecret:this.checkoutSessionClientSecret,elements:this.stripeService.getElements(),intentClientSecret:this.intentClientSecret});if("error"in s)return void console.error(s.error);const r=s.props;this.progress="loading";try{null!=this.handleSubmit?await this.handleSubmit(t,r):!0===this.shouldUseDefaultFormSubmitAction?i&&null!=r.checkout?await this.checkoutSessionFormSubmitAction(t,r.checkout):null!=this.intentClientSecret&&""!==this.intentClientSecret?await this.defaultFormSubmitAction(t,r):t.preventDefault():t.preventDefault(),await this.formSubmitEventHandler(),null==this.handleSubmit&&!0!==this.shouldUseDefaultFormSubmitAction||(this.progress="success")}catch(t){const e=t instanceof Error?t.message:String(t);this.paymentElementManager.setError(e),this.progress="failure"}},t.addEventListener("submit",this._submitHandler)):console.error("Form element #stripe-payment-element not found")}componentDidLoad(){this.el.classList.add(n())}disconnectedCallback(){if(this.paymentElementManager.unmount(),null!=this._submitHandler){const t=this.el.querySelector("#stripe-payment-element");null!=t&&t.removeEventListener("submit",this._submitHandler)}}render(){const{loadStripeStatus:t,isCheckoutSession:e}=this.stripeService.state,{errorMessage:s}=this.paymentElementManager.getState();if("failure"===t)return i("p",null,o.t("Failed to load Stripe"));const r=(t=>{const{progress:e,isCheckoutSession:i,loadStripeStatus:s,intentClientSecret:r}=t;return"loading"===e||!(i?"success"===s:null!=r&&""!==r)})({progress:this.progress,isCheckoutSession:!0===e,loadStripeStatus:t,intentClientSecret:this.intentClientSecret});return i("div",{class:"stripe-payment-sheet-wrap"},i("form",{id:"stripe-payment-element"},i("div",{class:"stripe-heading"},o.t(this.sheetTitle)),i("div",null,i("div",{class:"stripe-section-title"},o.t("Payment information"))),i("div",{class:"payment-info visible"},i("div",{id:"payment-element"})),i("div",{id:"payment-errors",class:"stripe-element-errors"},s),i("div",{style:{marginTop:"32px"}},i("button",{type:"submit",disabled:r},o.t("loading"===this.progress?"Loading":this.buttonLabel)))))}get el(){return s(this)}static get watchers(){return{publishableKey:[{updatePublishableKey:0}],stripeAccount:[{updateStripeAccountId:0}],intentClientSecret:[{updateIntentClientSecret:0}],checkoutSessionClientSecret:[{updateCheckoutSessionClientSecret:0}]}}};l.style=':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)}';export{l as stripe_payment_element}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{p as e,b as
|
|
2
|
-
//# sourceMappingURL=stripe-elements.esm.js.map
|
|
1
|
+
import{p as e,B as t,c as i,w as n,N as a,H as l,b as o}from"./p-C6bbmyga.js";export{s as setNonce}from"./p-C6bbmyga.js";import{g as p}from"./p-DQuL1Twl.js";var r=e=>{const t=e.cloneNode;e.cloneNode=function(e){if("TEMPLATE"===this.nodeName)return t.call(this,e);const i=t.call(this,!1),n=this.childNodes;if(e)for(let e=0;e<n.length;e++)2!==n[e].nodeType&&i.appendChild(n[e].cloneNode(!0));return i}};(()=>{t.isDev&&!t.isTesting&&i("Running in development mode."),t.cloneNodeFix&&r(l.prototype);const s=t.scriptDataOpts?n.document&&Array.from(n.document.querySelectorAll("script")).find((e=>new RegExp(`/${a}(\\.esm)?\\.js($|\\?|#)`).test(e.src)||e.getAttribute("data-stencil-namespace")===a)):null,o=import.meta.url,p=t.scriptDataOpts&&(s||{})["data-opts"]||{};return""!==o&&(p.resourcesUrl=new URL(".",o).href),e(p)})().then((async e=>(await p(),o([["p-38e7b187",[[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]}]]],["p-f64f394d",[[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}]}]]],["p-44495284",[[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}]}]]],["p-f09c86a0",[[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}]}]]],["p-4ba675fa",[[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}]}]]],["p-f6d2425e",[[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}]}]]],["p-5cf62945",[[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}]}]]],["p-d9e86451",[[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]}]]],["p-c24ae181",[[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}]}],[257,"stripe-modal",{showCloseButton:[4,"show-close-button"],open:[4],renderedOpen:[32],toggleModal:[64],openModal:[64],closeModal:[64]}]]]],e))));
|
|
@@ -43,7 +43,7 @@ export declare class StripeCardElement {
|
|
|
43
43
|
* customElements
|
|
44
44
|
* .whenDefined('stripe-card-element')
|
|
45
45
|
* .then(() => {
|
|
46
|
-
*
|
|
46
|
+
* stripeElement.initStripe('pk_test_XXXXXXXXX')
|
|
47
47
|
* })
|
|
48
48
|
* ```
|
|
49
49
|
*/
|
|
@@ -76,6 +76,7 @@ export declare class StripeCardElement {
|
|
|
76
76
|
* stripeElement.updateProgress('success')
|
|
77
77
|
* });
|
|
78
78
|
* })
|
|
79
|
+
* ```
|
|
79
80
|
*/
|
|
80
81
|
updateProgress(progress: ProgressStatus): Promise<this>;
|
|
81
82
|
/**
|
|
@@ -103,6 +104,7 @@ export declare class StripeCardElement {
|
|
|
103
104
|
* }
|
|
104
105
|
* });
|
|
105
106
|
* })
|
|
107
|
+
* ```
|
|
106
108
|
*/
|
|
107
109
|
setErrorMessage(errorMessage: string): Promise<this>;
|
|
108
110
|
/**
|
|
@@ -219,6 +221,7 @@ export declare class StripeCardElement {
|
|
|
219
221
|
* console.log(result);
|
|
220
222
|
* })
|
|
221
223
|
* })
|
|
224
|
+
* ```
|
|
222
225
|
*/
|
|
223
226
|
formSubmit: EventEmitter<FormSubmitEvent>;
|
|
224
227
|
private formSubmitEventHandler;
|
|
@@ -238,6 +241,7 @@ export declare class StripeCardElement {
|
|
|
238
241
|
* }
|
|
239
242
|
* })
|
|
240
243
|
* })
|
|
244
|
+
* ```
|
|
241
245
|
*/
|
|
242
246
|
defaultFormSubmitResult: EventEmitter<DefaultFormSubmitResult>;
|
|
243
247
|
private defaultFormSubmitResultHandler;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Stripe, StripeCardNumberElement, PaymentIntentResult, SetupIntentResult } from '@stripe/stripe-js';
|
|
2
|
+
import { IntentType, InitStripeOptions, PaymentRequestButtonOption } from '../../interfaces';
|
|
3
|
+
/**
|
|
4
|
+
* Build the `InitStripeOptions` object from an optional connected-account id.
|
|
5
|
+
* Returns `undefined` when no account is provided, mirroring the behavior
|
|
6
|
+
* expected by `initStripe` (so the second argument can be omitted entirely).
|
|
7
|
+
* @param stripeAccount Optional connected-account id
|
|
8
|
+
* @returns InitStripeOptions when an account id exists, otherwise undefined
|
|
9
|
+
*/
|
|
10
|
+
export declare const buildInitStripeOptionsFromAccount: (stripeAccount?: string) => InitStripeOptions | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Confirm a Stripe card intent, dispatching to `confirmCardPayment` or
|
|
13
|
+
* `confirmCardSetup` based on the configured intent type.
|
|
14
|
+
* @param stripe The loaded Stripe.js instance
|
|
15
|
+
* @param intentType Whether this is a payment or setup intent
|
|
16
|
+
* @param intentClientSecret The client secret of the intent to confirm
|
|
17
|
+
* @param cardNumberElement The Stripe card number element to confirm with
|
|
18
|
+
* @returns The PaymentIntent or SetupIntent confirmation result
|
|
19
|
+
*/
|
|
20
|
+
export declare const confirmCardIntent: (stripe: Stripe, intentType: IntentType, intentClientSecret: string, cardNumberElement: StripeCardNumberElement) => Promise<PaymentIntentResult | SetupIntentResult>;
|
|
21
|
+
/**
|
|
22
|
+
* Wire up the optional payment-request handlers onto a freshly created
|
|
23
|
+
* `<stripe-payment-request-button>` element. Only handlers that are provided
|
|
24
|
+
* on the option object are attached, preserving the original behavior.
|
|
25
|
+
* @param element The payment-request-button custom element instance
|
|
26
|
+
* @param option The payment request button option (handlers + config)
|
|
27
|
+
* @returns void
|
|
28
|
+
*/
|
|
29
|
+
export declare const attachPaymentRequestHandlers: (element: HTMLStripePaymentRequestButtonElement, option: PaymentRequestButtonOption) => void;
|
|
@@ -44,9 +44,9 @@ export declare class StripeCardElementModal {
|
|
|
44
44
|
*
|
|
45
45
|
* @example
|
|
46
46
|
* ```
|
|
47
|
-
* const stripeElement = document.createElement('stripe-card-element');
|
|
47
|
+
* const stripeElement = document.createElement('stripe-card-element-modal');
|
|
48
48
|
* customElements
|
|
49
|
-
* .whenDefined('stripe-card-element')
|
|
49
|
+
* .whenDefined('stripe-card-element-modal')
|
|
50
50
|
* .then(() => {
|
|
51
51
|
* stripeElement.setAttribute('intent-client-secret', 'dummy')
|
|
52
52
|
* })
|
|
@@ -54,7 +54,7 @@ export declare class StripeCardElementModal {
|
|
|
54
54
|
*
|
|
55
55
|
* @example
|
|
56
56
|
* ```
|
|
57
|
-
* <stripe-card-element intent-client-secret="dummy" />
|
|
57
|
+
* <stripe-card-element-modal intent-client-secret="dummy" />
|
|
58
58
|
* ```
|
|
59
59
|
*/
|
|
60
60
|
intentClientSecret?: string;
|
|
@@ -69,7 +69,7 @@ export declare class StripeCardElementModal {
|
|
|
69
69
|
* If you want to use `setupIntent`, should update this attribute.
|
|
70
70
|
* @example
|
|
71
71
|
* ```
|
|
72
|
-
* <stripe-card-element intent-type="setup" />
|
|
72
|
+
* <stripe-card-element-modal intent-type="setup" />
|
|
73
73
|
* ```
|
|
74
74
|
*/
|
|
75
75
|
intentType: IntentType;
|
|
@@ -10,6 +10,11 @@ export declare class StripeModal {
|
|
|
10
10
|
* If true, the modal will open
|
|
11
11
|
*/
|
|
12
12
|
open: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Effect `this.open`. This is for animation.
|
|
15
|
+
* Ionic Ref: https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/accordion/accordion.tsx#L83
|
|
16
|
+
*/
|
|
17
|
+
renderedOpen: boolean;
|
|
13
18
|
/**
|
|
14
19
|
* Toggle modal state
|
|
15
20
|
*/
|
|
@@ -27,5 +32,6 @@ export declare class StripeModal {
|
|
|
27
32
|
*/
|
|
28
33
|
close: EventEmitter;
|
|
29
34
|
componentDidLoad(): void;
|
|
35
|
+
private openModalAnimation;
|
|
30
36
|
render(): any;
|
|
31
37
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
2
|
import { StripeDidLoadedHandler, StripeLoadedEvent, ProgressStatus, IntentType, DefaultFormSubmitResult, InitStripeOptions } from '../../interfaces';
|
|
3
3
|
import type { CheckoutSessionOptions } from '../../services/interfaces';
|
|
4
|
-
import type { Stripe, StripeElements,
|
|
4
|
+
import type { Stripe, StripeElements, StripeCheckoutElementsSdk, StripeCheckoutConfirmResult } from '@stripe/stripe-js';
|
|
5
5
|
/**
|
|
6
6
|
* Payment Element submit event
|
|
7
7
|
*/
|
|
@@ -9,7 +9,7 @@ export type PaymentElementSubmitEvent = {
|
|
|
9
9
|
stripe: Stripe;
|
|
10
10
|
elements?: StripeElements;
|
|
11
11
|
intentClientSecret?: string;
|
|
12
|
-
checkout?:
|
|
12
|
+
checkout?: StripeCheckoutElementsSdk;
|
|
13
13
|
checkoutSessionClientSecret?: string;
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Stripe, StripeElements, StripeCheckoutElementsSdk, StripeCheckoutConfirmResult } from '@stripe/stripe-js';
|
|
2
|
+
import type { IntentType, ProgressStatus } from '../../interfaces';
|
|
3
|
+
import type { PaymentElementSubmitEvent } from './stripe-payment-element';
|
|
4
|
+
/**
|
|
5
|
+
* Determine whether the submit button should be disabled.
|
|
6
|
+
* For Checkout Session mode: the checkout is ready once Stripe finished loading.
|
|
7
|
+
* For Payment Intent / Setup Intent mode: an intent client secret must be present.
|
|
8
|
+
* @param params progress / loading state and the current mode information
|
|
9
|
+
* @returns true when the submit button should be disabled
|
|
10
|
+
*/
|
|
11
|
+
export declare const isSubmitButtonDisabled: (params: {
|
|
12
|
+
progress: ProgressStatus;
|
|
13
|
+
isCheckoutSession: boolean;
|
|
14
|
+
loadStripeStatus: ProgressStatus;
|
|
15
|
+
intentClientSecret?: string;
|
|
16
|
+
}) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Run the default Stripe confirmation flow for Payment Intent / Setup Intent mode.
|
|
19
|
+
* Calls `confirmPayment` or `confirmSetup` depending on the intent type.
|
|
20
|
+
* @param stripe the loaded Stripe.js instance
|
|
21
|
+
* @param elements the Stripe Elements instance bound to the payment element
|
|
22
|
+
* @param intentType the configured intent type
|
|
23
|
+
* @param returnUrl the URL Stripe should redirect back to when required
|
|
24
|
+
* @returns the confirmation result
|
|
25
|
+
* @throws StripeAPIError when Stripe returns an error
|
|
26
|
+
*/
|
|
27
|
+
export declare const confirmPaymentOrSetup: (stripe: Stripe, elements: StripeElements, intentType: IntentType, returnUrl: string) => Promise<import("@stripe/stripe-js").PaymentIntentResult | import("@stripe/stripe-js").SetupIntentResult>;
|
|
28
|
+
/**
|
|
29
|
+
* Confirm a Checkout Session payment using the checkout actions.
|
|
30
|
+
* @param checkout the Stripe Checkout instance
|
|
31
|
+
* @param returnUrl the URL Stripe should redirect back to when required
|
|
32
|
+
* @returns the confirmation result
|
|
33
|
+
* @throws StripeAPIError when loading actions or confirming fails
|
|
34
|
+
*/
|
|
35
|
+
export declare const confirmCheckoutSession: (checkout: StripeCheckoutElementsSdk, returnUrl: string) => Promise<StripeCheckoutConfirmResult>;
|
|
36
|
+
/**
|
|
37
|
+
* Resolve the mode-specific properties for a submit event.
|
|
38
|
+
* Picks the Checkout or Elements payload depending on the active mode and
|
|
39
|
+
* reports a descriptive error string when the required instance is missing.
|
|
40
|
+
* @param params the resolved Stripe instances and client secrets for the current mode
|
|
41
|
+
* @returns the submit event props, or an error message when an instance is missing
|
|
42
|
+
*/
|
|
43
|
+
export declare const buildSubmitEventProps: (params: {
|
|
44
|
+
stripe: Stripe;
|
|
45
|
+
isCheckoutSession: boolean;
|
|
46
|
+
checkout?: StripeCheckoutElementsSdk;
|
|
47
|
+
checkoutSessionClientSecret?: string;
|
|
48
|
+
elements?: StripeElements;
|
|
49
|
+
intentClientSecret?: string;
|
|
50
|
+
}) => {
|
|
51
|
+
props: PaymentElementSubmitEvent;
|
|
52
|
+
} | {
|
|
53
|
+
error: string;
|
|
54
|
+
};
|
package/dist/types/components/stripe-payment-request-button/stripe-payment-request-button.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
2
|
import { Stripe, PaymentRequestOptions } from '@stripe/stripe-js';
|
|
3
3
|
import { StripeDidLoadedHandler, StripeLoadedEvent, PaymentRequestShippingAddressEventHandler, PaymentRequestPaymentMethodEventHandler, PaymentRequestShippingOptionEventHandler } from '../../interfaces';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated `stripe-payment-request-button` is deprecated and will be removed in a future release.
|
|
6
|
+
* `stripe.paymentRequest()` is being removed in Stripe.js 9.x (deprecated as of 2025-09-30 / 2026-03-25).
|
|
7
|
+
* Please migrate to `<stripe-express-checkout-element>` which supports Apple Pay, Google Pay, Link, PayPal,
|
|
8
|
+
* and more via the modern Express Checkout Element API.
|
|
9
|
+
* Migration guide: https://hideokamoto.github.io/stripe-pwa-elements/guides/migrate-payment-request-button-to-express-checkout/
|
|
10
|
+
*/
|
|
4
11
|
export declare class StripePaymentRequestButton {
|
|
5
12
|
el: HTMLStripePaymentRequestButtonElement;
|
|
6
13
|
loadStripeStatus: '' | 'loading' | 'success' | 'failure';
|
|
@@ -123,6 +130,7 @@ export declare class StripePaymentRequestButton {
|
|
|
123
130
|
stripeLoaded: EventEmitter<StripeLoadedEvent>;
|
|
124
131
|
private stripeLoadedEventHandler;
|
|
125
132
|
constructor();
|
|
133
|
+
connectedCallback(): void;
|
|
126
134
|
/**
|
|
127
135
|
* @param option
|
|
128
136
|
* @private
|
|
@@ -114,7 +114,7 @@ export namespace Components {
|
|
|
114
114
|
* Get Stripe.js, and initialize elements
|
|
115
115
|
* @param publishableKey
|
|
116
116
|
* @param options
|
|
117
|
-
* @example ``` const stripeElement = document.createElement('stripe-card-element'); customElements .whenDefined('stripe-card-element') .then(() => {
|
|
117
|
+
* @example ``` const stripeElement = document.createElement('stripe-card-element'); customElements .whenDefined('stripe-card-element') .then(() => { stripeElement.initStripe('pk_test_XXXXXXXXX') }) ```
|
|
118
118
|
*/
|
|
119
119
|
"initStripe": (publishableKey: string, options?: InitStripeOptions) => Promise<void>;
|
|
120
120
|
/**
|
|
@@ -136,7 +136,7 @@ export namespace Components {
|
|
|
136
136
|
* Set error message
|
|
137
137
|
* @param errorMessage string
|
|
138
138
|
* @returns
|
|
139
|
-
* @example ``` const stripeElement = document.createElement('stripe-card-element'); customElements .whenDefined('stripe-card-element') .then(() => { // You must set the attributes to stop running default form submit action when you want to listen the 'formSubmit' event. stripeElement.setAttribute('should-use-default-form-submit-action', false) stripeElement.addEventListener('formSubmit', async props => { try { throw new Error('debug') } catch (e) { stripeElement.setErrorMessage(`Error: ${e.message}`) stripeElement.updateProgress('failure') } }); })
|
|
139
|
+
* @example ``` const stripeElement = document.createElement('stripe-card-element'); customElements .whenDefined('stripe-card-element') .then(() => { // You must set the attributes to stop running default form submit action when you want to listen the 'formSubmit' event. stripeElement.setAttribute('should-use-default-form-submit-action', false) stripeElement.addEventListener('formSubmit', async props => { try { throw new Error('debug') } catch (e) { stripeElement.setErrorMessage(`Error: ${e.message}`) stripeElement.updateProgress('failure') } }); }) ```
|
|
140
140
|
*/
|
|
141
141
|
"setErrorMessage": (errorMessage: string) => Promise<this>;
|
|
142
142
|
/**
|
|
@@ -176,7 +176,7 @@ export namespace Components {
|
|
|
176
176
|
* Update the form submit progress
|
|
177
177
|
* @param progress
|
|
178
178
|
* @returns
|
|
179
|
-
* @example ``` const stripeElement = document.createElement('stripe-card-element'); customElements .whenDefined('stripe-card-element') .then(() => { // You must set the attributes to stop running default form submit action when you want to listen the 'formSubmit' event. stripeElement.setAttribute('should-use-default-form-submit-action', false) stripeElement.addEventListener('formSubmit', async props => { const { detail: { stripe, cardNumber, event }, } = props; const result = await stripe.createPaymentMethod({ type: 'card', card: cardNumber, }); console.log(result); stripeElement.updateProgress('success') }); })
|
|
179
|
+
* @example ``` const stripeElement = document.createElement('stripe-card-element'); customElements .whenDefined('stripe-card-element') .then(() => { // You must set the attributes to stop running default form submit action when you want to listen the 'formSubmit' event. stripeElement.setAttribute('should-use-default-form-submit-action', false) stripeElement.addEventListener('formSubmit', async props => { const { detail: { stripe, cardNumber, event }, } = props; const result = await stripe.createPaymentMethod({ type: 'card', card: cardNumber, }); console.log(result); stripeElement.updateProgress('success') }); }) ```
|
|
180
180
|
*/
|
|
181
181
|
"updateProgress": (progress: ProgressStatus) => Promise<this>;
|
|
182
182
|
/**
|
|
@@ -208,13 +208,13 @@ export namespace Components {
|
|
|
208
208
|
"handleSubmit": FormSubmitHandler;
|
|
209
209
|
/**
|
|
210
210
|
* The client secret from paymentIntent.create response
|
|
211
|
-
* @example ``` const stripeElement = document.createElement('stripe-card-element'); customElements .whenDefined('stripe-card-element') .then(() => { stripeElement.setAttribute('intent-client-secret', 'dummy') }) ```
|
|
212
|
-
* @example ``` <stripe-card-element intent-client-secret="dummy" /> ```
|
|
211
|
+
* @example ``` const stripeElement = document.createElement('stripe-card-element-modal'); customElements .whenDefined('stripe-card-element-modal') .then(() => { stripeElement.setAttribute('intent-client-secret', 'dummy') }) ```
|
|
212
|
+
* @example ``` <stripe-card-element-modal intent-client-secret="dummy" /> ```
|
|
213
213
|
*/
|
|
214
214
|
"intentClientSecret"?: string;
|
|
215
215
|
/**
|
|
216
216
|
* Default submit handle type. If you want to use `setupIntent`, should update this attribute.
|
|
217
|
-
* @example ``` <stripe-card-element intent-type="setup" /> ```
|
|
217
|
+
* @example ``` <stripe-card-element-modal intent-type="setup" /> ```
|
|
218
218
|
* @default 'payment'
|
|
219
219
|
*/
|
|
220
220
|
"intentType": IntentType;
|
|
@@ -576,6 +576,13 @@ export namespace Components {
|
|
|
576
576
|
*/
|
|
577
577
|
"updateProgress": (progress: ProgressStatus) => Promise<this>;
|
|
578
578
|
}
|
|
579
|
+
/**
|
|
580
|
+
* @deprecated `stripe-payment-request-button` is deprecated and will be removed in a future release.
|
|
581
|
+
* `stripe.paymentRequest()` is being removed in Stripe.js 9.x (deprecated as of 2025-09-30 / 2026-03-25).
|
|
582
|
+
* Please migrate to `<stripe-express-checkout-element>` which supports Apple Pay, Google Pay, Link, PayPal,
|
|
583
|
+
* and more via the modern Express Checkout Element API.
|
|
584
|
+
* Migration guide: https://hideokamoto.github.io/stripe-pwa-elements/guides/migrate-payment-request-button-to-express-checkout/
|
|
585
|
+
*/
|
|
579
586
|
interface StripePaymentRequestButton {
|
|
580
587
|
/**
|
|
581
588
|
* Overwrite the application name that registered For wrapper library (like Capacitor)
|
|
@@ -844,6 +851,13 @@ declare global {
|
|
|
844
851
|
interface HTMLStripePaymentRequestButtonElementEventMap {
|
|
845
852
|
"stripeLoaded": StripeLoadedEvent;
|
|
846
853
|
}
|
|
854
|
+
/**
|
|
855
|
+
* @deprecated `stripe-payment-request-button` is deprecated and will be removed in a future release.
|
|
856
|
+
* `stripe.paymentRequest()` is being removed in Stripe.js 9.x (deprecated as of 2025-09-30 / 2026-03-25).
|
|
857
|
+
* Please migrate to `<stripe-express-checkout-element>` which supports Apple Pay, Google Pay, Link, PayPal,
|
|
858
|
+
* and more via the modern Express Checkout Element API.
|
|
859
|
+
* Migration guide: https://hideokamoto.github.io/stripe-pwa-elements/guides/migrate-payment-request-button-to-express-checkout/
|
|
860
|
+
*/
|
|
847
861
|
interface HTMLStripePaymentRequestButtonElement extends Components.StripePaymentRequestButton, HTMLStencilElement {
|
|
848
862
|
addEventListener<K extends keyof HTMLStripePaymentRequestButtonElementEventMap>(type: K, listener: (this: HTMLStripePaymentRequestButtonElement, ev: StripePaymentRequestButtonCustomEvent<HTMLStripePaymentRequestButtonElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
849
863
|
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -961,12 +975,12 @@ declare namespace LocalJSX {
|
|
|
961
975
|
"intentType"?: IntentType;
|
|
962
976
|
/**
|
|
963
977
|
* Recieve the result of defaultFormSubmit event
|
|
964
|
-
* @example ``` const stripeElement = document.createElement('stripe-card-element'); customElements .whenDefined('stripe-card-element') .then(() => { stripeElement.addEventListener('defaultFormSubmitResult', async ({detail}) => { if (detail instanceof Error) { console.error(detail) } else { console.log(detail) } }) })
|
|
978
|
+
* @example ``` const stripeElement = document.createElement('stripe-card-element'); customElements .whenDefined('stripe-card-element') .then(() => { stripeElement.addEventListener('defaultFormSubmitResult', async ({detail}) => { if (detail instanceof Error) { console.error(detail) } else { console.log(detail) } }) }) ```
|
|
965
979
|
*/
|
|
966
980
|
"onDefaultFormSubmitResult"?: (event: StripeCardElementCustomEvent<DefaultFormSubmitResult>) => void;
|
|
967
981
|
/**
|
|
968
982
|
* Form submit event
|
|
969
|
-
* @example ``` const stripeElement = document.createElement('stripe-card-element'); customElements .whenDefined('stripe-card-element') .then(() => { stripeElement .addEventListener('formSubmit', async props => { const { detail: { stripe, cardNumber, event }, } = props; const result = await stripe.createPaymentMethod({ type: 'card', card: cardNumber, }); console.log(result); }) })
|
|
983
|
+
* @example ``` const stripeElement = document.createElement('stripe-card-element'); customElements .whenDefined('stripe-card-element') .then(() => { stripeElement .addEventListener('formSubmit', async props => { const { detail: { stripe, cardNumber, event }, } = props; const result = await stripe.createPaymentMethod({ type: 'card', card: cardNumber, }); console.log(result); }) }) ```
|
|
970
984
|
*/
|
|
971
985
|
"onFormSubmit"?: (event: StripeCardElementCustomEvent<FormSubmitEvent>) => void;
|
|
972
986
|
/**
|
|
@@ -1027,13 +1041,13 @@ declare namespace LocalJSX {
|
|
|
1027
1041
|
"handleSubmit"?: FormSubmitHandler;
|
|
1028
1042
|
/**
|
|
1029
1043
|
* The client secret from paymentIntent.create response
|
|
1030
|
-
* @example ``` const stripeElement = document.createElement('stripe-card-element'); customElements .whenDefined('stripe-card-element') .then(() => { stripeElement.setAttribute('intent-client-secret', 'dummy') }) ```
|
|
1031
|
-
* @example ``` <stripe-card-element intent-client-secret="dummy" /> ```
|
|
1044
|
+
* @example ``` const stripeElement = document.createElement('stripe-card-element-modal'); customElements .whenDefined('stripe-card-element-modal') .then(() => { stripeElement.setAttribute('intent-client-secret', 'dummy') }) ```
|
|
1045
|
+
* @example ``` <stripe-card-element-modal intent-client-secret="dummy" /> ```
|
|
1032
1046
|
*/
|
|
1033
1047
|
"intentClientSecret"?: string;
|
|
1034
1048
|
/**
|
|
1035
1049
|
* Default submit handle type. If you want to use `setupIntent`, should update this attribute.
|
|
1036
|
-
* @example ``` <stripe-card-element intent-type="setup" /> ```
|
|
1050
|
+
* @example ``` <stripe-card-element-modal intent-type="setup" /> ```
|
|
1037
1051
|
* @default 'payment'
|
|
1038
1052
|
*/
|
|
1039
1053
|
"intentType"?: IntentType;
|
|
@@ -1334,6 +1348,13 @@ declare namespace LocalJSX {
|
|
|
1334
1348
|
*/
|
|
1335
1349
|
"stripeDidLoaded"?: StripeDidLoadedHandler;
|
|
1336
1350
|
}
|
|
1351
|
+
/**
|
|
1352
|
+
* @deprecated `stripe-payment-request-button` is deprecated and will be removed in a future release.
|
|
1353
|
+
* `stripe.paymentRequest()` is being removed in Stripe.js 9.x (deprecated as of 2025-09-30 / 2026-03-25).
|
|
1354
|
+
* Please migrate to `<stripe-express-checkout-element>` which supports Apple Pay, Google Pay, Link, PayPal,
|
|
1355
|
+
* and more via the modern Express Checkout Element API.
|
|
1356
|
+
* Migration guide: https://hideokamoto.github.io/stripe-pwa-elements/guides/migrate-payment-request-button-to-express-checkout/
|
|
1357
|
+
*/
|
|
1337
1358
|
interface StripePaymentRequestButton {
|
|
1338
1359
|
/**
|
|
1339
1360
|
* Overwrite the application name that registered For wrapper library (like Capacitor)
|
|
@@ -1374,31 +1395,113 @@ declare namespace LocalJSX {
|
|
|
1374
1395
|
*/
|
|
1375
1396
|
"stripeDidLoaded"?: StripeDidLoadedHandler;
|
|
1376
1397
|
}
|
|
1398
|
+
|
|
1399
|
+
interface StripeAddressElementAttributes {
|
|
1400
|
+
"mode": 'shipping' | 'billing';
|
|
1401
|
+
"sheetTitle": string;
|
|
1402
|
+
"buttonLabel": string;
|
|
1403
|
+
"publishableKey": string;
|
|
1404
|
+
"stripeAccount": string;
|
|
1405
|
+
"applicationName": string;
|
|
1406
|
+
"showLabel": boolean;
|
|
1407
|
+
"defaultCountry": string;
|
|
1408
|
+
}
|
|
1409
|
+
interface StripeCardElementAttributes {
|
|
1410
|
+
"intentType": IntentType;
|
|
1411
|
+
"zip": boolean;
|
|
1412
|
+
"sheetTitle": string;
|
|
1413
|
+
"buttonLabel": string;
|
|
1414
|
+
"publishableKey": string;
|
|
1415
|
+
"stripeAccount": string;
|
|
1416
|
+
"applicationName": string;
|
|
1417
|
+
"showLabel": boolean;
|
|
1418
|
+
"intentClientSecret": string;
|
|
1419
|
+
"shouldUseDefaultFormSubmitAction": boolean;
|
|
1420
|
+
"showPaymentRequestButton": boolean;
|
|
1421
|
+
}
|
|
1422
|
+
interface StripeCardElementModalAttributes {
|
|
1423
|
+
"publishableKey": string;
|
|
1424
|
+
"stripeAccount": string;
|
|
1425
|
+
"applicationName": string;
|
|
1426
|
+
"showLabel": boolean;
|
|
1427
|
+
"sheetTitle": string;
|
|
1428
|
+
"buttonLabel": string;
|
|
1429
|
+
"intentClientSecret": string;
|
|
1430
|
+
"shouldUseDefaultFormSubmitAction": boolean;
|
|
1431
|
+
"intentType": IntentType;
|
|
1432
|
+
"showCloseButton": boolean;
|
|
1433
|
+
"zip": boolean;
|
|
1434
|
+
"open": boolean;
|
|
1435
|
+
}
|
|
1436
|
+
interface StripeCurrencySelectorAttributes {
|
|
1437
|
+
"publishableKey": string;
|
|
1438
|
+
"stripeAccount": string;
|
|
1439
|
+
"applicationName": string;
|
|
1440
|
+
"clientSecret": string;
|
|
1441
|
+
}
|
|
1442
|
+
interface StripeExpressCheckoutElementAttributes {
|
|
1443
|
+
"intentType": IntentType;
|
|
1444
|
+
"publishableKey": string;
|
|
1445
|
+
"stripeAccount": string;
|
|
1446
|
+
"applicationName": string;
|
|
1447
|
+
"clientSecret": string;
|
|
1448
|
+
"amount": number;
|
|
1449
|
+
"currency": string;
|
|
1450
|
+
"buttonHeight": string;
|
|
1451
|
+
"shouldUseDefaultConfirmAction": boolean;
|
|
1452
|
+
}
|
|
1453
|
+
interface StripeLinkAuthenticationElementAttributes {
|
|
1454
|
+
"publishableKey": string;
|
|
1455
|
+
"stripeAccount": string;
|
|
1456
|
+
"applicationName": string;
|
|
1457
|
+
"defaultEmail": string;
|
|
1458
|
+
}
|
|
1459
|
+
interface StripeModalAttributes {
|
|
1460
|
+
"showCloseButton": boolean;
|
|
1461
|
+
"open": boolean;
|
|
1462
|
+
}
|
|
1463
|
+
interface StripePaymentElementAttributes {
|
|
1464
|
+
"intentType": IntentType;
|
|
1465
|
+
"sheetTitle": string;
|
|
1466
|
+
"buttonLabel": string;
|
|
1467
|
+
"publishableKey": string;
|
|
1468
|
+
"stripeAccount": string;
|
|
1469
|
+
"applicationName": string;
|
|
1470
|
+
"intentClientSecret": string;
|
|
1471
|
+
"checkoutSessionClientSecret": string;
|
|
1472
|
+
"shouldUseDefaultFormSubmitAction": boolean;
|
|
1473
|
+
}
|
|
1474
|
+
interface StripePaymentRequestButtonAttributes {
|
|
1475
|
+
"publishableKey": string;
|
|
1476
|
+
"stripeAccount": string;
|
|
1477
|
+
"applicationName": string;
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1377
1480
|
interface IntrinsicElements {
|
|
1378
|
-
"stripe-address-element": StripeAddressElement;
|
|
1379
|
-
"stripe-card-element": StripeCardElement;
|
|
1380
|
-
"stripe-card-element-modal": StripeCardElementModal;
|
|
1381
|
-
"stripe-currency-selector": StripeCurrencySelector;
|
|
1382
|
-
"stripe-express-checkout-element": StripeExpressCheckoutElement;
|
|
1383
|
-
"stripe-link-authentication-element": StripeLinkAuthenticationElement;
|
|
1384
|
-
"stripe-modal": StripeModal;
|
|
1385
|
-
"stripe-payment-element": StripePaymentElement;
|
|
1386
|
-
"stripe-payment-request-button": StripePaymentRequestButton;
|
|
1481
|
+
"stripe-address-element": Omit<StripeAddressElement, keyof StripeAddressElementAttributes> & { [K in keyof StripeAddressElement & keyof StripeAddressElementAttributes]?: StripeAddressElement[K] } & { [K in keyof StripeAddressElement & keyof StripeAddressElementAttributes as `attr:${K}`]?: StripeAddressElementAttributes[K] } & { [K in keyof StripeAddressElement & keyof StripeAddressElementAttributes as `prop:${K}`]?: StripeAddressElement[K] };
|
|
1482
|
+
"stripe-card-element": Omit<StripeCardElement, keyof StripeCardElementAttributes> & { [K in keyof StripeCardElement & keyof StripeCardElementAttributes]?: StripeCardElement[K] } & { [K in keyof StripeCardElement & keyof StripeCardElementAttributes as `attr:${K}`]?: StripeCardElementAttributes[K] } & { [K in keyof StripeCardElement & keyof StripeCardElementAttributes as `prop:${K}`]?: StripeCardElement[K] };
|
|
1483
|
+
"stripe-card-element-modal": Omit<StripeCardElementModal, keyof StripeCardElementModalAttributes> & { [K in keyof StripeCardElementModal & keyof StripeCardElementModalAttributes]?: StripeCardElementModal[K] } & { [K in keyof StripeCardElementModal & keyof StripeCardElementModalAttributes as `attr:${K}`]?: StripeCardElementModalAttributes[K] } & { [K in keyof StripeCardElementModal & keyof StripeCardElementModalAttributes as `prop:${K}`]?: StripeCardElementModal[K] };
|
|
1484
|
+
"stripe-currency-selector": Omit<StripeCurrencySelector, keyof StripeCurrencySelectorAttributes> & { [K in keyof StripeCurrencySelector & keyof StripeCurrencySelectorAttributes]?: StripeCurrencySelector[K] } & { [K in keyof StripeCurrencySelector & keyof StripeCurrencySelectorAttributes as `attr:${K}`]?: StripeCurrencySelectorAttributes[K] } & { [K in keyof StripeCurrencySelector & keyof StripeCurrencySelectorAttributes as `prop:${K}`]?: StripeCurrencySelector[K] };
|
|
1485
|
+
"stripe-express-checkout-element": Omit<StripeExpressCheckoutElement, keyof StripeExpressCheckoutElementAttributes> & { [K in keyof StripeExpressCheckoutElement & keyof StripeExpressCheckoutElementAttributes]?: StripeExpressCheckoutElement[K] } & { [K in keyof StripeExpressCheckoutElement & keyof StripeExpressCheckoutElementAttributes as `attr:${K}`]?: StripeExpressCheckoutElementAttributes[K] } & { [K in keyof StripeExpressCheckoutElement & keyof StripeExpressCheckoutElementAttributes as `prop:${K}`]?: StripeExpressCheckoutElement[K] };
|
|
1486
|
+
"stripe-link-authentication-element": Omit<StripeLinkAuthenticationElement, keyof StripeLinkAuthenticationElementAttributes> & { [K in keyof StripeLinkAuthenticationElement & keyof StripeLinkAuthenticationElementAttributes]?: StripeLinkAuthenticationElement[K] } & { [K in keyof StripeLinkAuthenticationElement & keyof StripeLinkAuthenticationElementAttributes as `attr:${K}`]?: StripeLinkAuthenticationElementAttributes[K] } & { [K in keyof StripeLinkAuthenticationElement & keyof StripeLinkAuthenticationElementAttributes as `prop:${K}`]?: StripeLinkAuthenticationElement[K] };
|
|
1487
|
+
"stripe-modal": Omit<StripeModal, keyof StripeModalAttributes> & { [K in keyof StripeModal & keyof StripeModalAttributes]?: StripeModal[K] } & { [K in keyof StripeModal & keyof StripeModalAttributes as `attr:${K}`]?: StripeModalAttributes[K] } & { [K in keyof StripeModal & keyof StripeModalAttributes as `prop:${K}`]?: StripeModal[K] };
|
|
1488
|
+
"stripe-payment-element": Omit<StripePaymentElement, keyof StripePaymentElementAttributes> & { [K in keyof StripePaymentElement & keyof StripePaymentElementAttributes]?: StripePaymentElement[K] } & { [K in keyof StripePaymentElement & keyof StripePaymentElementAttributes as `attr:${K}`]?: StripePaymentElementAttributes[K] } & { [K in keyof StripePaymentElement & keyof StripePaymentElementAttributes as `prop:${K}`]?: StripePaymentElement[K] };
|
|
1489
|
+
"stripe-payment-request-button": Omit<StripePaymentRequestButton, keyof StripePaymentRequestButtonAttributes> & { [K in keyof StripePaymentRequestButton & keyof StripePaymentRequestButtonAttributes]?: StripePaymentRequestButton[K] } & { [K in keyof StripePaymentRequestButton & keyof StripePaymentRequestButtonAttributes as `attr:${K}`]?: StripePaymentRequestButtonAttributes[K] } & { [K in keyof StripePaymentRequestButton & keyof StripePaymentRequestButtonAttributes as `prop:${K}`]?: StripePaymentRequestButton[K] };
|
|
1387
1490
|
}
|
|
1388
1491
|
}
|
|
1389
1492
|
export { LocalJSX as JSX };
|
|
1390
1493
|
declare module "@stencil/core" {
|
|
1391
1494
|
export namespace JSX {
|
|
1392
1495
|
interface IntrinsicElements {
|
|
1393
|
-
"stripe-address-element": LocalJSX.
|
|
1394
|
-
"stripe-card-element": LocalJSX.
|
|
1395
|
-
"stripe-card-element-modal": LocalJSX.
|
|
1496
|
+
"stripe-address-element": LocalJSX.IntrinsicElements["stripe-address-element"] & JSXBase.HTMLAttributes<HTMLStripeAddressElementElement>;
|
|
1497
|
+
"stripe-card-element": LocalJSX.IntrinsicElements["stripe-card-element"] & JSXBase.HTMLAttributes<HTMLStripeCardElementElement>;
|
|
1498
|
+
"stripe-card-element-modal": LocalJSX.IntrinsicElements["stripe-card-element-modal"] & JSXBase.HTMLAttributes<HTMLStripeCardElementModalElement>;
|
|
1396
1499
|
/**
|
|
1397
1500
|
* Stripe Currency Selector Element
|
|
1398
1501
|
* Allows customers to select their preferred currency for Adaptive Pricing
|
|
1399
1502
|
* @info https://docs.stripe.com/elements/currency-selector-element
|
|
1400
1503
|
*/
|
|
1401
|
-
"stripe-currency-selector": LocalJSX.
|
|
1504
|
+
"stripe-currency-selector": LocalJSX.IntrinsicElements["stripe-currency-selector"] & JSXBase.HTMLAttributes<HTMLStripeCurrencySelectorElement>;
|
|
1402
1505
|
/**
|
|
1403
1506
|
* Express Checkout Element Component
|
|
1404
1507
|
* Provides one-click payment methods (Apple Pay, Google Pay, Link, PayPal, etc.)
|
|
@@ -1411,11 +1514,18 @@ declare module "@stencil/core" {
|
|
|
1411
1514
|
* />
|
|
1412
1515
|
* ```
|
|
1413
1516
|
*/
|
|
1414
|
-
"stripe-express-checkout-element": LocalJSX.
|
|
1415
|
-
"stripe-link-authentication-element": LocalJSX.
|
|
1416
|
-
"stripe-modal": LocalJSX.
|
|
1417
|
-
"stripe-payment-element": LocalJSX.
|
|
1418
|
-
|
|
1517
|
+
"stripe-express-checkout-element": LocalJSX.IntrinsicElements["stripe-express-checkout-element"] & JSXBase.HTMLAttributes<HTMLStripeExpressCheckoutElementElement>;
|
|
1518
|
+
"stripe-link-authentication-element": LocalJSX.IntrinsicElements["stripe-link-authentication-element"] & JSXBase.HTMLAttributes<HTMLStripeLinkAuthenticationElementElement>;
|
|
1519
|
+
"stripe-modal": LocalJSX.IntrinsicElements["stripe-modal"] & JSXBase.HTMLAttributes<HTMLStripeModalElement>;
|
|
1520
|
+
"stripe-payment-element": LocalJSX.IntrinsicElements["stripe-payment-element"] & JSXBase.HTMLAttributes<HTMLStripePaymentElementElement>;
|
|
1521
|
+
/**
|
|
1522
|
+
* @deprecated `stripe-payment-request-button` is deprecated and will be removed in a future release.
|
|
1523
|
+
* `stripe.paymentRequest()` is being removed in Stripe.js 9.x (deprecated as of 2025-09-30 / 2026-03-25).
|
|
1524
|
+
* Please migrate to `<stripe-express-checkout-element>` which supports Apple Pay, Google Pay, Link, PayPal,
|
|
1525
|
+
* and more via the modern Express Checkout Element API.
|
|
1526
|
+
* Migration guide: https://hideokamoto.github.io/stripe-pwa-elements/guides/migrate-payment-request-button-to-express-checkout/
|
|
1527
|
+
*/
|
|
1528
|
+
"stripe-payment-request-button": LocalJSX.IntrinsicElements["stripe-payment-request-button"] & JSXBase.HTMLAttributes<HTMLStripePaymentRequestButtonElement>;
|
|
1419
1529
|
}
|
|
1420
1530
|
}
|
|
1421
1531
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { Components, JSX } from './components';
|
|
2
|
+
export type { FormSubmitEvent, FormSubmitHandler, StripeLoadedEvent, StripeDidLoadedHandler, ProgressStatus, IntentType, InitStripeOptions, LinkAuthenticationElementChangeEvent, LinkAuthenticationElementChangeHandler, CurrencySelectorChangeEvent, CurrencySelectorChangeHandler, DefaultFormSubmitResult, } from './interfaces';
|
|
2
3
|
import 'ionicons';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Stripe, StripeElements, StripeCardNumberElement, StripeCardExpiryElement, StripeCardCvcElement, StripePaymentElement, StripeAddressElement, StripeLinkAuthenticationElement, StripeCurrencySelectorElement, StripeExpressCheckoutElement, StripeExpressCheckoutElementConfirmEvent, StripeExpressCheckoutElementClickEvent, StripeExpressCheckoutElementShippingAddressChangeEvent, StripeExpressCheckoutElementShippingRateChangeEvent,
|
|
1
|
+
import { Stripe, StripeElements, StripeCardNumberElement, StripeCardExpiryElement, StripeCardCvcElement, StripePaymentElement, StripeAddressElement, StripeLinkAuthenticationElement, StripeCurrencySelectorElement, StripeExpressCheckoutElement, StripeExpressCheckoutElementConfirmEvent, StripeExpressCheckoutElementClickEvent, StripeExpressCheckoutElementShippingAddressChangeEvent, StripeExpressCheckoutElementShippingRateChangeEvent, StripeCheckoutElementsSdk, StripeCheckoutElementsOptions } from '@stripe/stripe-js';
|
|
2
2
|
import { ProgressStatus } from '../interfaces';
|
|
3
3
|
/**
|
|
4
4
|
* Checkout session initialization options
|
|
@@ -19,7 +19,7 @@ export type StripeServiceState = {
|
|
|
19
19
|
/**
|
|
20
20
|
* Checkout instance for Checkout Session mode
|
|
21
21
|
*/
|
|
22
|
-
checkout?:
|
|
22
|
+
checkout?: StripeCheckoutElementsSdk;
|
|
23
23
|
/**
|
|
24
24
|
* Whether the service is initialized with Checkout Session
|
|
25
25
|
*/
|
|
@@ -101,7 +101,7 @@ export interface IStripeService {
|
|
|
101
101
|
/**
|
|
102
102
|
* Get Checkout instance (for Checkout Session mode)
|
|
103
103
|
*/
|
|
104
|
-
getCheckout():
|
|
104
|
+
getCheckout(): StripeCheckoutElementsSdk | undefined;
|
|
105
105
|
/**
|
|
106
106
|
* Reset service (for testing)
|
|
107
107
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Stripe, StripeElements,
|
|
1
|
+
import { Stripe, StripeElements, StripeCheckoutElementsSdk } from '@stripe/stripe-js';
|
|
2
2
|
import type { IStripeService, StripeServiceState, CheckoutSessionOptions } from './interfaces';
|
|
3
3
|
/**
|
|
4
4
|
* Core Stripe Service
|
|
@@ -50,7 +50,7 @@ declare class StripeServiceClass implements IStripeService {
|
|
|
50
50
|
/**
|
|
51
51
|
* Get the current Checkout instance (for Checkout Session mode)
|
|
52
52
|
*/
|
|
53
|
-
getCheckout():
|
|
53
|
+
getCheckout(): StripeCheckoutElementsSdk | undefined;
|
|
54
54
|
/**
|
|
55
55
|
* Reset the service to initial state
|
|
56
56
|
* Useful for testing and cleanup
|