stripe-pwa-elements 3.2.0 → 4.0.1

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.
Files changed (237) hide show
  1. package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -3
  2. package/dist/cjs/error-FFC4kSs5.js +0 -3
  3. package/dist/cjs/{factory-CbbbSvkg.js → factory-Cd2VI_N2.js} +216 -77
  4. package/dist/cjs/{index-Ba1pBePA.js → index-CYbA1N_k.js} +24 -6
  5. package/dist/cjs/index-Dkb0SxZc.js +4694 -0
  6. package/dist/cjs/index.cjs.js +0 -1
  7. package/dist/cjs/ion-icon.cjs.entry.js +22 -13
  8. package/dist/cjs/loader.cjs.js +2 -3
  9. package/dist/cjs/stripe-address-element.cjs.entry.js +41 -26
  10. package/dist/cjs/stripe-card-element-modal.cjs.entry.js +6 -7
  11. package/dist/cjs/stripe-card-element_2.cjs.entry.js +129 -72
  12. package/dist/cjs/stripe-currency-selector.cjs.entry.js +20 -10
  13. package/dist/cjs/stripe-elements.cjs.js +31 -5
  14. package/dist/cjs/stripe-express-checkout-element.cjs.entry.js +32 -22
  15. package/dist/cjs/stripe-link-authentication-element.cjs.entry.js +20 -10
  16. package/dist/cjs/stripe-payment-element.cjs.entry.js +283 -167
  17. package/dist/cjs/stripe-payment-request-button.cjs.entry.js +30 -18
  18. package/dist/collection/collection-manifest.json +6 -5
  19. package/dist/collection/components/stripe-address-element/stripe-address-element.js +36 -21
  20. package/dist/collection/components/stripe-card-element/stripe-card-element.helpers.js +57 -0
  21. package/dist/collection/components/stripe-card-element/stripe-card-element.js +62 -68
  22. package/dist/collection/components/stripe-card-element-modal/stripe-card-element-modal.js +15 -11
  23. package/dist/collection/components/stripe-currency-selector/stripe-currency-selector.js +17 -6
  24. package/dist/collection/components/stripe-express-checkout-element/stripe-express-checkout-element.js +35 -20
  25. package/dist/collection/components/stripe-link-authentication-element/stripe-link-authentication-element.js +19 -7
  26. package/dist/collection/components/stripe-modal/stripe-modal.js +18 -7
  27. package/dist/collection/components/stripe-payment-element/stripe-payment-element.helpers.js +114 -0
  28. package/dist/collection/components/stripe-payment-element/stripe-payment-element.js +162 -162
  29. package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js +48 -19
  30. package/dist/collection/index.js +0 -1
  31. package/dist/collection/interfaces.js +0 -1
  32. package/dist/collection/services/address-element-manager.js +3 -4
  33. package/dist/collection/services/card-element-manager.js +3 -4
  34. package/dist/collection/services/currency-selector-element-manager.js +3 -4
  35. package/dist/collection/services/express-checkout-element-manager.js +9 -10
  36. package/dist/collection/services/factory.js +0 -1
  37. package/dist/collection/services/interfaces.js +0 -1
  38. package/dist/collection/services/link-authentication-element-manager.js +3 -4
  39. package/dist/collection/services/payment-element-manager.js +4 -5
  40. package/dist/collection/services/stripe-service.js +27 -10
  41. package/dist/collection/utils/element-finder.js +2 -3
  42. package/dist/collection/utils/error.js +0 -1
  43. package/dist/collection/utils/i18n.js +0 -1
  44. package/dist/collection/utils/platform.js +0 -1
  45. package/dist/collection/utils/test-setup.js +0 -1
  46. package/dist/collection/utils/utils.js +2 -3
  47. package/dist/components/error.js +1 -16
  48. package/dist/components/factory.js +1 -3736
  49. package/dist/components/icon.js +1 -459
  50. package/dist/components/index.d.ts +2 -0
  51. package/dist/components/index.js +1 -4
  52. package/dist/components/index2.js +1 -192
  53. package/dist/components/ion-icon.js +1 -9
  54. package/dist/components/stripe-address-element.js +1 -327
  55. package/dist/components/stripe-card-element-modal.js +1 -174
  56. package/dist/components/stripe-card-element.js +1 -9
  57. package/dist/components/stripe-card-element2.js +1 -440
  58. package/dist/components/stripe-currency-selector.js +1 -218
  59. package/dist/components/stripe-express-checkout-element.js +1 -332
  60. package/dist/components/stripe-link-authentication-element.js +1 -256
  61. package/dist/components/stripe-modal.js +1 -9
  62. package/dist/components/stripe-modal2.js +1 -112
  63. package/dist/components/stripe-payment-element.js +1 -510
  64. package/dist/components/stripe-payment-request-button.js +1 -9
  65. package/dist/components/stripe-payment-request-button2.js +1 -224
  66. package/dist/components/utils.js +1 -89
  67. package/dist/esm/app-globals-DQuL1Twl.js +0 -3
  68. package/dist/esm/error-XRfh5Wrs.js +0 -3
  69. package/dist/esm/{factory-Drde6-y7.js → factory-VTa1Gc94.js} +216 -77
  70. package/dist/esm/index-C6bbmyga.js +4677 -0
  71. package/dist/esm/{index-BHDCxQOb.js → index-CBXaOfXU.js} +24 -6
  72. package/dist/esm/index.js +0 -1
  73. package/dist/esm/ion-icon.entry.js +22 -13
  74. package/dist/esm/loader.js +3 -4
  75. package/dist/esm/stripe-address-element.entry.js +41 -26
  76. package/dist/esm/stripe-card-element-modal.entry.js +6 -7
  77. package/dist/esm/stripe-card-element_2.entry.js +129 -72
  78. package/dist/esm/stripe-currency-selector.entry.js +20 -10
  79. package/dist/esm/stripe-elements.js +32 -6
  80. package/dist/esm/stripe-express-checkout-element.entry.js +32 -22
  81. package/dist/esm/stripe-link-authentication-element.entry.js +20 -10
  82. package/dist/esm/stripe-payment-element.entry.js +283 -167
  83. package/dist/esm/stripe-payment-request-button.entry.js +27 -15
  84. package/dist/stripe-elements/index.esm.js +0 -2
  85. package/dist/stripe-elements/p-1bd46766.entry.js +1 -0
  86. package/dist/stripe-elements/p-1c6e0a45.entry.js +1 -0
  87. package/dist/stripe-elements/p-3f42ca0c.entry.js +1 -0
  88. package/dist/stripe-elements/p-5cf62945.entry.js +1 -0
  89. package/dist/stripe-elements/p-74de1556.entry.js +1 -0
  90. package/dist/stripe-elements/p-76e57d78.entry.js +1 -0
  91. package/dist/stripe-elements/p-840d499f.entry.js +1 -0
  92. package/dist/stripe-elements/p-C6bbmyga.js +2 -0
  93. package/dist/stripe-elements/p-CBXaOfXU.js +1 -0
  94. package/dist/stripe-elements/p-CrjrbGJ3.js +1 -0
  95. package/dist/stripe-elements/p-DQuL1Twl.js +1 -2
  96. package/dist/stripe-elements/p-XRfh5Wrs.js +1 -2
  97. package/dist/stripe-elements/p-ae0c336e.entry.js +1 -0
  98. package/dist/stripe-elements/p-cfd8e081.entry.js +1 -0
  99. package/dist/stripe-elements/stripe-elements.esm.js +1 -2
  100. package/dist/stripe-elements/svg/.gitignore +4 -0
  101. package/dist/types/components/stripe-address-element/stripe-address-element.d.ts +6 -0
  102. package/dist/types/components/stripe-card-element/stripe-card-element.d.ts +11 -1
  103. package/dist/types/components/stripe-card-element/stripe-card-element.helpers.d.ts +29 -0
  104. package/dist/types/components/stripe-card-element-modal/stripe-card-element-modal.d.ts +4 -4
  105. package/dist/types/components/stripe-currency-selector/stripe-currency-selector.d.ts +6 -0
  106. package/dist/types/components/stripe-express-checkout-element/stripe-express-checkout-element.d.ts +6 -0
  107. package/dist/types/components/stripe-link-authentication-element/stripe-link-authentication-element.d.ts +6 -0
  108. package/dist/types/components/stripe-modal/stripe-modal.d.ts +1 -0
  109. package/dist/types/components/stripe-payment-element/stripe-payment-element.d.ts +20 -2
  110. package/dist/types/components/stripe-payment-element/stripe-payment-element.helpers.d.ts +54 -0
  111. package/dist/types/components/stripe-payment-request-button/stripe-payment-request-button.d.ts +14 -1
  112. package/dist/types/components.d.ts +139 -29
  113. package/dist/types/index.d.ts +1 -0
  114. package/dist/types/services/interfaces.d.ts +4 -3
  115. package/dist/types/services/stripe-service.d.ts +8 -4
  116. package/dist/types/stencil-public-runtime.d.ts +110 -5
  117. package/package.json +50 -30
  118. package/readme.md +386 -133
  119. package/dist/cjs/app-globals-V2Kpy_OQ.js.map +0 -1
  120. package/dist/cjs/error-FFC4kSs5.js.map +0 -1
  121. package/dist/cjs/factory-CbbbSvkg.js.map +0 -1
  122. package/dist/cjs/index-BXVW_rzh.js +0 -1932
  123. package/dist/cjs/index-BXVW_rzh.js.map +0 -1
  124. package/dist/cjs/index-Ba1pBePA.js.map +0 -1
  125. package/dist/cjs/index.cjs.js.map +0 -1
  126. package/dist/cjs/ion-icon.entry.cjs.js.map +0 -1
  127. package/dist/cjs/loader.cjs.js.map +0 -1
  128. package/dist/cjs/stripe-address-element.entry.cjs.js.map +0 -1
  129. package/dist/cjs/stripe-card-element-modal.entry.cjs.js.map +0 -1
  130. package/dist/cjs/stripe-card-element.stripe-modal.entry.cjs.js.map +0 -1
  131. package/dist/cjs/stripe-currency-selector.entry.cjs.js.map +0 -1
  132. package/dist/cjs/stripe-elements.cjs.js.map +0 -1
  133. package/dist/cjs/stripe-express-checkout-element.entry.cjs.js.map +0 -1
  134. package/dist/cjs/stripe-link-authentication-element.entry.cjs.js.map +0 -1
  135. package/dist/cjs/stripe-payment-element.entry.cjs.js.map +0 -1
  136. package/dist/cjs/stripe-payment-request-button.entry.cjs.js.map +0 -1
  137. package/dist/collection/components/stripe-address-element/stripe-address-element.js.map +0 -1
  138. package/dist/collection/components/stripe-card-element/stripe-card-element.js.map +0 -1
  139. package/dist/collection/components/stripe-card-element-modal/stripe-card-element-modal.js.map +0 -1
  140. package/dist/collection/components/stripe-currency-selector/stripe-currency-selector.js.map +0 -1
  141. package/dist/collection/components/stripe-express-checkout-element/stripe-express-checkout-element.js.map +0 -1
  142. package/dist/collection/components/stripe-link-authentication-element/stripe-link-authentication-element.js.map +0 -1
  143. package/dist/collection/components/stripe-modal/stripe-modal.js.map +0 -1
  144. package/dist/collection/components/stripe-payment-element/stripe-payment-element.js.map +0 -1
  145. package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js.map +0 -1
  146. package/dist/collection/index.js.map +0 -1
  147. package/dist/collection/interfaces.js.map +0 -1
  148. package/dist/collection/services/address-element-manager.js.map +0 -1
  149. package/dist/collection/services/card-element-manager.js.map +0 -1
  150. package/dist/collection/services/currency-selector-element-manager.js.map +0 -1
  151. package/dist/collection/services/express-checkout-element-manager.js.map +0 -1
  152. package/dist/collection/services/factory.js.map +0 -1
  153. package/dist/collection/services/interfaces.js.map +0 -1
  154. package/dist/collection/services/link-authentication-element-manager.js.map +0 -1
  155. package/dist/collection/services/payment-element-manager.js.map +0 -1
  156. package/dist/collection/services/stripe-service.js.map +0 -1
  157. package/dist/collection/utils/element-finder.js.map +0 -1
  158. package/dist/collection/utils/error.js.map +0 -1
  159. package/dist/collection/utils/i18n.js.map +0 -1
  160. package/dist/collection/utils/platform.js.map +0 -1
  161. package/dist/collection/utils/test-setup.js.map +0 -1
  162. package/dist/collection/utils/utils.js.map +0 -1
  163. package/dist/components/error.js.map +0 -1
  164. package/dist/components/factory.js.map +0 -1
  165. package/dist/components/icon.js.map +0 -1
  166. package/dist/components/index.js.map +0 -1
  167. package/dist/components/index2.js.map +0 -1
  168. package/dist/components/ion-icon.js.map +0 -1
  169. package/dist/components/stripe-address-element.js.map +0 -1
  170. package/dist/components/stripe-card-element-modal.js.map +0 -1
  171. package/dist/components/stripe-card-element.js.map +0 -1
  172. package/dist/components/stripe-card-element2.js.map +0 -1
  173. package/dist/components/stripe-currency-selector.js.map +0 -1
  174. package/dist/components/stripe-express-checkout-element.js.map +0 -1
  175. package/dist/components/stripe-link-authentication-element.js.map +0 -1
  176. package/dist/components/stripe-modal.js.map +0 -1
  177. package/dist/components/stripe-modal2.js.map +0 -1
  178. package/dist/components/stripe-payment-element.js.map +0 -1
  179. package/dist/components/stripe-payment-request-button.js.map +0 -1
  180. package/dist/components/stripe-payment-request-button2.js.map +0 -1
  181. package/dist/components/utils.js.map +0 -1
  182. package/dist/esm/app-globals-DQuL1Twl.js.map +0 -1
  183. package/dist/esm/error-XRfh5Wrs.js.map +0 -1
  184. package/dist/esm/factory-Drde6-y7.js.map +0 -1
  185. package/dist/esm/index-BHDCxQOb.js.map +0 -1
  186. package/dist/esm/index-DJwTOfxZ.js +0 -1920
  187. package/dist/esm/index-DJwTOfxZ.js.map +0 -1
  188. package/dist/esm/index.js.map +0 -1
  189. package/dist/esm/ion-icon.entry.js.map +0 -1
  190. package/dist/esm/loader.js.map +0 -1
  191. package/dist/esm/stripe-address-element.entry.js.map +0 -1
  192. package/dist/esm/stripe-card-element-modal.entry.js.map +0 -1
  193. package/dist/esm/stripe-card-element.stripe-modal.entry.js.map +0 -1
  194. package/dist/esm/stripe-currency-selector.entry.js.map +0 -1
  195. package/dist/esm/stripe-elements.js.map +0 -1
  196. package/dist/esm/stripe-express-checkout-element.entry.js.map +0 -1
  197. package/dist/esm/stripe-link-authentication-element.entry.js.map +0 -1
  198. package/dist/esm/stripe-payment-element.entry.js.map +0 -1
  199. package/dist/esm/stripe-payment-request-button.entry.js.map +0 -1
  200. package/dist/stripe-elements/index.esm.js.map +0 -1
  201. package/dist/stripe-elements/ion-icon.entry.esm.js.map +0 -1
  202. package/dist/stripe-elements/loader.esm.js.map +0 -1
  203. package/dist/stripe-elements/p-02f6e421.entry.js +0 -2
  204. package/dist/stripe-elements/p-02f6e421.entry.js.map +0 -1
  205. package/dist/stripe-elements/p-19888fa6.entry.js +0 -2
  206. package/dist/stripe-elements/p-19888fa6.entry.js.map +0 -1
  207. package/dist/stripe-elements/p-4d505729.entry.js +0 -2
  208. package/dist/stripe-elements/p-4d505729.entry.js.map +0 -1
  209. package/dist/stripe-elements/p-7e7ad92a.entry.js +0 -2
  210. package/dist/stripe-elements/p-7e7ad92a.entry.js.map +0 -1
  211. package/dist/stripe-elements/p-8bb4212c.entry.js +0 -2
  212. package/dist/stripe-elements/p-8bb4212c.entry.js.map +0 -1
  213. package/dist/stripe-elements/p-9aee2b6b.entry.js +0 -2
  214. package/dist/stripe-elements/p-9aee2b6b.entry.js.map +0 -1
  215. package/dist/stripe-elements/p-BHDCxQOb.js +0 -2
  216. package/dist/stripe-elements/p-BHDCxQOb.js.map +0 -1
  217. package/dist/stripe-elements/p-DI2vmGaI.js +0 -2
  218. package/dist/stripe-elements/p-DI2vmGaI.js.map +0 -1
  219. package/dist/stripe-elements/p-DJwTOfxZ.js +0 -3
  220. package/dist/stripe-elements/p-DJwTOfxZ.js.map +0 -1
  221. package/dist/stripe-elements/p-DQuL1Twl.js.map +0 -1
  222. package/dist/stripe-elements/p-XRfh5Wrs.js.map +0 -1
  223. package/dist/stripe-elements/p-ba251393.entry.js +0 -2
  224. package/dist/stripe-elements/p-ba251393.entry.js.map +0 -1
  225. package/dist/stripe-elements/p-c649edfc.entry.js +0 -2
  226. package/dist/stripe-elements/p-c649edfc.entry.js.map +0 -1
  227. package/dist/stripe-elements/p-e8bb43ae.entry.js +0 -2
  228. package/dist/stripe-elements/p-e8bb43ae.entry.js.map +0 -1
  229. package/dist/stripe-elements/stripe-address-element.entry.esm.js.map +0 -1
  230. package/dist/stripe-elements/stripe-card-element-modal.entry.esm.js.map +0 -1
  231. package/dist/stripe-elements/stripe-card-element.stripe-modal.entry.esm.js.map +0 -1
  232. package/dist/stripe-elements/stripe-currency-selector.entry.esm.js.map +0 -1
  233. package/dist/stripe-elements/stripe-elements.esm.js.map +0 -1
  234. package/dist/stripe-elements/stripe-express-checkout-element.entry.esm.js.map +0 -1
  235. package/dist/stripe-elements/stripe-link-authentication-element.entry.esm.js.map +0 -1
  236. package/dist/stripe-elements/stripe-payment-element.entry.esm.js.map +0 -1
  237. package/dist/stripe-elements/stripe-payment-request-button.entry.esm.js.map +0 -1
