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.
- package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -3
- package/dist/cjs/error-FFC4kSs5.js +0 -3
- package/dist/cjs/{factory-CbbbSvkg.js → factory-Cd2VI_N2.js} +216 -77
- 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 +41 -26
- package/dist/cjs/stripe-card-element-modal.cjs.entry.js +6 -7
- package/dist/cjs/stripe-card-element_2.cjs.entry.js +129 -72
- package/dist/cjs/stripe-currency-selector.cjs.entry.js +20 -10
- package/dist/cjs/stripe-elements.cjs.js +31 -5
- package/dist/cjs/stripe-express-checkout-element.cjs.entry.js +32 -22
- package/dist/cjs/stripe-link-authentication-element.cjs.entry.js +20 -10
- package/dist/cjs/stripe-payment-element.cjs.entry.js +283 -167
- package/dist/cjs/stripe-payment-request-button.cjs.entry.js +30 -18
- package/dist/collection/collection-manifest.json +6 -5
- package/dist/collection/components/stripe-address-element/stripe-address-element.js +36 -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 +62 -68
- package/dist/collection/components/stripe-card-element-modal/stripe-card-element-modal.js +15 -11
- package/dist/collection/components/stripe-currency-selector/stripe-currency-selector.js +17 -6
- package/dist/collection/components/stripe-express-checkout-element/stripe-express-checkout-element.js +35 -20
- package/dist/collection/components/stripe-link-authentication-element/stripe-link-authentication-element.js +19 -7
- package/dist/collection/components/stripe-modal/stripe-modal.js +18 -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 +162 -162
- package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js +48 -19
- 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 +27 -10
- 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 +0 -1
- 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 -112
- 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-Drde6-y7.js → factory-VTa1Gc94.js} +216 -77
- 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 +41 -26
- package/dist/esm/stripe-card-element-modal.entry.js +6 -7
- package/dist/esm/stripe-card-element_2.entry.js +129 -72
- package/dist/esm/stripe-currency-selector.entry.js +20 -10
- package/dist/esm/stripe-elements.js +32 -6
- package/dist/esm/stripe-express-checkout-element.entry.js +32 -22
- package/dist/esm/stripe-link-authentication-element.entry.js +20 -10
- package/dist/esm/stripe-payment-element.entry.js +283 -167
- package/dist/esm/stripe-payment-request-button.entry.js +27 -15
- package/dist/stripe-elements/index.esm.js +0 -2
- package/dist/stripe-elements/p-1bd46766.entry.js +1 -0
- package/dist/stripe-elements/p-1c6e0a45.entry.js +1 -0
- package/dist/stripe-elements/p-3f42ca0c.entry.js +1 -0
- package/dist/stripe-elements/p-5cf62945.entry.js +1 -0
- package/dist/stripe-elements/p-74de1556.entry.js +1 -0
- package/dist/stripe-elements/p-76e57d78.entry.js +1 -0
- package/dist/stripe-elements/p-840d499f.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-CrjrbGJ3.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-ae0c336e.entry.js +1 -0
- package/dist/stripe-elements/p-cfd8e081.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-address-element/stripe-address-element.d.ts +6 -0
- package/dist/types/components/stripe-card-element/stripe-card-element.d.ts +11 -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-currency-selector/stripe-currency-selector.d.ts +6 -0
- package/dist/types/components/stripe-express-checkout-element/stripe-express-checkout-element.d.ts +6 -0
- package/dist/types/components/stripe-link-authentication-element/stripe-link-authentication-element.d.ts +6 -0
- package/dist/types/components/stripe-modal/stripe-modal.d.ts +1 -0
- package/dist/types/components/stripe-payment-element/stripe-payment-element.d.ts +20 -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 +14 -1
- package/dist/types/components.d.ts +139 -29
- package/dist/types/index.d.ts +1 -0
- package/dist/types/services/interfaces.d.ts +4 -3
- package/dist/types/services/stripe-service.d.ts +8 -4
- package/dist/types/stencil-public-runtime.d.ts +110 -5
- 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-CbbbSvkg.js.map +0 -1
- package/dist/cjs/index-BXVW_rzh.js +0 -1932
- package/dist/cjs/index-BXVW_rzh.js.map +0 -1
- package/dist/cjs/index-Ba1pBePA.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/test-setup.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-Drde6-y7.js.map +0 -1
- package/dist/esm/index-BHDCxQOb.js.map +0 -1
- package/dist/esm/index-DJwTOfxZ.js +0 -1920
- package/dist/esm/index-DJwTOfxZ.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-02f6e421.entry.js +0 -2
- package/dist/stripe-elements/p-02f6e421.entry.js.map +0 -1
- package/dist/stripe-elements/p-19888fa6.entry.js +0 -2
- package/dist/stripe-elements/p-19888fa6.entry.js.map +0 -1
- package/dist/stripe-elements/p-4d505729.entry.js +0 -2
- package/dist/stripe-elements/p-4d505729.entry.js.map +0 -1
- package/dist/stripe-elements/p-7e7ad92a.entry.js +0 -2
- package/dist/stripe-elements/p-7e7ad92a.entry.js.map +0 -1
- package/dist/stripe-elements/p-8bb4212c.entry.js +0 -2
- package/dist/stripe-elements/p-8bb4212c.entry.js.map +0 -1
- package/dist/stripe-elements/p-9aee2b6b.entry.js +0 -2
- package/dist/stripe-elements/p-9aee2b6b.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-DI2vmGaI.js +0 -2
- package/dist/stripe-elements/p-DI2vmGaI.js.map +0 -1
- package/dist/stripe-elements/p-DJwTOfxZ.js +0 -3
- package/dist/stripe-elements/p-DJwTOfxZ.js.map +0 -1
- package/dist/stripe-elements/p-DQuL1Twl.js.map +0 -1
- package/dist/stripe-elements/p-XRfh5Wrs.js.map +0 -1
- package/dist/stripe-elements/p-ba251393.entry.js +0 -2
- package/dist/stripe-elements/p-ba251393.entry.js.map +0 -1
- package/dist/stripe-elements/p-c649edfc.entry.js +0 -2
- package/dist/stripe-elements/p-c649edfc.entry.js.map +0 -1
- package/dist/stripe-elements/p-e8bb43ae.entry.js +0 -2
- package/dist/stripe-elements/p-e8bb43ae.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
|
@@ -3,6 +3,7 @@ import { checkPlatform } from "../../utils/utils";
|
|
|
3
3
|
import { i18n } from "../../utils/i18n";
|
|
4
4
|
import { serviceFactory } from "../../services/factory";
|
|
5
5
|
import { StripeAPIError } from "../../utils/error";
|
|
6
|
+
import { buildInitStripeOptionsFromAccount, confirmCardIntent, attachPaymentRequestHandlers } from "./stripe-card-element.helpers";
|
|
6
7
|
export class StripeCardElement {
|
|
7
8
|
/**
|
|
8
9
|
* Get Stripe.js, and initialize elements
|
|
@@ -14,7 +15,7 @@ export class StripeCardElement {
|
|
|
14
15
|
* customElements
|
|
15
16
|
* .whenDefined('stripe-card-element')
|
|
16
17
|
* .then(() => {
|
|
17
|
-
*
|
|
18
|
+
* stripeElement.initStripe('pk_test_XXXXXXXXX')
|
|
18
19
|
* })
|
|
19
20
|
* ```
|
|
20
21
|
*/
|
|
@@ -64,6 +65,7 @@ export class StripeCardElement {
|
|
|
64
65
|
* stripeElement.updateProgress('success')
|
|
65
66
|
* });
|
|
66
67
|
* })
|
|
68
|
+
* ```
|
|
67
69
|
*/
|
|
68
70
|
async updateProgress(progress) {
|
|
69
71
|
this.progress = progress;
|
|
@@ -90,21 +92,21 @@ export class StripeCardElement {
|
|
|
90
92
|
* }
|
|
91
93
|
* });
|
|
92
94
|
* })
|
|
95
|
+
* ```
|
|
93
96
|
*/
|
|
94
97
|
async setErrorMessage(errorMessage) {
|
|
95
98
|
this.cardElementManager.setError(errorMessage);
|
|
96
99
|
return this;
|
|
97
100
|
}
|
|
98
101
|
updatePublishableKey(publishableKey) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
options.stripeAccount = this.stripeAccount;
|
|
102
|
+
if (publishableKey == null || publishableKey === '') {
|
|
103
|
+
return;
|
|
102
104
|
}
|
|
103
|
-
this.initStripe(publishableKey,
|
|
105
|
+
this.initStripe(publishableKey, buildInitStripeOptionsFromAccount(this.stripeAccount));
|
|
104
106
|
}
|
|
105
107
|
updateStripeAccountId(stripeAccount) {
|
|
106
108
|
const publishableKey = this.stripeService.state.publishableKey || this.publishableKey;
|
|
107
|
-
if (
|
|
109
|
+
if (publishableKey == null || publishableKey === '') {
|
|
108
110
|
return;
|
|
109
111
|
}
|
|
110
112
|
this.initStripe(publishableKey, {
|
|
@@ -124,7 +126,7 @@ export class StripeCardElement {
|
|
|
124
126
|
const event = {
|
|
125
127
|
stripe: this.stripeService.getStripe(),
|
|
126
128
|
};
|
|
127
|
-
if (this.stripeDidLoaded) {
|
|
129
|
+
if (this.stripeDidLoaded != null) {
|
|
128
130
|
this.stripeDidLoaded(event);
|
|
129
131
|
}
|
|
130
132
|
this.stripeLoaded.emit(event);
|
|
@@ -132,7 +134,7 @@ export class StripeCardElement {
|
|
|
132
134
|
async formSubmitEventHandler() {
|
|
133
135
|
const cardElements = this.cardElementManager.getElements();
|
|
134
136
|
const stripe = this.stripeService.getStripe();
|
|
135
|
-
if (
|
|
137
|
+
if (cardElements == null) {
|
|
136
138
|
console.error('Card elements not initialized');
|
|
137
139
|
return;
|
|
138
140
|
}
|
|
@@ -147,15 +149,14 @@ export class StripeCardElement {
|
|
|
147
149
|
this.defaultFormSubmitResult.emit(result);
|
|
148
150
|
}
|
|
149
151
|
componentWillRender() {
|
|
150
|
-
|
|
152
|
+
const { publishableKey } = this.stripeService.state;
|
|
153
|
+
if (publishableKey == null || publishableKey === '') {
|
|
151
154
|
return;
|
|
152
155
|
}
|
|
153
156
|
if (['success', 'loading'].includes(this.stripeService.state.loadStripeStatus)) {
|
|
154
157
|
return;
|
|
155
158
|
}
|
|
156
|
-
this.initStripe(this.stripeService.state.
|
|
157
|
-
stripeAccount: this.stripeService.state.stripeAccount,
|
|
158
|
-
});
|
|
159
|
+
this.initStripe(publishableKey, buildInitStripeOptionsFromAccount(this.stripeService.state.stripeAccount));
|
|
159
160
|
}
|
|
160
161
|
/**
|
|
161
162
|
* Default form submit action (just call a confirmCardPayment).
|
|
@@ -166,22 +167,8 @@ export class StripeCardElement {
|
|
|
166
167
|
async defaultFormSubmitAction(event, { stripe, cardNumberElement, intentClientSecret }) {
|
|
167
168
|
event.preventDefault();
|
|
168
169
|
try {
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
if (intentType === 'payment') {
|
|
172
|
-
return stripe.confirmCardPayment(intentClientSecret, {
|
|
173
|
-
payment_method: {
|
|
174
|
-
card: cardNumberElement,
|
|
175
|
-
},
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
return stripe.confirmCardSetup(intentClientSecret, {
|
|
179
|
-
payment_method: {
|
|
180
|
-
card: cardNumberElement,
|
|
181
|
-
},
|
|
182
|
-
});
|
|
183
|
-
})();
|
|
184
|
-
if (result.error) {
|
|
170
|
+
const result = await confirmCardIntent(stripe, this.intentType, intentClientSecret, cardNumberElement);
|
|
171
|
+
if (result.error != null) {
|
|
185
172
|
throw new StripeAPIError(result.error);
|
|
186
173
|
}
|
|
187
174
|
this.defaultFormSubmitResultHandler(result);
|
|
@@ -249,10 +236,15 @@ export class StripeCardElement {
|
|
|
249
236
|
// Dependency Injection via factory
|
|
250
237
|
this.stripeService = serviceFactory.createStripeService();
|
|
251
238
|
this.cardElementManager = serviceFactory.createCardElementManager(this.stripeService);
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Props are not yet populated inside the constructor when the component is registered via
|
|
242
|
+
* the custom-elements build (`dist/components/*`), so initialization that depends on them
|
|
243
|
+
* must run in `componentWillLoad`, where both the lazy and custom-elements builds have them set.
|
|
244
|
+
*/
|
|
245
|
+
componentWillLoad() {
|
|
246
|
+
if (this.publishableKey != null && this.publishableKey !== '') {
|
|
247
|
+
this.initStripe(this.publishableKey, buildInitStripeOptionsFromAccount(this.stripeAccount));
|
|
256
248
|
}
|
|
257
249
|
}
|
|
258
250
|
/**
|
|
@@ -263,7 +255,7 @@ export class StripeCardElement {
|
|
|
263
255
|
await this.cardElementManager.initialize(this.el);
|
|
264
256
|
// Add form submit listener scoped to this component instance
|
|
265
257
|
const formElement = this.el.querySelector('#stripe-card-element');
|
|
266
|
-
if (
|
|
258
|
+
if (formElement == null) {
|
|
267
259
|
console.error('Form element #stripe-card-element not found');
|
|
268
260
|
return;
|
|
269
261
|
}
|
|
@@ -271,7 +263,7 @@ export class StripeCardElement {
|
|
|
271
263
|
const cardElements = this.cardElementManager.getElements();
|
|
272
264
|
const stripe = this.stripeService.getStripe();
|
|
273
265
|
const { intentClientSecret } = this;
|
|
274
|
-
if (
|
|
266
|
+
if (cardElements == null || stripe == null) {
|
|
275
267
|
console.error('Stripe not properly initialized');
|
|
276
268
|
return;
|
|
277
269
|
}
|
|
@@ -285,17 +277,17 @@ export class StripeCardElement {
|
|
|
285
277
|
};
|
|
286
278
|
this.progress = 'loading';
|
|
287
279
|
try {
|
|
288
|
-
if (this.handleSubmit) {
|
|
280
|
+
if (this.handleSubmit != null) {
|
|
289
281
|
await this.handleSubmit(e, submitEventProps);
|
|
290
282
|
}
|
|
291
|
-
else if (this.shouldUseDefaultFormSubmitAction === true && intentClientSecret) {
|
|
283
|
+
else if (this.shouldUseDefaultFormSubmitAction === true && intentClientSecret != null && intentClientSecret !== '') {
|
|
292
284
|
await this.defaultFormSubmitAction(e, submitEventProps);
|
|
293
285
|
}
|
|
294
286
|
else {
|
|
295
287
|
e.preventDefault();
|
|
296
288
|
}
|
|
297
289
|
await this.formSubmitEventHandler();
|
|
298
|
-
if (this.handleSubmit || this.shouldUseDefaultFormSubmitAction === true) {
|
|
290
|
+
if (this.handleSubmit != null || this.shouldUseDefaultFormSubmitAction === true) {
|
|
299
291
|
this.progress = 'success';
|
|
300
292
|
}
|
|
301
293
|
}
|
|
@@ -328,36 +320,26 @@ export class StripeCardElement {
|
|
|
328
320
|
if (this.paymentRequestButtonCreated) {
|
|
329
321
|
return null;
|
|
330
322
|
}
|
|
331
|
-
if (!showPaymentRequestButton ||
|
|
323
|
+
if (!showPaymentRequestButton || paymentRequestOption == null) {
|
|
332
324
|
return null;
|
|
333
325
|
}
|
|
334
|
-
if (
|
|
326
|
+
if (document == null) {
|
|
335
327
|
return null;
|
|
336
328
|
}
|
|
337
329
|
const targetElement = this.el.querySelector('#stripe-payment-request-button');
|
|
338
|
-
if (
|
|
330
|
+
if (targetElement == null) {
|
|
339
331
|
console.error('Target element #stripe-payment-request-button not found');
|
|
340
332
|
return null;
|
|
341
333
|
}
|
|
342
334
|
// Check if button already exists in DOM to prevent duplicates
|
|
343
|
-
if (targetElement.querySelector('stripe-payment-request-button')) {
|
|
335
|
+
if (targetElement.querySelector('stripe-payment-request-button') != null) {
|
|
344
336
|
this.paymentRequestButtonCreated = true;
|
|
345
337
|
return null;
|
|
346
338
|
}
|
|
347
339
|
const stripePaymentRequestElement = document.createElement('stripe-payment-request-button');
|
|
348
340
|
targetElement.appendChild(stripePaymentRequestElement);
|
|
349
|
-
const { paymentRequestPaymentMethodHandler, paymentRequestShippingOptionChangeHandler, paymentRequestShippingAddressChangeHandler } = paymentRequestOption;
|
|
350
341
|
customElements.whenDefined('stripe-payment-request-button').then(() => {
|
|
351
|
-
stripePaymentRequestElement
|
|
352
|
-
if (paymentRequestPaymentMethodHandler) {
|
|
353
|
-
stripePaymentRequestElement.setPaymentMethodEventHandler(paymentRequestPaymentMethodHandler);
|
|
354
|
-
}
|
|
355
|
-
if (paymentRequestShippingOptionChangeHandler) {
|
|
356
|
-
stripePaymentRequestElement.setPaymentRequestShippingOptionEventHandler(paymentRequestShippingOptionChangeHandler);
|
|
357
|
-
}
|
|
358
|
-
if (paymentRequestShippingAddressChangeHandler) {
|
|
359
|
-
stripePaymentRequestElement.setPaymentRequestShippingAddressEventHandler(paymentRequestShippingAddressChangeHandler);
|
|
360
|
-
}
|
|
342
|
+
attachPaymentRequestHandlers(stripePaymentRequestElement, paymentRequestOption);
|
|
361
343
|
return stripePaymentRequestElement.initStripe(this.publishableKey);
|
|
362
344
|
});
|
|
363
345
|
// Mark as created
|
|
@@ -370,7 +352,11 @@ export class StripeCardElement {
|
|
|
370
352
|
return h("p", null, i18n.t('Failed to load Stripe'));
|
|
371
353
|
}
|
|
372
354
|
const disabled = this.progress === 'loading';
|
|
373
|
-
return (
|
|
355
|
+
return (
|
|
356
|
+
// NOTE: `stripe-payment-sheet-wrap` is a legacy class name (leftover from a former
|
|
357
|
+
// component name). External consumers may target it in their own CSS, so it is a
|
|
358
|
+
// public DOM contract that MUST be kept for backward compatibility. Do not remove it.
|
|
359
|
+
h("div", { class: "stripe-payment-sheet-wrap" }, h("form", { id: "stripe-card-element" }, h("div", { class: "stripe-heading" }, i18n.t(this.sheetTitle)), h("div", { id: "stripe-payment-request-button" }), h("div", null, h("div", { class: "stripe-section-title" }, i18n.t('Card information'))), h("div", { class: "payment-info card visible" }, h("fieldset", { class: "stripe-input-box" }, h("div", null, h("label", null, this.showLabel ? h("lenged", null, i18n.t('Card Number')) : null, h("div", { id: "card-number" }))), h("div", { class: "stripe-input-column", style: { display: 'flex' } }, h("label", { style: { width: '50%' } }, this.showLabel ? h("lenged", null, i18n.t('MM / YY')) : null, h("div", { id: "card-expiry" })), h("label", { style: { width: '50%' } }, this.showLabel ? h("lenged", null, i18n.t('CVC')) : null, h("div", { id: "card-cvc" }))))), h("div", { id: "card-errors", class: "stripe-element-errors" }, errorMessage), this.zip ? (h("div", { style: { marginTop: '1.5rem' } }, h("div", { class: "stripe-section-title" }, i18n.t('Country or region')))) : null, this.zip ? (h("div", { class: "payment-info card visible" }, h("fieldset", { class: "stripe-input-box" }, h("div", null, h("label", null, this.showLabel ? h("lenged", null, i18n.t('Postal Code')) : null, h("input", { id: "zip", name: "zip", type: "text", inputmode: "numeric", class: "StripeElement", style: { width: '100%' }, placeholder: i18n.t('Postal Code'), value: this.zipCode, onInput: e => {
|
|
374
360
|
this.zipCode = e.target.value;
|
|
375
361
|
} })))))) : null, h("div", { style: { marginTop: '32px' } }, h("button", { type: "submit", disabled: disabled }, this.progress === 'loading' ? i18n.t('Loading') : i18n.t(this.buttonLabel))))));
|
|
376
362
|
}
|
|
@@ -397,7 +383,8 @@ export class StripeCardElement {
|
|
|
397
383
|
"IntentType": {
|
|
398
384
|
"location": "import",
|
|
399
385
|
"path": "../../interfaces",
|
|
400
|
-
"id": "src/interfaces.ts::IntentType"
|
|
386
|
+
"id": "src/interfaces.ts::IntentType",
|
|
387
|
+
"referenceLocation": "IntentType"
|
|
401
388
|
}
|
|
402
389
|
}
|
|
403
390
|
},
|
|
@@ -628,7 +615,8 @@ export class StripeCardElement {
|
|
|
628
615
|
"FormSubmitHandler": {
|
|
629
616
|
"location": "import",
|
|
630
617
|
"path": "../../interfaces",
|
|
631
|
-
"id": "src/interfaces.ts::FormSubmitHandler"
|
|
618
|
+
"id": "src/interfaces.ts::FormSubmitHandler",
|
|
619
|
+
"referenceLocation": "FormSubmitHandler"
|
|
632
620
|
}
|
|
633
621
|
}
|
|
634
622
|
},
|
|
@@ -651,7 +639,8 @@ export class StripeCardElement {
|
|
|
651
639
|
"StripeDidLoadedHandler": {
|
|
652
640
|
"location": "import",
|
|
653
641
|
"path": "../../interfaces",
|
|
654
|
-
"id": "src/interfaces.ts::StripeDidLoadedHandler"
|
|
642
|
+
"id": "src/interfaces.ts::StripeDidLoadedHandler",
|
|
643
|
+
"referenceLocation": "StripeDidLoadedHandler"
|
|
655
644
|
}
|
|
656
645
|
}
|
|
657
646
|
},
|
|
@@ -694,7 +683,8 @@ export class StripeCardElement {
|
|
|
694
683
|
"StripeLoadedEvent": {
|
|
695
684
|
"location": "import",
|
|
696
685
|
"path": "../../interfaces",
|
|
697
|
-
"id": "src/interfaces.ts::StripeLoadedEvent"
|
|
686
|
+
"id": "src/interfaces.ts::StripeLoadedEvent",
|
|
687
|
+
"referenceLocation": "StripeLoadedEvent"
|
|
698
688
|
}
|
|
699
689
|
}
|
|
700
690
|
}
|
|
@@ -707,7 +697,7 @@ export class StripeCardElement {
|
|
|
707
697
|
"docs": {
|
|
708
698
|
"tags": [{
|
|
709
699
|
"name": "example",
|
|
710
|
-
"text": "```\nconst stripeElement = document.createElement('stripe-card-element');\ncustomElements\n .whenDefined('stripe-card-element')\n .then(() => {\n stripeElement\n .addEventListener('formSubmit', async props => {\n const {\n detail: { stripe, cardNumber, event },\n } = props;\n const result = await stripe.createPaymentMethod({\n type: 'card',\n card: cardNumber,\n });\n console.log(result);\n })\n })"
|
|
700
|
+
"text": "```\nconst stripeElement = document.createElement('stripe-card-element');\ncustomElements\n .whenDefined('stripe-card-element')\n .then(() => {\n stripeElement\n .addEventListener('formSubmit', async props => {\n const {\n detail: { stripe, cardNumber, event },\n } = props;\n const result = await stripe.createPaymentMethod({\n type: 'card',\n card: cardNumber,\n });\n console.log(result);\n })\n })\n```"
|
|
711
701
|
}],
|
|
712
702
|
"text": "Form submit event"
|
|
713
703
|
},
|
|
@@ -718,7 +708,8 @@ export class StripeCardElement {
|
|
|
718
708
|
"FormSubmitEvent": {
|
|
719
709
|
"location": "import",
|
|
720
710
|
"path": "../../interfaces",
|
|
721
|
-
"id": "src/interfaces.ts::FormSubmitEvent"
|
|
711
|
+
"id": "src/interfaces.ts::FormSubmitEvent",
|
|
712
|
+
"referenceLocation": "FormSubmitEvent"
|
|
722
713
|
}
|
|
723
714
|
}
|
|
724
715
|
}
|
|
@@ -731,7 +722,7 @@ export class StripeCardElement {
|
|
|
731
722
|
"docs": {
|
|
732
723
|
"tags": [{
|
|
733
724
|
"name": "example",
|
|
734
|
-
"text": "```\nconst stripeElement = document.createElement('stripe-card-element');\ncustomElements\n .whenDefined('stripe-card-element')\n .then(() => {\n stripeElement.addEventListener('defaultFormSubmitResult', async ({detail}) => {\n if (detail instanceof Error) {\n console.error(detail)\n } else {\n console.log(detail)\n }\n })\n })"
|
|
725
|
+
"text": "```\nconst stripeElement = document.createElement('stripe-card-element');\ncustomElements\n .whenDefined('stripe-card-element')\n .then(() => {\n stripeElement.addEventListener('defaultFormSubmitResult', async ({detail}) => {\n if (detail instanceof Error) {\n console.error(detail)\n } else {\n console.log(detail)\n }\n })\n })\n```"
|
|
735
726
|
}],
|
|
736
727
|
"text": "Recieve the result of defaultFormSubmit event"
|
|
737
728
|
},
|
|
@@ -742,7 +733,8 @@ export class StripeCardElement {
|
|
|
742
733
|
"DefaultFormSubmitResult": {
|
|
743
734
|
"location": "import",
|
|
744
735
|
"path": "../../interfaces",
|
|
745
|
-
"id": "src/interfaces.ts::DefaultFormSubmitResult"
|
|
736
|
+
"id": "src/interfaces.ts::DefaultFormSubmitResult",
|
|
737
|
+
"referenceLocation": "DefaultFormSubmitResult"
|
|
746
738
|
}
|
|
747
739
|
}
|
|
748
740
|
}
|
|
@@ -770,7 +762,8 @@ export class StripeCardElement {
|
|
|
770
762
|
"InitStripeOptions": {
|
|
771
763
|
"location": "import",
|
|
772
764
|
"path": "../../interfaces",
|
|
773
|
-
"id": "src/interfaces.ts::InitStripeOptions"
|
|
765
|
+
"id": "src/interfaces.ts::InitStripeOptions",
|
|
766
|
+
"referenceLocation": "InitStripeOptions"
|
|
774
767
|
}
|
|
775
768
|
},
|
|
776
769
|
"return": "Promise<void>"
|
|
@@ -785,7 +778,7 @@ export class StripeCardElement {
|
|
|
785
778
|
"text": "options"
|
|
786
779
|
}, {
|
|
787
780
|
"name": "example",
|
|
788
|
-
"text": "```\nconst stripeElement = document.createElement('stripe-card-element');\ncustomElements\n .whenDefined('stripe-card-element')\n .then(() => {\n
|
|
781
|
+
"text": "```\nconst stripeElement = document.createElement('stripe-card-element');\ncustomElements\n .whenDefined('stripe-card-element')\n .then(() => {\n stripeElement.initStripe('pk_test_XXXXXXXXX')\n })\n```"
|
|
789
782
|
}]
|
|
790
783
|
}
|
|
791
784
|
},
|
|
@@ -805,7 +798,8 @@ export class StripeCardElement {
|
|
|
805
798
|
"ProgressStatus": {
|
|
806
799
|
"location": "import",
|
|
807
800
|
"path": "../../interfaces",
|
|
808
|
-
"id": "src/interfaces.ts::ProgressStatus"
|
|
801
|
+
"id": "src/interfaces.ts::ProgressStatus",
|
|
802
|
+
"referenceLocation": "ProgressStatus"
|
|
809
803
|
}
|
|
810
804
|
},
|
|
811
805
|
"return": "Promise<this>"
|
|
@@ -820,7 +814,7 @@ export class StripeCardElement {
|
|
|
820
814
|
"text": undefined
|
|
821
815
|
}, {
|
|
822
816
|
"name": "example",
|
|
823
|
-
"text": "```\nconst stripeElement = document.createElement('stripe-card-element');\ncustomElements\n .whenDefined('stripe-card-element')\n .then(() => {\n // You must set the attributes to stop running default form submit action when you want to listen the 'formSubmit' event.\n stripeElement.setAttribute('should-use-default-form-submit-action', false)\n stripeElement.addEventListener('formSubmit', async props => {\n const {\n detail: { stripe, cardNumber, event },\n } = props;\n const result = await stripe.createPaymentMethod({\n type: 'card',\n card: cardNumber,\n });\n console.log(result);\n stripeElement.updateProgress('success')\n });\n})"
|
|
817
|
+
"text": "```\nconst stripeElement = document.createElement('stripe-card-element');\ncustomElements\n .whenDefined('stripe-card-element')\n .then(() => {\n // You must set the attributes to stop running default form submit action when you want to listen the 'formSubmit' event.\n stripeElement.setAttribute('should-use-default-form-submit-action', false)\n stripeElement.addEventListener('formSubmit', async props => {\n const {\n detail: { stripe, cardNumber, event },\n } = props;\n const result = await stripe.createPaymentMethod({\n type: 'card',\n card: cardNumber,\n });\n console.log(result);\n stripeElement.updateProgress('success')\n });\n})\n```"
|
|
824
818
|
}]
|
|
825
819
|
}
|
|
826
820
|
},
|
|
@@ -850,7 +844,7 @@ export class StripeCardElement {
|
|
|
850
844
|
"text": undefined
|
|
851
845
|
}, {
|
|
852
846
|
"name": "example",
|
|
853
|
-
"text": "```\nconst stripeElement = document.createElement('stripe-card-element');\ncustomElements\n .whenDefined('stripe-card-element')\n .then(() => {\n // You must set the attributes to stop running default form submit action when you want to listen the 'formSubmit' event.\n stripeElement.setAttribute('should-use-default-form-submit-action', false)\n stripeElement.addEventListener('formSubmit', async props => {\n try {\n throw new Error('debug')\n } catch (e) {\n stripeElement.setErrorMessage(`Error: ${e.message}`)\n stripeElement.updateProgress('failure')\n }\n });\n})"
|
|
847
|
+
"text": "```\nconst stripeElement = document.createElement('stripe-card-element');\ncustomElements\n .whenDefined('stripe-card-element')\n .then(() => {\n // You must set the attributes to stop running default form submit action when you want to listen the 'formSubmit' event.\n stripeElement.setAttribute('should-use-default-form-submit-action', false)\n stripeElement.addEventListener('formSubmit', async props => {\n try {\n throw new Error('debug')\n } catch (e) {\n stripeElement.setErrorMessage(`Error: ${e.message}`)\n stripeElement.updateProgress('failure')\n }\n });\n})\n```"
|
|
854
848
|
}]
|
|
855
849
|
}
|
|
856
850
|
},
|
|
@@ -870,7 +864,8 @@ export class StripeCardElement {
|
|
|
870
864
|
"PaymentRequestButtonOption": {
|
|
871
865
|
"location": "import",
|
|
872
866
|
"path": "../../interfaces",
|
|
873
|
-
"id": "src/interfaces.ts::PaymentRequestButtonOption"
|
|
867
|
+
"id": "src/interfaces.ts::PaymentRequestButtonOption",
|
|
868
|
+
"referenceLocation": "PaymentRequestButtonOption"
|
|
874
869
|
}
|
|
875
870
|
},
|
|
876
871
|
"return": "Promise<this>"
|
|
@@ -899,4 +894,3 @@ export class StripeCardElement {
|
|
|
899
894
|
}];
|
|
900
895
|
}
|
|
901
896
|
}
|
|
902
|
-
//# sourceMappingURL=stripe-card-element.js.map
|
|
@@ -16,7 +16,7 @@ export class StripeCardElementModal {
|
|
|
16
16
|
* If you want to use `setupIntent`, should update this attribute.
|
|
17
17
|
* @example
|
|
18
18
|
* ```
|
|
19
|
-
* <stripe-card-element intent-type="setup" />
|
|
19
|
+
* <stripe-card-element-modal intent-type="setup" />
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
this.intentType = 'payment';
|
|
@@ -94,7 +94,7 @@ export class StripeCardElementModal {
|
|
|
94
94
|
cardElement.setPaymentRequestOption(options);
|
|
95
95
|
}
|
|
96
96
|
render() {
|
|
97
|
-
return (h("stripe-modal", { key: '
|
|
97
|
+
return (h("stripe-modal", { key: 'a0229c55472e3c6f417086fa08d79e1ec8a8c485', open: this.open, showCloseButton: this.showCloseButton }, h("stripe-card-element", { key: '799f08c781bad089cec8b1338e9a714d080abd51', showLabel: this.showLabel, publishableKey: this.publishableKey, intentClientSecret: this.intentClientSecret, shouldUseDefaultFormSubmitAction: this.shouldUseDefaultFormSubmitAction, handleSubmit: this.handleSubmit, stripeDidLoaded: this.stripeDidLoaded, intentType: this.intentType, zip: this.zip, buttonLabel: this.buttonLabel, sheetTitle: this.sheetTitle, applicationName: this.applicationName })));
|
|
98
98
|
}
|
|
99
99
|
static get is() { return "stripe-card-element-modal"; }
|
|
100
100
|
static get originalStyleUrls() {
|
|
@@ -240,10 +240,10 @@ export class StripeCardElementModal {
|
|
|
240
240
|
"docs": {
|
|
241
241
|
"tags": [{
|
|
242
242
|
"name": "example",
|
|
243
|
-
"text": "```\nconst stripeElement = document.createElement('stripe-card-element');\ncustomElements\n .whenDefined('stripe-card-element')\n .then(() => {\n stripeElement.setAttribute('intent-client-secret', 'dummy')\n })\n```"
|
|
243
|
+
"text": "```\nconst stripeElement = document.createElement('stripe-card-element-modal');\ncustomElements\n .whenDefined('stripe-card-element-modal')\n .then(() => {\n stripeElement.setAttribute('intent-client-secret', 'dummy')\n })\n```"
|
|
244
244
|
}, {
|
|
245
245
|
"name": "example",
|
|
246
|
-
"text": "```\n<stripe-card-element intent-client-secret=\"dummy\" />\n```"
|
|
246
|
+
"text": "```\n<stripe-card-element-modal intent-client-secret=\"dummy\" />\n```"
|
|
247
247
|
}],
|
|
248
248
|
"text": "The client secret from paymentIntent.create response"
|
|
249
249
|
},
|
|
@@ -282,7 +282,8 @@ export class StripeCardElementModal {
|
|
|
282
282
|
"IntentType": {
|
|
283
283
|
"location": "import",
|
|
284
284
|
"path": "../../interfaces",
|
|
285
|
-
"id": "src/interfaces.ts::IntentType"
|
|
285
|
+
"id": "src/interfaces.ts::IntentType",
|
|
286
|
+
"referenceLocation": "IntentType"
|
|
286
287
|
}
|
|
287
288
|
}
|
|
288
289
|
},
|
|
@@ -291,7 +292,7 @@ export class StripeCardElementModal {
|
|
|
291
292
|
"docs": {
|
|
292
293
|
"tags": [{
|
|
293
294
|
"name": "example",
|
|
294
|
-
"text": "```\n<stripe-card-element intent-type=\"setup\" />\n```"
|
|
295
|
+
"text": "```\n<stripe-card-element-modal intent-type=\"setup\" />\n```"
|
|
295
296
|
}],
|
|
296
297
|
"text": "Default submit handle type.\nIf you want to use `setupIntent`, should update this attribute."
|
|
297
298
|
},
|
|
@@ -311,7 +312,8 @@ export class StripeCardElementModal {
|
|
|
311
312
|
"FormSubmitHandler": {
|
|
312
313
|
"location": "import",
|
|
313
314
|
"path": "../../interfaces",
|
|
314
|
-
"id": "src/interfaces.ts::FormSubmitHandler"
|
|
315
|
+
"id": "src/interfaces.ts::FormSubmitHandler",
|
|
316
|
+
"referenceLocation": "FormSubmitHandler"
|
|
315
317
|
}
|
|
316
318
|
}
|
|
317
319
|
},
|
|
@@ -334,7 +336,8 @@ export class StripeCardElementModal {
|
|
|
334
336
|
"StripeDidLoadedHandler": {
|
|
335
337
|
"location": "import",
|
|
336
338
|
"path": "../../interfaces",
|
|
337
|
-
"id": "src/interfaces.ts::StripeDidLoadedHandler"
|
|
339
|
+
"id": "src/interfaces.ts::StripeDidLoadedHandler",
|
|
340
|
+
"referenceLocation": "StripeDidLoadedHandler"
|
|
338
341
|
}
|
|
339
342
|
}
|
|
340
343
|
},
|
|
@@ -487,7 +490,8 @@ export class StripeCardElementModal {
|
|
|
487
490
|
"ProgressStatus": {
|
|
488
491
|
"location": "import",
|
|
489
492
|
"path": "../../interfaces",
|
|
490
|
-
"id": "src/interfaces.ts::ProgressStatus"
|
|
493
|
+
"id": "src/interfaces.ts::ProgressStatus",
|
|
494
|
+
"referenceLocation": "ProgressStatus"
|
|
491
495
|
}
|
|
492
496
|
},
|
|
493
497
|
"return": "Promise<HTMLStripeCardElementElement>"
|
|
@@ -530,7 +534,8 @@ export class StripeCardElementModal {
|
|
|
530
534
|
"PaymentRequestButtonOption": {
|
|
531
535
|
"location": "import",
|
|
532
536
|
"path": "../../interfaces",
|
|
533
|
-
"id": "src/interfaces.ts::PaymentRequestButtonOption"
|
|
537
|
+
"id": "src/interfaces.ts::PaymentRequestButtonOption",
|
|
538
|
+
"referenceLocation": "PaymentRequestButtonOption"
|
|
534
539
|
}
|
|
535
540
|
},
|
|
536
541
|
"return": "Promise<void>"
|
|
@@ -544,4 +549,3 @@ export class StripeCardElementModal {
|
|
|
544
549
|
}
|
|
545
550
|
static get elementRef() { return "el"; }
|
|
546
551
|
}
|
|
547
|
-
//# sourceMappingURL=stripe-card-element-modal.js.map
|
|
@@ -127,6 +127,13 @@ export class StripeCurrencySelector {
|
|
|
127
127
|
// Dependency Injection via factory
|
|
128
128
|
this.stripeService = serviceFactory.createStripeService();
|
|
129
129
|
this.currencySelectorElementManager = serviceFactory.createCurrencySelectorElementManager(this.stripeService);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Props are not yet populated inside the constructor when the component is registered via
|
|
133
|
+
* the custom-elements build (`dist/components/*`), so initialization that depends on them
|
|
134
|
+
* must run in `componentWillLoad`, where both the lazy and custom-elements builds have them set.
|
|
135
|
+
*/
|
|
136
|
+
componentWillLoad() {
|
|
130
137
|
if (this.publishableKey) {
|
|
131
138
|
this.initStripe(this.publishableKey, {
|
|
132
139
|
stripeAccount: this.stripeAccount,
|
|
@@ -278,7 +285,8 @@ export class StripeCurrencySelector {
|
|
|
278
285
|
"CurrencySelectorChangeHandler": {
|
|
279
286
|
"location": "import",
|
|
280
287
|
"path": "../../interfaces",
|
|
281
|
-
"id": "src/interfaces.ts::CurrencySelectorChangeHandler"
|
|
288
|
+
"id": "src/interfaces.ts::CurrencySelectorChangeHandler",
|
|
289
|
+
"referenceLocation": "CurrencySelectorChangeHandler"
|
|
282
290
|
}
|
|
283
291
|
}
|
|
284
292
|
},
|
|
@@ -301,7 +309,8 @@ export class StripeCurrencySelector {
|
|
|
301
309
|
"StripeDidLoadedHandler": {
|
|
302
310
|
"location": "import",
|
|
303
311
|
"path": "../../interfaces",
|
|
304
|
-
"id": "src/interfaces.ts::StripeDidLoadedHandler"
|
|
312
|
+
"id": "src/interfaces.ts::StripeDidLoadedHandler",
|
|
313
|
+
"referenceLocation": "StripeDidLoadedHandler"
|
|
305
314
|
}
|
|
306
315
|
}
|
|
307
316
|
},
|
|
@@ -337,7 +346,8 @@ export class StripeCurrencySelector {
|
|
|
337
346
|
"StripeLoadedEvent": {
|
|
338
347
|
"location": "import",
|
|
339
348
|
"path": "../../interfaces",
|
|
340
|
-
"id": "src/interfaces.ts::StripeLoadedEvent"
|
|
349
|
+
"id": "src/interfaces.ts::StripeLoadedEvent",
|
|
350
|
+
"referenceLocation": "StripeLoadedEvent"
|
|
341
351
|
}
|
|
342
352
|
}
|
|
343
353
|
}
|
|
@@ -361,7 +371,8 @@ export class StripeCurrencySelector {
|
|
|
361
371
|
"CurrencySelectorChangeEvent": {
|
|
362
372
|
"location": "import",
|
|
363
373
|
"path": "../../interfaces",
|
|
364
|
-
"id": "src/interfaces.ts::CurrencySelectorChangeEvent"
|
|
374
|
+
"id": "src/interfaces.ts::CurrencySelectorChangeEvent",
|
|
375
|
+
"referenceLocation": "CurrencySelectorChangeEvent"
|
|
365
376
|
}
|
|
366
377
|
}
|
|
367
378
|
}
|
|
@@ -389,7 +400,8 @@ export class StripeCurrencySelector {
|
|
|
389
400
|
"InitStripeOptions": {
|
|
390
401
|
"location": "import",
|
|
391
402
|
"path": "../../interfaces",
|
|
392
|
-
"id": "src/interfaces.ts::InitStripeOptions"
|
|
403
|
+
"id": "src/interfaces.ts::InitStripeOptions",
|
|
404
|
+
"referenceLocation": "InitStripeOptions"
|
|
393
405
|
}
|
|
394
406
|
},
|
|
395
407
|
"return": "Promise<void>"
|
|
@@ -474,4 +486,3 @@ export class StripeCurrencySelector {
|
|
|
474
486
|
}];
|
|
475
487
|
}
|
|
476
488
|
}
|
|
477
|
-
//# sourceMappingURL=stripe-currency-selector.js.map
|