@@ -1,6 +1,21 @@
1
1
  import { h, Host } from "@stencil/core";
2
2
  import { loadStripe } from "@stripe/stripe-js";
3
+ /**
4
+ * @deprecated `stripe-payment-request-button` is deprecated and will be removed in a future release.
5
+ * `stripe.paymentRequest()` is being removed in Stripe.js 9.x (deprecated as of 2025-09-30 / 2026-03-25).
6
+ * Please migrate to `<stripe-express-checkout-element>` which supports Apple Pay, Google Pay, Link, PayPal,
7
+ * and more via the modern Express Checkout Element API.
8
+ * Migration guide: https://hideokamoto.github.io/stripe-pwa-elements/guides/migrate-payment-request-button-to-express-checkout/
9
+ */
3
10
  export class StripePaymentRequestButton {
11
+ constructor() {
12
+ this.loadStripeStatus = '';
13
+ /**
14
+ * Overwrite the application name that registered
15
+ * For wrapper library (like Capacitor)
16
+ */
17
+ this.applicationName = 'stripe-pwa-elements';
18
+ }
4
19
  /**
5
20
  * Check isAvailable ApplePay or GooglePay.
6
21
  * If you run this method, you should run before initStripe.
@@ -53,13 +68,12 @@ export class StripePaymentRequestButton {
53
68
  }
54
69
  this.stripeLoaded.emit(event);
55
70
  }
56
- constructor() {
57
- this.loadStripeStatus = '';
58
- /**
59
- * Overwrite the application name that registered
60
- * For wrapper library (like Capacitor)
61
- */
62
- this.applicationName = 'stripe-pwa-elements';
71
+ /**
72
+ * Props are not yet populated inside the constructor when the component is registered via
73
+ * the custom-elements build (`dist/components/*`), so initialization that depends on them
74
+ * must run in `componentWillLoad`, where both the lazy and custom-elements builds have them set.
75
+ */
76
+ componentWillLoad() {
63
77
  if (this.publishableKey !== undefined && this.paymentRequestOption !== undefined) {
64
78
  this.initStripe(this.publishableKey, {
65
79
  stripeAccount: this.stripeAccount,
@@ -69,6 +83,12 @@ export class StripePaymentRequestButton {
69
83
  this.loadStripeStatus = 'failure';
70
84
  }
71
85
  }
86
+ connectedCallback() {
87
+ console.warn('[stripe-pwa-elements] <stripe-payment-request-button> is deprecated. ' +
88
+ 'stripe.paymentRequest() is being removed in Stripe.js 9.x (deprecated 2025-09-30 / removed 2026-03-25). ' +
89
+ 'Please migrate to <stripe-express-checkout-element>, which supports Apple Pay, Google Pay, Link, PayPal, and more. ' +
90
+ 'Migration guide: https://hideokamoto.github.io/stripe-pwa-elements/guides/migrate-payment-request-button-to-express-checkout/');
91
+ }
72
92
  /**
73
93
  * @param option
74
94
  * @private
@@ -174,7 +194,7 @@ export class StripePaymentRequestButton {
174
194
  this.stripe = undefined;
175
195
  }
176
196
  render() {
177
- return (h(Host, { key: 'd1c4a5e286c1d7f2bc7635b65be77cf0e02923e7' }, h("div", { key: '401052df6a5ed567776395a45b8c686c4653d630', id: "payment-request" }, h("div", { key: '0b9b37b9100ed528da08766e8d276578893c70c9', id: "payment-request-button" })), h("slot", { key: 'f9f88bd9f191aa26c1a273e780fc4cc0bc3081e3' })));
197
+ return (h(Host, { key: 'dd3ae348f9e9c798acdeca095ad9c157afd4734f' }, h("div", { key: 'f2e13b6980318ede1812d4f54223b7aeb9cfc51b', id: "payment-request" }, h("div", { key: 'ff6c1218924044d1ffc11354909f25c1745ef254', id: "payment-request-button" })), h("slot", { key: 'ec2131a0503baa15cdcf3571040e9ce6040da708' })));
178
198
  }
179
199
  static get is() { return "stripe-payment-request-button"; }
180
200
  static get originalStyleUrls() {
@@ -199,7 +219,8 @@ export class StripePaymentRequestButton {
199
219
  "PaymentRequestPaymentMethodEventHandler": {
200
220
  "location": "import",
201
221
  "path": "../../interfaces",
202
- "id": "src/interfaces.ts::PaymentRequestPaymentMethodEventHandler"
222
+ "id": "src/interfaces.ts::PaymentRequestPaymentMethodEventHandler",
223
+ "referenceLocation": "PaymentRequestPaymentMethodEventHandler"
203
224
  }
204
225
  }
205
226
  },
@@ -225,7 +246,8 @@ export class StripePaymentRequestButton {
225
246
  "PaymentRequestShippingOptionEventHandler": {
226
247
  "location": "import",
227
248
  "path": "../../interfaces",
228
- "id": "src/interfaces.ts::PaymentRequestShippingOptionEventHandler"
249
+ "id": "src/interfaces.ts::PaymentRequestShippingOptionEventHandler",
250
+ "referenceLocation": "PaymentRequestShippingOptionEventHandler"
229
251
  }
230
252
  }
231
253
  },
@@ -251,7 +273,8 @@ export class StripePaymentRequestButton {
251
273
  "PaymentRequestShippingAddressEventHandler": {
252
274
  "location": "import",
253
275
  "path": "../../interfaces",
254
- "id": "src/interfaces.ts::PaymentRequestShippingAddressEventHandler"
276
+ "id": "src/interfaces.ts::PaymentRequestShippingAddressEventHandler",
277
+ "referenceLocation": "PaymentRequestShippingAddressEventHandler"
255
278
  }
256
279
  }
257
280
  },
@@ -338,7 +361,8 @@ export class StripePaymentRequestButton {
338
361
  "StripeDidLoadedHandler": {
339
362
  "location": "import",
340
363
  "path": "../../interfaces",
341
- "id": "src/interfaces.ts::StripeDidLoadedHandler"
364
+ "id": "src/interfaces.ts::StripeDidLoadedHandler",
365
+ "referenceLocation": "StripeDidLoadedHandler"
342
366
  }
343
367
  }
344
368
  },
@@ -381,7 +405,8 @@ export class StripePaymentRequestButton {
381
405
  "StripeLoadedEvent": {
382
406
  "location": "import",
383
407
  "path": "../../interfaces",
384
- "id": "src/interfaces.ts::StripeLoadedEvent"
408
+ "id": "src/interfaces.ts::StripeLoadedEvent",
409
+ "referenceLocation": "StripeLoadedEvent"
385
410
  }
386
411
  }
387
412
  }
@@ -405,7 +430,8 @@ export class StripePaymentRequestButton {
405
430
  "PaymentRequestWallet": {
406
431
  "location": "import",
407
432
  "path": "@stripe/stripe-js",
408
- "id": "node_modules::PaymentRequestWallet"
433
+ "id": "node_modules::PaymentRequestWallet",
434
+ "referenceLocation": "PaymentRequestWallet"
409
435
  }
410
436
  },
411
437
  "return": "Promise<void>"
@@ -431,7 +457,8 @@ export class StripePaymentRequestButton {
431
457
  "PaymentRequestPaymentMethodEventHandler": {
432
458
  "location": "import",
433
459
  "path": "../../interfaces",
434
- "id": "src/interfaces.ts::PaymentRequestPaymentMethodEventHandler"
460
+ "id": "src/interfaces.ts::PaymentRequestPaymentMethodEventHandler",
461
+ "referenceLocation": "PaymentRequestPaymentMethodEventHandler"
435
462
  }
436
463
  },
437
464
  "return": "Promise<void>"
@@ -457,7 +484,8 @@ export class StripePaymentRequestButton {
457
484
  "PaymentRequestShippingOptionEventHandler": {
458
485
  "location": "import",
459
486
  "path": "../../interfaces",
460
- "id": "src/interfaces.ts::PaymentRequestShippingOptionEventHandler"
487
+ "id": "src/interfaces.ts::PaymentRequestShippingOptionEventHandler",
488
+ "referenceLocation": "PaymentRequestShippingOptionEventHandler"
461
489
  }
462
490
  },
463
491
  "return": "Promise<void>"
@@ -483,7 +511,8 @@ export class StripePaymentRequestButton {
483
511
  "PaymentRequestShippingAddressEventHandler": {
484
512
  "location": "import",
485
513
  "path": "../../interfaces",
486
- "id": "src/interfaces.ts::PaymentRequestShippingAddressEventHandler"
514
+ "id": "src/interfaces.ts::PaymentRequestShippingAddressEventHandler",
515
+ "referenceLocation": "PaymentRequestShippingAddressEventHandler"
487
516
  }
488
517
  },
489
518
  "return": "Promise<void>"
@@ -509,7 +538,8 @@ export class StripePaymentRequestButton {
509
538
  "PaymentRequestOptions": {
510
539
  "location": "import",
511
540
  "path": "@stripe/stripe-js",
512
- "id": "node_modules::PaymentRequestOptions"
541
+ "id": "node_modules::PaymentRequestOptions",
542
+ "referenceLocation": "PaymentRequestOptions"
513
543
  }
514
544
  },
515
545
  "return": "Promise<this>"
@@ -560,4 +590,3 @@ export class StripePaymentRequestButton {
560
590
  }
561
591
  static get elementRef() { return "el"; }
562
592
  }
563
- //# sourceMappingURL=stripe-payment-request-button.js.map
@@ -1,2 +1 @@
1
1
  import "ionicons";
2
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=interfaces.js.map
@@ -31,11 +31,11 @@ export class AddressElementManager {
31
31
  */
32
32
  async initialize(containerElement, options) {
33
33
  const elements = this.stripeService.getElements();
34
- if (!elements) {
34
+ if (elements == null) {
35
35
  throw new Error('StripeService not initialized. Call StripeService.initialize() first.');
36
36
  }
37
37
  // Unmount if already initialized
38
- if (this.addressElement) {
38
+ if (this.addressElement != null) {
39
39
  this.unmount();
40
40
  }
41
41
  // Create and mount address element
@@ -73,11 +73,10 @@ export class AddressElementManager {
73
73
  * Unmount address element
74
74
  */
75
75
  unmount() {
76
- if (!this.addressElement) {
76
+ if (this.addressElement == null) {
77
77
  return;
78
78
  }
79
79
  this.addressElement.unmount();
80
80
  this.addressElement = undefined;
81
81
  }
82
82
  }
83
- //# sourceMappingURL=address-element-manager.js.map
@@ -31,11 +31,11 @@ export class CardElementManager {
31
31
  */
32
32
  async initialize(containerElement) {
33
33
  const elements = this.stripeService.getElements();
34
- if (!elements) {
34
+ if (elements == null) {
35
35
  throw new Error('StripeService not initialized. Call StripeService.initialize() first.');
36
36
  }
37
37
  // Unmount if already initialized
38
- if (this.cardElements) {
38
+ if (this.cardElements != null) {
39
39
  this.unmount();
40
40
  }
41
41
  // Create and mount card number element
@@ -86,7 +86,7 @@ export class CardElementManager {
86
86
  */
87
87
  unmount() {
88
88
  var _a, _b, _c;
89
- if (!this.cardElements) {
89
+ if (this.cardElements == null) {
90
90
  return;
91
91
  }
92
92
  (_a = this.cardElements.cardNumber) === null || _a === void 0 ? void 0 : _a.unmount();
@@ -114,4 +114,3 @@ export class CardElementManager {
114
114
  };
115
115
  }
116
116
  }
117
- //# sourceMappingURL=card-element-manager.js.map
@@ -32,11 +32,11 @@ export class CurrencySelectorElementManager {
32
32
  */
33
33
  async initialize(containerElement, options) {
34
34
  const elements = this.stripeService.getElements();
35
- if (!elements) {
35
+ if (elements == null) {
36
36
  throw new Error('StripeService not initialized. Call StripeService.initialize() first.');
37
37
  }
38
38
  // Unmount if already initialized
39
- if (this.currencySelectorElement) {
39
+ if (this.currencySelectorElement != null) {
40
40
  this.unmount();
41
41
  }
42
42
  // Find mount point first to avoid element leak if findElement throws
@@ -82,11 +82,10 @@ export class CurrencySelectorElementManager {
82
82
  * Unmount currency selector element
83
83
  */
84
84
  unmount() {
85
- if (!this.currencySelectorElement) {
85
+ if (this.currencySelectorElement == null) {
86
86
  return;
87
87
  }
88
88
  this.currencySelectorElement.unmount();
89
89
  this.currencySelectorElement = undefined;
90
90
  }
91
91
  }
92
- //# sourceMappingURL=currency-selector-element-manager.js.map
@@ -32,11 +32,11 @@ export class ExpressCheckoutElementManager {
32
32
  */
33
33
  async initialize(containerElement, options, eventHandlers) {
34
34
  const elements = this.stripeService.getElements();
35
- if (!elements) {
35
+ if (elements == null) {
36
36
  throw new Error('StripeService not initialized. Call StripeService.initialize() first.');
37
37
  }
38
38
  // Unmount if already initialized
39
- if (this.expressCheckoutElement) {
39
+ if (this.expressCheckoutElement != null) {
40
40
  this.unmount();
41
41
  }
42
42
  // Convert buttonHeight from string to number if present
@@ -54,19 +54,19 @@ export class ExpressCheckoutElementManager {
54
54
  // Find the mount point
55
55
  const mountPoint = await findElement(containerElement, '#express-checkout-element');
56
56
  // Set up event handlers before mounting
57
- if (eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onConfirm) {
57
+ if ((eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onConfirm) != null) {
58
58
  expressCheckout.on('confirm', eventHandlers.onConfirm);
59
59
  }
60
- if (eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onClick) {
60
+ if ((eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onClick) != null) {
61
61
  expressCheckout.on('click', eventHandlers.onClick);
62
62
  }
63
- if (eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onCancel) {
63
+ if ((eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onCancel) != null) {
64
64
  expressCheckout.on('cancel', eventHandlers.onCancel);
65
65
  }
66
- if (eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onShippingAddressChange) {
66
+ if ((eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onShippingAddressChange) != null) {
67
67
  expressCheckout.on('shippingaddresschange', eventHandlers.onShippingAddressChange);
68
68
  }
69
- if (eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onShippingRateChange) {
69
+ if ((eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onShippingRateChange) != null) {
70
70
  expressCheckout.on('shippingratechange', eventHandlers.onShippingRateChange);
71
71
  }
72
72
  // Add ready event handler
@@ -89,7 +89,7 @@ export class ExpressCheckoutElementManager {
89
89
  * @param options - Partial options to update
90
90
  */
91
91
  update(options) {
92
- if (!this.expressCheckoutElement) {
92
+ if (this.expressCheckoutElement == null) {
93
93
  console.warn('Express Checkout Element not initialized. Cannot update options.');
94
94
  return;
95
95
  }
@@ -120,7 +120,7 @@ export class ExpressCheckoutElementManager {
120
120
  * Unmount express checkout element
121
121
  */
122
122
  unmount() {
123
- if (!this.expressCheckoutElement) {
123
+ if (this.expressCheckoutElement == null) {
124
124
  return;
125
125
  }
126
126
  this.expressCheckoutElement.unmount();
@@ -128,4 +128,3 @@ export class ExpressCheckoutElementManager {
128
128
  this.store.set('isReady', false);
129
129
  }
130
130
  }
131
- //# sourceMappingURL=express-checkout-element-manager.js.map
@@ -65,4 +65,3 @@ export class ServiceFactory {
65
65
  * Can be replaced with a mock in tests
66
66
  */
67
67
  export const serviceFactory = new ServiceFactory();
68
- //# sourceMappingURL=factory.js.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=interfaces.js.map
@@ -40,11 +40,11 @@ export class LinkAuthenticationElementManager {
40
40
  */
41
41
  async initialize(containerElement, options) {
42
42
  const elements = this.stripeService.getElements();
43
- if (!elements) {
43
+ if (elements == null) {
44
44
  throw new Error('StripeService not initialized. Call StripeService.initialize() first.');
45
45
  }
46
46
  // Unmount if already initialized
47
- if (this.linkAuthenticationElement) {
47
+ if (this.linkAuthenticationElement != null) {
48
48
  this.unmount();
49
49
  }
50
50
  // Create link authentication element
@@ -83,11 +83,10 @@ export class LinkAuthenticationElementManager {
83
83
  * Unmount link authentication element
84
84
  */
85
85
  unmount() {
86
- if (!this.linkAuthenticationElement) {
86
+ if (this.linkAuthenticationElement == null) {
87
87
  return;
88
88
  }
89
89
  this.linkAuthenticationElement.unmount();
90
90
  this.linkAuthenticationElement = undefined;
91
91
  }
92
92
  }
93
- //# sourceMappingURL=link-authentication-element-manager.js.map
@@ -33,13 +33,13 @@ export class PaymentElementManager {
33
33
  async initialize(containerElement, options) {
34
34
  const isCheckoutSession = this.stripeService.state.isCheckoutSession;
35
35
  // Unmount if already initialized
36
- if (this.paymentElement) {
36
+ if (this.paymentElement != null) {
37
37
  this.unmount();
38
38
  }
39
39
  if (isCheckoutSession) {
40
40
  // Checkout Session mode: use checkout.createPaymentElement()
41
41
  const checkout = this.stripeService.getCheckout();
42
- if (!checkout) {
42
+ if (checkout == null) {
43
43
  throw new Error('StripeService not initialized with Checkout Session. Call StripeService.initializeWithCheckoutSession() first.');
44
44
  }
45
45
  // Create payment element using Checkout instance
@@ -48,7 +48,7 @@ export class PaymentElementManager {
48
48
  else {
49
49
  // Payment Intent mode: use elements.create('payment')
50
50
  const elements = this.stripeService.getElements();
51
- if (!elements) {
51
+ if (elements == null) {
52
52
  throw new Error('StripeService not initialized. Call StripeService.initialize() first.');
53
53
  }
54
54
  // Create payment element with options
@@ -85,11 +85,10 @@ export class PaymentElementManager {
85
85
  * Unmount payment element
86
86
  */
87
87
  unmount() {
88
- if (!this.paymentElement) {
88
+ if (this.paymentElement == null) {
89
89
  return;
90
90
  }
91
91
  this.paymentElement.unmount();
92
92
  this.paymentElement = undefined;
93
93
  }
94
94
  }
95
- //# sourceMappingURL=payment-element-manager.js.map
@@ -12,6 +12,8 @@ class StripeServiceClass {
12
12
  applicationName: 'stripe-pwa-elements',
13
13
  isCheckoutSession: false,
14
14
  });
15
+ /** Incremented on every init so that a slower, older call cannot overwrite newer state */
16
+ this.initGeneration = 0;
15
17
  this.changeListeners = new Map();
16
18
  }
17
19
  /**
@@ -39,20 +41,28 @@ class StripeServiceClass {
39
41
  /**
40
42
  * Initialize Stripe.js client with Payment Intent mode
41
43
  * @param publishableKey - Your Stripe publishable API key
42
- * @param options - Optional configuration
44
+ * @param options - Optional configuration (`clientSecret` is the PaymentIntent / SetupIntent client secret)
43
45
  */
44
46
  async initialize(publishableKey, options) {
47
+ const generation = ++this.initGeneration;
48
+ // Capture the previous config before overwriting it, so we can detect real changes
49
+ const isUpToDate = this.store.state.stripe != null &&
50
+ !this.store.state.isCheckoutSession &&
51
+ this.store.state.publishableKey === publishableKey &&
52
+ this.store.state.stripeAccount === (options === null || options === void 0 ? void 0 : options.stripeAccount) &&
53
+ this.intentClientSecret === (options === null || options === void 0 ? void 0 : options.clientSecret);
45
54
  // Update configuration
46
55
  this.store.state.publishableKey = publishableKey;
47
56
  this.store.state.isCheckoutSession = false;
48
- if (options === null || options === void 0 ? void 0 : options.stripeAccount) {
57
+ this.intentClientSecret = options === null || options === void 0 ? void 0 : options.clientSecret;
58
+ if ((options === null || options === void 0 ? void 0 : options.stripeAccount) != null && (options === null || options === void 0 ? void 0 : options.stripeAccount) !== '') {
49
59
  this.store.state.stripeAccount = options.stripeAccount;
50
60
  }
51
- if (options === null || options === void 0 ? void 0 : options.applicationName) {
61
+ if ((options === null || options === void 0 ? void 0 : options.applicationName) != null && (options === null || options === void 0 ? void 0 : options.applicationName) !== '') {
52
62
  this.store.state.applicationName = options.applicationName;
53
63
  }
54
64
  // If Stripe.js already loaded with same config, do nothing
55
- if (this.store.state.stripe && this.store.state.publishableKey === publishableKey && this.store.state.stripeAccount === (options === null || options === void 0 ? void 0 : options.stripeAccount) && !this.store.state.isCheckoutSession) {
65
+ if (isUpToDate) {
56
66
  return;
57
67
  }
58
68
  this.store.state.loadStripeStatus = 'loading';
@@ -60,12 +70,16 @@ class StripeServiceClass {
60
70
  const stripe = await loadStripe(publishableKey, {
61
71
  stripeAccount: options === null || options === void 0 ? void 0 : options.stripeAccount,
62
72
  });
73
+ if (generation !== this.initGeneration) {
74
+ return;
75
+ }
63
76
  // Register app info
64
77
  stripe.registerAppInfo({
65
78
  name: this.store.state.applicationName,
66
79
  });
67
80
  this.store.state.stripe = stripe;
68
- this.store.state.elements = stripe.elements();
81
+ // Payment Element requires the client secret at Elements creation time
82
+ this.store.state.elements = (options === null || options === void 0 ? void 0 : options.clientSecret) != null && options.clientSecret !== '' ? stripe.elements({ clientSecret: options.clientSecret }) : stripe.elements();
69
83
  this.store.state.checkout = undefined;
70
84
  this.store.state.loadStripeStatus = 'success';
71
85
  }
@@ -78,16 +92,17 @@ class StripeServiceClass {
78
92
  * Initialize Stripe.js client with Checkout Session mode
79
93
  * @param publishableKey - Your Stripe publishable API key
80
94
  * @param checkoutSessionClientSecret - The client secret from Checkout Session
81
- * @param options - Optional configuration
95
+ * @param options - Optional configuration (`clientSecret` is the PaymentIntent / SetupIntent client secret)
82
96
  */
83
97
  async initializeWithCheckoutSession(publishableKey, checkoutSessionClientSecret, options) {
98
+ const generation = ++this.initGeneration;
84
99
  // Update configuration
85
100
  this.store.state.publishableKey = publishableKey;
86
101
  this.store.state.isCheckoutSession = true;
87
- if (options === null || options === void 0 ? void 0 : options.stripeAccount) {
102
+ if ((options === null || options === void 0 ? void 0 : options.stripeAccount) != null && (options === null || options === void 0 ? void 0 : options.stripeAccount) !== '') {
88
103
  this.store.state.stripeAccount = options.stripeAccount;
89
104
  }
90
- if (options === null || options === void 0 ? void 0 : options.applicationName) {
105
+ if ((options === null || options === void 0 ? void 0 : options.applicationName) != null && (options === null || options === void 0 ? void 0 : options.applicationName) !== '') {
91
106
  this.store.state.applicationName = options.applicationName;
92
107
  }
93
108
  this.store.state.loadStripeStatus = 'loading';
@@ -95,13 +110,16 @@ class StripeServiceClass {
95
110
  const stripe = await loadStripe(publishableKey, {
96
111
  stripeAccount: options === null || options === void 0 ? void 0 : options.stripeAccount,
97
112
  });
113
+ if (generation !== this.initGeneration) {
114
+ return;
115
+ }
98
116
  // Register app info
99
117
  stripe.registerAppInfo({
100
118
  name: this.store.state.applicationName,
101
119
  });
102
120
  this.store.state.stripe = stripe;
103
121
  // Initialize Checkout instance instead of Elements
104
- const checkout = stripe.initCheckout({
122
+ const checkout = stripe.initCheckoutElementsSdk({
105
123
  clientSecret: checkoutSessionClientSecret,
106
124
  elementsOptions: options === null || options === void 0 ? void 0 : options.elementsOptions,
107
125
  });
@@ -164,4 +182,3 @@ export const StripeService = new StripeServiceClass();
164
182
  * Export class for DI usage
165
183
  */
166
184
  export { StripeServiceClass };
167
- //# sourceMappingURL=stripe-service.js.map
@@ -8,7 +8,7 @@
8
8
  export function findElement(containerElement, selector, timeout = 5000) {
9
9
  return new Promise((resolve, reject) => {
10
10
  const elem = containerElement.querySelector(selector);
11
- if (elem) {
11
+ if (elem != null) {
12
12
  return resolve(elem);
13
13
  }
14
14
  const timeoutId = setTimeout(() => {
@@ -17,7 +17,7 @@ export function findElement(containerElement, selector, timeout = 5000) {
17
17
  }, timeout);
18
18
  const observer = new MutationObserver(() => {
19
19
  const elem = containerElement.querySelector(selector);
20
- if (elem) {
20
+ if (elem != null) {
21
21
  clearTimeout(timeoutId);
22
22
  observer.disconnect();
23
23
  resolve(elem);
@@ -29,4 +29,3 @@ export function findElement(containerElement, selector, timeout = 5000) {
29
29
  });
30
30
  });
31
31
  }
32
- //# sourceMappingURL=element-finder.js.map
@@ -9,4 +9,3 @@ export class StripeAPIError extends Error {
9
9
  this.type = error.type;
10
10
  }
11
11
  }
12
- //# sourceMappingURL=error.js.map
@@ -42,4 +42,3 @@ i18next.use(I18nextBrowserLanguageDetector).init({
42
42
  },
43
43
  });
44
44
  export const i18n = i18next;
45
- //# sourceMappingURL=i18n.js.map
@@ -79,4 +79,3 @@ const PLATFORMS_MAP = {
79
79
  desktop: isDesktop,
80
80
  hybrid: isHybrid,
81
81
  };
82
- //# sourceMappingURL=platform.js.map
@@ -3,4 +3,3 @@ import { i18n } from "./i18n";
3
3
  beforeAll(async () => {
4
4
  await i18n.changeLanguage('en');
5
5
  });
6
- //# sourceMappingURL=test-setup.js.map
@@ -10,11 +10,11 @@ export const checkPlatform = () => {
10
10
  };
11
11
  export const waitForElm = (el, selector) => {
12
12
  return new Promise(resolve => {
13
- if (el.querySelector(selector)) {
13
+ if (el.querySelector(selector) != null) {
14
14
  return resolve(el.querySelector(selector));
15
15
  }
16
16
  const observer = new MutationObserver(() => {
17
- if (el.querySelector(selector)) {
17
+ if (el.querySelector(selector) != null) {
18
18
  resolve(el.querySelector(selector));
19
19
  observer.disconnect();
20
20
  }
@@ -25,4 +25,3 @@ export const waitForElm = (el, selector) => {
25
25
  });
26
26
  });
27
27
  };
28
- //# sourceMappingURL=utils.js.map
@@ -1,16 +1 @@
1
- class StripeAPIError extends Error {
2
- constructor(error) {
3
- super(error.message);
4
- this.code = error.code;
5
- this.docUrl = error.doc_url;
6
- this.message = error.message;
7
- this.param = error.param;
8
- this.requestLogUrl = error.request_log_url;
9
- this.type = error.type;
10
- }
11
- }
12
-
13
- export { StripeAPIError as S };
14
- //# sourceMappingURL=error.js.map
15
-
16
- //# sourceMappingURL=error.js.map
1
+ class s extends Error{constructor(s){super(s.message),this.code=s.code,this.docUrl=s.doc_url,this.message=s.message,this.param=s.param,this.requestLogUrl=s.request_log_url,this.type=s.type}}export{s as S}