@power-elements/stripe-elements
Advanced tools
Comparing version 2.2.1 to 2.2.2
@@ -0,1 +1,8 @@ | ||
## [2.2.2](https://github.com/bennypowers/stripe-elements/compare/v2.2.1...v2.2.2) (2020-01-27) | ||
### Bug Fixes | ||
* fix typescript typings ([f3cb81e](https://github.com/bennypowers/stripe-elements/commit/f3cb81ed864fc5f5548c9236b82d1d075c5357fc)) | ||
# Changelog | ||
@@ -2,0 +9,0 @@ |
@@ -98,3 +98,3 @@ { | ||
"description": "The `client_secret` part of a Stripe `PaymentIntent`", | ||
"type": "String" | ||
"type": "string" | ||
}, | ||
@@ -296,3 +296,3 @@ { | ||
"description": "The `client_secret` part of a Stripe `PaymentIntent`", | ||
"type": "String" | ||
"type": "string" | ||
}, | ||
@@ -372,7 +372,2 @@ { | ||
"deprecated": true | ||
}, | ||
{ | ||
"name": "stripeMount", | ||
"description": "Stripe.js mount point element. Due to limitations in the Stripe.js library, this element must be connected to the document.", | ||
"type": "Element" | ||
} | ||
@@ -743,3 +738,3 @@ ], | ||
"description": "The `client_secret` part of a Stripe `PaymentIntent`", | ||
"type": "String" | ||
"type": "string" | ||
}, | ||
@@ -960,3 +955,3 @@ { | ||
"description": "The `client_secret` part of a Stripe `PaymentIntent`", | ||
"type": "String" | ||
"type": "string" | ||
}, | ||
@@ -1036,7 +1031,2 @@ { | ||
"deprecated": true | ||
}, | ||
{ | ||
"name": "stripeMount", | ||
"description": "Stripe.js mount point element. Due to limitations in the Stripe.js library, this element must be connected to the document.", | ||
"type": "Element" | ||
} | ||
@@ -1043,0 +1033,0 @@ ], |
{ | ||
"name": "@power-elements/stripe-elements", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "Web Component wrapper for stripe elements", | ||
"main": "stripe-elements.js", | ||
"module": "stripe-elements.js", | ||
"main": "index.js", | ||
"module": "index.js", | ||
"directories": { | ||
@@ -13,5 +13,5 @@ "test": "test" | ||
"prepare": "npm run build", | ||
"build": "run-p build:**", | ||
"build": "run-s build:**", | ||
"build:rollup": "rollup -c", | ||
"build:types": "tsc", | ||
"build:types": "tsc && sh scripts/finish-declarations.sh", | ||
"build:analyze:json": "wca analyze src/*.js --outFile custom-elements.json", | ||
@@ -41,2 +41,3 @@ "build:analyze:markdown": "cp src/README.template.md README.md && wca analyze src/*.js --silent --markdown.headerLevel 3 >> README.md", | ||
], | ||
"types": "index.d.ts", | ||
"keywords": [ | ||
@@ -47,3 +48,5 @@ "web-components", | ||
"stripe", | ||
"payment" | ||
"payment", | ||
"payment-request", | ||
"payment request api" | ||
], | ||
@@ -55,3 +58,3 @@ "author": "Benny Powers <web@bennypowers.com>", | ||
}, | ||
"homepage": "https://github.com/bennypowers/stripe-elements#readme", | ||
"homepage": "https://bennypowers.dev/stripe-elements", | ||
"husky": { | ||
@@ -62,2 +65,15 @@ "hooks": { | ||
}, | ||
"release": { | ||
"branches": [ | ||
"master" | ||
], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/github", | ||
"@semantic-release/npm", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/git", | ||
"@semantic-release/changelog" | ||
] | ||
}, | ||
"devDependencies": { | ||
@@ -83,3 +99,2 @@ "@apollo-elements/eslint-config": "^1.1.1", | ||
"@types/karma": "^3.0.5", | ||
"@types/stripe-v3": "^3.1.14", | ||
"babel-eslint": "^10.0.3", | ||
@@ -100,2 +115,3 @@ "bound-decorator": "^1.1.0", | ||
"karma-osx-reporter": "^0.2.1", | ||
"karma-tap-reporter": "0.0.6", | ||
"karma-tape-reporter": "^1.0.3", | ||
@@ -123,5 +139,5 @@ "luhn-js": "^1.1.2", | ||
"@typed/curry": "^1.0.1", | ||
"karma-tap-reporter": "0.0.6", | ||
"@types/stripe-v3": "^3.1.14", | ||
"lit-element": "^2.2.1" | ||
} | ||
} |
@@ -115,3 +115,3 @@ # Stripe Elements Web Components | ||
| `card` | `card` | readonly | `stripe.elements.Element` | null | The Stripe card object.<br />**DEPRECATED**. Will be removed in a future version. use `element` instead | | ||
| `clientSecret` | `client-secret` | | `String` | | The `client_secret` part of a Stripe `PaymentIntent` | | ||
| `clientSecret` | `client-secret` | | `string` | | The `client_secret` part of a Stripe `PaymentIntent` | | ||
| `complete` | `complete` | readonly | `boolean` | false | Whether the form is complete. | | ||
@@ -139,3 +139,2 @@ | `element` | `element` | readonly | `stripe.elements.Element` | null | Stripe element instance | | ||
| `stripe` | `stripe` | readonly | `stripe.Stripe` | null | Stripe instance | | ||
| `stripeMount` | | readonly | `Element` | | Stripe.js mount point element. Due to limitations in the Stripe.js library, this element must be connected to the document. | | ||
| `stripeReady` | `stripe-ready` | | `boolean` | false | Whether the stripe element is ready to receive focus.<br />**DEPRECATED**. Will be removed in a future version. use `ready` instead. | | ||
@@ -150,7 +149,7 @@ | `token` | `token` | readonly | `stripe.Token` | null | Stripe Token | | ||
|-----------------------|--------------------------------------------------|--------------------------------------------------| | ||
| `blur` | `(): void` | Blur the element. | | ||
| `blur` | `(): void` | Blurs the element. | | ||
| `createPaymentMethod` | `(paymentMethodData?: PaymentMethodData \| undefined): Promise<PaymentMethodResponse>` | Submit payment information to generate a paymentMethod | | ||
| `createSource` | `(sourceData?: { owner: OwnerInfo; } \| undefined): Promise<SourceResponse>` | Submit payment information to generate a source | | ||
| `createToken` | `(tokenData?: TokenData): Promise<TokenResponse>` | Submit payment information to generate a token | | ||
| `focus` | `(): void` | Focus the element. | | ||
| `focus` | `(): void` | Focuses the element. | | ||
| `isPotentiallyValid` | `(): boolean` | Checks for potential validity. A potentially valid form is one that is not empty, not complete and has no error. A validated form also counts as potentially valid. | | ||
@@ -294,3 +293,3 @@ | `reset` | `(): void` | Resets the Stripe card. | | ||
| `canMakePayment` | `can-make-payment` | readonly | `object` | null | Whether or not the device can make the payment request. | | ||
| `clientSecret` | `client-secret` | | `String` | | The `client_secret` part of a Stripe `PaymentIntent` | | ||
| `clientSecret` | `client-secret` | | `string` | | The `client_secret` part of a Stripe `PaymentIntent` | | ||
| `country` | `country` | | `string` | | The two-letter country code of your Stripe account (e.g., `US`) | | ||
@@ -322,3 +321,2 @@ | `currency` | `currency` | | `string` | | Three character currency code (e.g., `usd`) | | ||
| `stripe` | `stripe` | readonly | `stripe.Stripe` | null | Stripe instance | | ||
| `stripeMount` | | readonly | `Element` | | Stripe.js mount point element. Due to limitations in the Stripe.js library, this element must be connected to the document. | | ||
| `stripeReady` | `stripe-ready` | | `boolean` | false | Whether the stripe element is ready to receive focus.<br />**DEPRECATED**. Will be removed in a future version. use `ready` instead. | | ||
@@ -330,7 +328,7 @@ | `token` | `token` | readonly | `stripe.Token` | null | Stripe Token | | ||
| Method | Type | Description | | ||
|---------|------------|--------------------------| | ||
| `blur` | `(): void` | Blur the element. | | ||
| `focus` | `(): void` | Focus the element. | | ||
| `reset` | `(): void` | Reset the stripe element | | ||
| Method | Type | Description | | ||
|---------|------------|---------------------------------------| | ||
| `blur` | `(): void` | Blurs the element. | | ||
| `focus` | `(): void` | Focuses the element. | | ||
| `reset` | `(): void` | Resets and clears the stripe element. | | ||
@@ -337,0 +335,0 @@ #### Events |
@@ -16,2 +16,3 @@ import commonjs from '@rollup/plugin-commonjs'; | ||
input: [ | ||
'src/index.js', | ||
'src/stripe-elements.js', | ||
@@ -18,0 +19,0 @@ 'src/stripe-payment-request.js', |
@@ -54,2 +54,15 @@ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty'; | ||
/** @typedef {import('lit-element').PropertyDeclaration & { readOnly: Boolean }} AugmentedPropertyDeclaration */ | ||
/** | ||
* @template TBase | ||
* @typedef {new (...args: any[]) => import('lit-element').LitElement & TBase} Constructor | ||
*/ | ||
// eslint-disable-next-line valid-jsdoc | ||
/** | ||
* Enables the nofity option for properties to fire change notification events | ||
* | ||
* @template TBase | ||
* @param {Constructor<TBase>} baseElement | ||
*/ | ||
const ReadOnlyPropertiesMixin = baseElement => { | ||
@@ -117,4 +130,3 @@ var _temp; | ||
* @param {Object<string, unknown>} props | ||
* @return {Promise<this>} | ||
* @protected | ||
* @private | ||
*/ | ||
@@ -125,3 +137,2 @@ | ||
await Promise.all(Object.entries(props).map(this._setPropEntry)); | ||
return this; | ||
} | ||
@@ -594,3 +605,3 @@ /** | ||
* The `client_secret` part of a Stripe `PaymentIntent` | ||
* @type {String} | ||
* @type {string} | ||
*/ | ||
@@ -676,2 +687,3 @@ | ||
* @type {Element} | ||
* @protected | ||
*/ | ||
@@ -741,3 +753,3 @@ function stripeMount() { | ||
/** | ||
* Reset the stripe element | ||
* Resets and clears the stripe element. | ||
*/ | ||
@@ -757,3 +769,3 @@ | ||
} | ||
/** Blur the element. */ | ||
/** Blurs the element. */ | ||
@@ -768,3 +780,3 @@ }, { | ||
} | ||
/** Focus the element. */ | ||
/** Focuses the element. */ | ||
@@ -794,3 +806,6 @@ }, { | ||
} | ||
/** @private */ | ||
/** | ||
* Clears the Payment Representation and fires an error event | ||
* @private | ||
*/ | ||
@@ -801,6 +816,7 @@ }, { | ||
value: async function errorChanged() { | ||
// DEPRECATED | ||
const hasError = !!this.error; | ||
await this.set({ | ||
hasError | ||
}); // DEPRECATED | ||
}); // END DEPRECATED | ||
@@ -902,3 +918,6 @@ this.resetRepresentations(); | ||
} | ||
/** @private */ | ||
/** | ||
* Removes all mount points from the DOM | ||
* @private | ||
*/ | ||
@@ -912,3 +931,6 @@ }, { | ||
} | ||
/** @private */ | ||
/** | ||
* Adds `ready`, `focus`, and `blur` listeners to the Stripe Element | ||
* @private | ||
*/ | ||
@@ -923,3 +945,6 @@ }, { | ||
} | ||
/** @private */ | ||
/** | ||
* Creates mount points for the Stripe Element | ||
* @private | ||
*/ | ||
@@ -1071,5 +1096,6 @@ }, { | ||
/** | ||
* POSTs the payment info represenation to the endpoint at `/action` | ||
* @private | ||
*/ | ||
* POSTs the payment info represenation to the endpoint at `/action` | ||
* @resolves {void} | ||
* @private | ||
*/ | ||
@@ -1080,2 +1106,12 @@ }, { | ||
value: async function postRepresentation() { | ||
const onError = error => this.set({ | ||
error | ||
}); | ||
const onSuccess = success => { | ||
this.fire('success', success); // DEPRECATED | ||
this.fire('stripe-payment-success', success); | ||
}; | ||
const token = this.token || undefined; | ||
@@ -1097,9 +1133,3 @@ const source = this.source || undefined; | ||
method | ||
}).then(throwBadResponse).then(success => { | ||
this.fire('success', success); // DEPRECATED | ||
this.fire('stripe-payment-success', success); | ||
}).catch(error => this.set({ | ||
error | ||
})); | ||
}).then(throwBadResponse).then(onSuccess).catch(onError); | ||
} | ||
@@ -1126,3 +1156,6 @@ /** | ||
} | ||
/** @private */ | ||
/** | ||
* Resets the Payment Representations | ||
* @private | ||
*/ | ||
@@ -1129,0 +1162,0 @@ }, { |
/** @typedef {import('lit-element').PropertyDeclaration & { readOnly: Boolean }} AugmentedPropertyDeclaration */ | ||
/** | ||
* @template TBase | ||
* @typedef {new (...args: any[]) => import('lit-element').LitElement & TBase} Constructor | ||
*/ | ||
// eslint-disable-next-line valid-jsdoc | ||
/** | ||
* Enables the nofity option for properties to fire change notification events | ||
* | ||
* @template TBase | ||
* @param {Constructor<TBase>} baseElement | ||
*/ | ||
export const ReadOnlyPropertiesMixin = baseElement => { | ||
@@ -58,8 +70,6 @@ /** | ||
* @param {Object<string, unknown>} props | ||
* @return {Promise<this>} | ||
* @protected | ||
* @private | ||
*/ | ||
async set(props) { | ||
await Promise.all(Object.entries(props).map(this._setPropEntry)); | ||
return this; | ||
} | ||
@@ -66,0 +76,0 @@ |
@@ -128,3 +128,3 @@ import { LitElement, property, html } from 'lit-element'; | ||
* The `client_secret` part of a Stripe `PaymentIntent` | ||
* @type {String} | ||
* @type {string} | ||
*/ | ||
@@ -243,2 +243,3 @@ @property({ type: String, attribute: 'client-secret' }) clientSecret; | ||
* @type {Element} | ||
* @protected | ||
*/ | ||
@@ -286,3 +287,3 @@ get stripeMount() { return document.getElementById(this.stripeMountId); } | ||
/** | ||
* Reset the stripe element | ||
* Resets and clears the stripe element. | ||
*/ | ||
@@ -295,3 +296,3 @@ reset() { | ||
/** Blur the element. */ | ||
/** Blurs the element. */ | ||
blur() { | ||
@@ -301,3 +302,3 @@ this.element?.blur(); | ||
/** Focus the element. */ | ||
/** Focuses the element. */ | ||
focus() { | ||
@@ -319,6 +320,11 @@ this.element?.focus(); | ||
/** @private */ | ||
/** | ||
* Clears the Payment Representation and fires an error event | ||
* @private | ||
*/ | ||
async errorChanged() { | ||
// DEPRECATED | ||
const hasError = !!this.error; | ||
await this.set({ hasError }); // DEPRECATED | ||
await this.set({ hasError }); | ||
// END DEPRECATED | ||
this.resetRepresentations(); | ||
@@ -389,3 +395,6 @@ this.fireError(this.error); | ||
/** @private */ | ||
/** | ||
* Removes all mount points from the DOM | ||
* @private | ||
*/ | ||
destroyMountPoints() { | ||
@@ -396,3 +405,6 @@ this.shadowHosts.forEach(removeAllMounts); | ||
/** @private */ | ||
/** | ||
* Adds `ready`, `focus`, and `blur` listeners to the Stripe Element | ||
* @private | ||
*/ | ||
initElementListeners() { | ||
@@ -404,3 +416,6 @@ this.element.addEventListener('ready', this.onReady); | ||
/** @private */ | ||
/** | ||
* Creates mount points for the Stripe Element | ||
* @private | ||
*/ | ||
initMountPoints() { | ||
@@ -475,50 +490,53 @@ this.stripeMountId = generateRandomMountElementId(); | ||
/** | ||
* @param {StripeFocusEvent} event | ||
* @private | ||
*/ | ||
@bound async onBlur(event) { | ||
/** | ||
* @param {StripeFocusEvent} event | ||
* @private | ||
*/ | ||
@bound async onBlur(event) { | ||
await this.set({ focused: false }); | ||
} | ||
/** | ||
* @param {StripeFocusEvent} event | ||
* @private | ||
*/ | ||
@bound async onFocus(event) { | ||
await this.set({ focused: true }); | ||
} | ||
/** | ||
* @param {StripeFocusEvent} event | ||
* @private | ||
*/ | ||
@bound async onFocus(event) { | ||
await this.set({ focused: true }); | ||
} | ||
/** | ||
* Sets the `ready` property when the stripe element is ready to receive focus. | ||
* @param {Event} event | ||
* @private | ||
*/ | ||
@bound async onReady(event) { | ||
await this.set({ ready: true, stripeReady: true }); | ||
this.fire('ready', event); | ||
// DEPRECATED | ||
this.fire('stripe-ready', event); | ||
} | ||
/** | ||
* Sets the `ready` property when the stripe element is ready to receive focus. | ||
* @param {Event} event | ||
* @private | ||
*/ | ||
@bound async onReady(event) { | ||
await this.set({ ready: true, stripeReady: true }); | ||
this.fire('ready', event); | ||
// DEPRECATED | ||
this.fire('stripe-ready', event); | ||
} | ||
/** | ||
/** | ||
* POSTs the payment info represenation to the endpoint at `/action` | ||
* @resolves {void} | ||
* @private | ||
*/ | ||
async postRepresentation() { | ||
const token = this.token || undefined; | ||
const source = this.source || undefined; | ||
const paymentMethod = this.paymentMethod || undefined; | ||
const body = JSON.stringify({ token, source, paymentMethod }); | ||
const headers = { 'Content-Type': 'application/json' }; | ||
const method = 'POST'; | ||
return fetch(this.action, { body, headers, method }) | ||
.then(throwBadResponse) | ||
.then(success => { | ||
this.fire('success', success); | ||
// DEPRECATED | ||
this.fire('stripe-payment-success', success); | ||
}) | ||
.catch(error => this.set({ error })); | ||
} | ||
async postRepresentation() { | ||
const onError = error => this.set({ error }); | ||
const onSuccess = success => { | ||
this.fire('success', success); | ||
// DEPRECATED | ||
this.fire('stripe-payment-success', success); | ||
}; | ||
const token = this.token || undefined; | ||
const source = this.source || undefined; | ||
const paymentMethod = this.paymentMethod || undefined; | ||
const body = JSON.stringify({ token, source, paymentMethod }); | ||
const headers = { 'Content-Type': 'application/json' }; | ||
const method = 'POST'; | ||
return fetch(this.action, { body, headers, method }) | ||
.then(throwBadResponse) | ||
.then(onSuccess) | ||
.catch(onError); | ||
} | ||
@@ -530,13 +548,16 @@ /** | ||
@bound representationChanged(name) { | ||
if (!isRepresentation(name)) return; | ||
const value = this[name]; | ||
/* istanbul ignore if */ | ||
if (!value) return; | ||
// DEPRECATED | ||
this.fire(`stripe-${dash(name)}`, value); | ||
this.fire(`${dash(name)}`, value); | ||
if (this.action) this.postRepresentation(); | ||
} | ||
if (!isRepresentation(name)) return; | ||
const value = this[name]; | ||
/* istanbul ignore if */ | ||
if (!value) return; | ||
// DEPRECATED | ||
this.fire(`stripe-${dash(name)}`, value); | ||
this.fire(`${dash(name)}`, value); | ||
if (this.action) this.postRepresentation(); | ||
} | ||
/** @private */ | ||
/** | ||
* Resets the Payment Representations | ||
* @private | ||
*/ | ||
resetRepresentations() { | ||
@@ -553,3 +574,2 @@ this.set({ | ||
/** @typedef {{ owner: stripe.OwnerData }} SourceData */ | ||
/** @typedef {{ elementType: stripe.elements.elementsType }} StripeFocusEvent */ |
@@ -114,3 +114,4 @@ import { property } from 'lit-element'; | ||
@property({ type: Array }) get displayItems() { | ||
return this.__displayItems || this.parseDatasets('stripe-display-item'); | ||
const value = this.__displayItems; | ||
return Array.isArray(value) ? value : this.parseDatasets('stripe-display-item'); | ||
} | ||
@@ -120,2 +121,3 @@ | ||
const oldValue = this.displayItems; | ||
/** @private */ | ||
this.__displayItems = value; | ||
@@ -187,3 +189,4 @@ this.requestUpdate('displayItems', oldValue); | ||
@property({ type: Array }) get shippingOptions() { | ||
return this.__shippingOptions || this.parseDatasets('stripe-shipping-option'); | ||
const value = this.__shippingOptions; | ||
return Array.isArray(value) ? value : this.parseDatasets('stripe-shipping-option'); | ||
} | ||
@@ -193,2 +196,3 @@ | ||
const oldValue = this.shippingOptions; | ||
/** @private */ | ||
this.__shippingOptions = value; | ||
@@ -256,2 +260,3 @@ this.requestUpdate('shippingOptions', oldValue); | ||
/** | ||
* Initializes the PaymentRequest Object. | ||
* @private | ||
@@ -392,7 +397,7 @@ */ | ||
/** | ||
* Parses an element's dataset number props from string to number | ||
* @param {String} selector | ||
* @return {Object} | ||
* @private | ||
*/ | ||
* Parses an element's dataset number props from string to number | ||
* @param {String} selector | ||
* @return {Object} | ||
* @private | ||
*/ | ||
parseDatasets(selector) { | ||
@@ -399,0 +404,0 @@ const elements = [...this.querySelectorAll(selector)]; |
export { StripeElements }; | ||
import { StripeElements } from "./StripeElements"; | ||
declare global { interface HTMLElementTagNameMap { 'stripe-elements': StripeElements; } } |
export { StripePaymentRequest }; | ||
import { StripePaymentRequest } from "./StripePaymentRequest"; | ||
declare global { interface HTMLElementTagNameMap { 'stripe-payment-request': StripePaymentRequest; } } |
@@ -207,3 +207,4 @@ import '@babel/runtime/helpers/esm/defineProperty'; | ||
function displayItems() { | ||
return this.__displayItems || this.parseDatasets('stripe-display-item'); | ||
const value = this.__displayItems; | ||
return Array.isArray(value) ? value : this.parseDatasets('stripe-display-item'); | ||
} | ||
@@ -215,2 +216,4 @@ }, { | ||
const oldValue = this.displayItems; | ||
/** @private */ | ||
this.__displayItems = value; | ||
@@ -354,3 +357,4 @@ this.requestUpdate('displayItems', oldValue); | ||
function shippingOptions() { | ||
return this.__shippingOptions || this.parseDatasets('stripe-shipping-option'); | ||
const value = this.__shippingOptions; | ||
return Array.isArray(value) ? value : this.parseDatasets('stripe-shipping-option'); | ||
} | ||
@@ -362,2 +366,4 @@ }, { | ||
const oldValue = this.shippingOptions; | ||
/** @private */ | ||
this.__shippingOptions = value; | ||
@@ -461,2 +467,3 @@ this.requestUpdate('shippingOptions', oldValue); | ||
/** | ||
* Initializes the PaymentRequest Object. | ||
* @private | ||
@@ -683,7 +690,7 @@ */ | ||
/** | ||
* Parses an element's dataset number props from string to number | ||
* @param {String} selector | ||
* @return {Object} | ||
* @private | ||
*/ | ||
* Parses an element's dataset number props from string to number | ||
* @param {String} selector | ||
* @return {Object} | ||
* @private | ||
*/ | ||
@@ -690,0 +697,0 @@ }, { |
declare const StripeBase_base: { | ||
new (): { | ||
[x: string]: any; | ||
_readOnlyPropertyInitializedMap: Map<string, boolean>; | ||
@@ -8,5 +7,4 @@ _setPropEntry([name, newVal]: [string, unknown]): Promise<unknown>; | ||
[x: string]: unknown; | ||
}): Promise<any>; | ||
}): Promise<void>; | ||
}; | ||
[x: string]: any; | ||
createProperty(name: string, options: import("lit-element").PropertyDeclaration<any, any> & { | ||
@@ -93,5 +91,5 @@ readOnly: boolean; | ||
* The `client_secret` part of a Stripe `PaymentIntent` | ||
* @type {String} | ||
* @type {string} | ||
*/ | ||
clientSecret: String; | ||
clientSecret: string; | ||
/** | ||
@@ -166,6 +164,7 @@ * Type of payment representation to generate. | ||
*/ | ||
shadowHosts: Node[]; | ||
private shadowHosts: Node[]; | ||
/** | ||
* Stripe.js mount point element. Due to limitations in the Stripe.js library, this element must be connected to the document. | ||
* @type {Element} | ||
* @protected | ||
*/ | ||
@@ -186,8 +185,8 @@ get stripeMount(): Element; | ||
/** | ||
* Reset the stripe element | ||
* Resets and clears the stripe element. | ||
*/ | ||
reset(): void; | ||
/** Blur the element. */ | ||
/** Blurs the element. */ | ||
blur(): void; | ||
/** Focus the element. */ | ||
/** Focuses the element. */ | ||
focus(): void; | ||
@@ -200,6 +199,9 @@ /** | ||
*/ | ||
createError(message: string): StripeElementsError; | ||
/** @private */ | ||
errorChanged(): Promise<void>; | ||
private createError(message: string): StripeElementsError; | ||
/** | ||
* Clears the Payment Representation and fires an error event | ||
* @private | ||
*/ | ||
private errorChanged(): Promise<void>; | ||
/** | ||
* Fires an event. | ||
@@ -211,3 +213,3 @@ * @param {string} type event type | ||
*/ | ||
fire(type: string, detail: any, opts?: EventInit): void; | ||
private fire(type: string, detail: any, opts?: EventInit): void; | ||
/** | ||
@@ -218,3 +220,3 @@ * Fires an Error Event | ||
*/ | ||
fireError(error: Error): void; | ||
private fireError(error: Error): void; | ||
/** | ||
@@ -227,3 +229,3 @@ * Gets a CSS Custom Property value, respecting ShadyCSS. | ||
*/ | ||
getCSSCustomPropertyValue(propertyName: string, precomputedStyle?: CSSStyleDeclaration): any; | ||
private getCSSCustomPropertyValue(propertyName: string, precomputedStyle?: CSSStyleDeclaration): any; | ||
/** | ||
@@ -235,3 +237,3 @@ * Sets the token or error from the response. | ||
*/ | ||
handleResponse(response: stripe.TokenResponse | stripe.SourceResponse | stripe.PaymentMethodResponse | stripe.PaymentIntentResponse | stripe.SetupIntentResponse): stripe.TokenResponse | stripe.SourceResponse | stripe.PaymentMethodResponse | stripe.PaymentIntentResponse | stripe.SetupIntentResponse; | ||
private handleResponse(response: stripe.TokenResponse | stripe.SourceResponse | stripe.PaymentMethodResponse | stripe.PaymentIntentResponse | stripe.SetupIntentResponse): stripe.TokenResponse | stripe.SourceResponse | stripe.PaymentMethodResponse | stripe.PaymentIntentResponse | stripe.SetupIntentResponse; | ||
/** | ||
@@ -241,14 +243,23 @@ * Reinitializes Stripe and mounts the element. | ||
*/ | ||
init(): Promise<void>; | ||
/** @private */ | ||
destroyMountPoints(): void; | ||
/** @private */ | ||
initElementListeners(): void; | ||
/** @private */ | ||
initMountPoints(): void; | ||
private init(): Promise<void>; | ||
/** | ||
* Removes all mount points from the DOM | ||
* @private | ||
*/ | ||
private destroyMountPoints(): void; | ||
/** | ||
* Adds `ready`, `focus`, and `blur` listeners to the Stripe Element | ||
* @private | ||
*/ | ||
private initElementListeners(): void; | ||
/** | ||
* Creates mount points for the Stripe Element | ||
* @private | ||
*/ | ||
private initMountPoints(): void; | ||
/** | ||
* Prepares to mount Stripe Elements in light DOM. | ||
* @private | ||
*/ | ||
initShadowMountPoints(): void; | ||
private initShadowMountPoints(): void; | ||
/** | ||
@@ -258,3 +269,3 @@ * Initializes Stripe and elements. | ||
*/ | ||
initStripe(): Promise<void>; | ||
private initStripe(): Promise<void>; | ||
/** | ||
@@ -264,3 +275,3 @@ * Mounts the Stripe Element | ||
*/ | ||
mount(): void; | ||
private mount(): void; | ||
/** | ||
@@ -270,3 +281,3 @@ * Unmounts and nullifies the card. | ||
*/ | ||
unmount(): Promise<void>; | ||
private unmount(): Promise<void>; | ||
/** | ||
@@ -276,3 +287,3 @@ * @param {StripeFocusEvent} event | ||
*/ | ||
onBlur(event: { | ||
private onBlur(event: { | ||
elementType: stripe.elements.elementsType; | ||
@@ -284,3 +295,3 @@ }): Promise<void>; | ||
*/ | ||
onFocus(event: { | ||
private onFocus(event: { | ||
elementType: stripe.elements.elementsType; | ||
@@ -293,8 +304,9 @@ }): Promise<void>; | ||
*/ | ||
onReady(event: Event): Promise<void>; | ||
private onReady(event: Event): Promise<void>; | ||
/** | ||
* POSTs the payment info represenation to the endpoint at `/action` | ||
* @private | ||
*/ | ||
postRepresentation(): Promise<void | StripeBase>; | ||
* POSTs the payment info represenation to the endpoint at `/action` | ||
* @resolves {void} | ||
* @private | ||
*/ | ||
private postRepresentation(): Promise<void>; | ||
/** | ||
@@ -304,8 +316,8 @@ * @param {string} name | ||
*/ | ||
representationChanged(name: string): void; | ||
/** @private */ | ||
resetRepresentations(): void; | ||
set(props: { | ||
[x: string]: unknown; | ||
}): Promise<StripeBase>; | ||
private representationChanged(name: string): void; | ||
/** | ||
* Resets the Payment Representations | ||
* @private | ||
*/ | ||
private resetRepresentations(): void; | ||
} | ||
@@ -312,0 +324,0 @@ export type PaymentResponse = stripe.TokenResponse | stripe.SourceResponse | stripe.PaymentMethodResponse | stripe.PaymentIntentResponse | stripe.SetupIntentResponse; |
@@ -234,3 +234,3 @@ /** | ||
*/ | ||
getPaymentMethodData(): stripe.PaymentMethodData; | ||
private getPaymentMethodData(): stripe.PaymentMethodData; | ||
/** | ||
@@ -241,3 +241,3 @@ * Returns a Stripe-friendly style object computed from CSS custom properties | ||
*/ | ||
getStripeElementsStyles(): { | ||
private getStripeElementsStyles(): { | ||
base?: stripe.elements.Style; | ||
@@ -251,3 +251,3 @@ complete?: stripe.elements.Style; | ||
*/ | ||
initElement(): Promise<void>; | ||
private initElement(): Promise<void>; | ||
/** | ||
@@ -263,7 +263,3 @@ * Updates the element's state. | ||
*/ | ||
onChange(event: stripe.elements.ElementChangeResponse): Promise<void>; | ||
postRepresentation(): Promise<void | StripeElements>; | ||
set(props: { | ||
[x: string]: unknown; | ||
}): Promise<StripeElements>; | ||
private onChange(event: stripe.elements.ElementChangeResponse): Promise<void>; | ||
} | ||
@@ -270,0 +266,0 @@ export type StripeStyleInit = { |
@@ -86,3 +86,4 @@ /** | ||
get displayItems(): stripe.paymentRequest.DisplayItem[]; | ||
__displayItems: stripe.paymentRequest.DisplayItem[]; | ||
/** @private */ | ||
private __displayItems: stripe.paymentRequest.DisplayItem[]; | ||
/** | ||
@@ -138,3 +139,4 @@ * A name that the browser shows the customer in the payment interface. | ||
get shippingOptions(): stripe.paymentRequest.ShippingOption[]; | ||
__shippingOptions: stripe.paymentRequest.ShippingOption[]; | ||
/** @private */ | ||
private __shippingOptions: stripe.paymentRequest.ShippingOption[]; | ||
/** | ||
@@ -153,7 +155,8 @@ * @type {'default'|'book'|'buy'|'donate'} | ||
*/ | ||
getStripePaymentRequestOptions(): stripe.paymentRequest.StripePaymentRequestOptions; | ||
private getStripePaymentRequestOptions(): stripe.paymentRequest.StripePaymentRequestOptions; | ||
/** | ||
* Initializes the PaymentRequest Object. | ||
* @private | ||
*/ | ||
initElement(): Promise<void>; | ||
private initElement(): Promise<void>; | ||
/** | ||
@@ -163,3 +166,3 @@ * Initialized the `PaymentRequest` object. | ||
*/ | ||
initPaymentRequest(): Promise<void>; | ||
private initPaymentRequest(): Promise<void>; | ||
/** | ||
@@ -169,3 +172,3 @@ * Creates Stripe Payment Request Element. | ||
*/ | ||
initPaymentRequestButton(): Promise<void>; | ||
private initPaymentRequestButton(): Promise<void>; | ||
/** | ||
@@ -175,3 +178,3 @@ * Attaches listeners to the `PaymentRequest` object. | ||
*/ | ||
initPaymentRequestListeners(): Promise<void>; | ||
private initPaymentRequestListeners(): Promise<void>; | ||
/** | ||
@@ -182,3 +185,3 @@ * Handle a `cancel` event | ||
*/ | ||
onCancel(originalEvent: any): void; | ||
private onCancel(originalEvent: any): void; | ||
/** | ||
@@ -193,3 +196,3 @@ * Completes the PaymentRequest. If a confirmation error is passed in the second argument, | ||
*/ | ||
complete(paymentResponse: stripe.paymentRequest.StripeTokenPaymentResponse | stripe.paymentRequest.StripeSourcePaymentResponse | stripe.paymentRequest.StripePaymentMethodPaymentResponse, confirmationError?: stripe.Error): Promise<stripe.paymentRequest.StripeTokenPaymentResponse | stripe.paymentRequest.StripeSourcePaymentResponse | stripe.paymentRequest.StripePaymentMethodPaymentResponse | { | ||
private complete(paymentResponse: stripe.paymentRequest.StripeTokenPaymentResponse | stripe.paymentRequest.StripeSourcePaymentResponse | stripe.paymentRequest.StripePaymentMethodPaymentResponse, confirmationError?: stripe.Error): Promise<stripe.paymentRequest.StripeTokenPaymentResponse | stripe.paymentRequest.StripeSourcePaymentResponse | stripe.paymentRequest.StripePaymentMethodPaymentResponse | { | ||
error: stripe.Error; | ||
@@ -204,3 +207,3 @@ }>; | ||
*/ | ||
onPaymentResponse(paymentResponse: stripe.paymentRequest.StripeTokenPaymentResponse | stripe.paymentRequest.StripeSourcePaymentResponse | stripe.paymentRequest.StripePaymentMethodPaymentResponse): Promise<void | stripe.paymentRequest.StripeTokenPaymentResponse | stripe.paymentRequest.StripeSourcePaymentResponse | stripe.paymentRequest.StripePaymentMethodPaymentResponse | { | ||
private onPaymentResponse(paymentResponse: stripe.paymentRequest.StripeTokenPaymentResponse | stripe.paymentRequest.StripeSourcePaymentResponse | stripe.paymentRequest.StripePaymentMethodPaymentResponse): Promise<void | stripe.paymentRequest.StripeTokenPaymentResponse | stripe.paymentRequest.StripeSourcePaymentResponse | stripe.paymentRequest.StripePaymentMethodPaymentResponse | { | ||
error: stripe.Error; | ||
@@ -213,3 +216,3 @@ }>; | ||
*/ | ||
confirmPaymentIntent(paymentResponse: stripe.paymentRequest.StripeTokenPaymentResponse | stripe.paymentRequest.StripeSourcePaymentResponse | stripe.paymentRequest.StripePaymentMethodPaymentResponse): Promise<void>; | ||
private confirmPaymentIntent(paymentResponse: stripe.paymentRequest.StripeTokenPaymentResponse | stripe.paymentRequest.StripeSourcePaymentResponse | stripe.paymentRequest.StripePaymentMethodPaymentResponse): Promise<void>; | ||
/** | ||
@@ -221,3 +224,3 @@ * Stripe confirmCardPayment method | ||
*/ | ||
confirmCardPayment(data: stripe.ConfirmCardPaymentData, options: stripe.ConfirmCardPaymentOptions): Promise<stripe.PaymentIntentResponse>; | ||
private confirmCardPayment(data: stripe.ConfirmCardPaymentData, options: stripe.ConfirmCardPaymentOptions): Promise<stripe.PaymentIntentResponse>; | ||
/** | ||
@@ -227,3 +230,3 @@ * @param {ShippingAddressChangeEvent} originalEvent | ||
*/ | ||
onShippingaddresschange(originalEvent: any): void; | ||
private onShippingaddresschange(originalEvent: any): void; | ||
/** | ||
@@ -233,14 +236,10 @@ * @param {ShippingOptionChangeEvent} originalEvent | ||
*/ | ||
onShippingoptionchange(originalEvent: any): void; | ||
private onShippingoptionchange(originalEvent: any): void; | ||
/** | ||
* Parses an element's dataset number props from string to number | ||
* @param {String} selector | ||
* @return {Object} | ||
* @private | ||
*/ | ||
parseDatasets(selector: string): any; | ||
postRepresentation(): Promise<void | StripePaymentRequest>; | ||
set(props: { | ||
[x: string]: unknown; | ||
}): Promise<StripePaymentRequest>; | ||
* Parses an element's dataset number props from string to number | ||
* @param {String} selector | ||
* @return {Object} | ||
* @private | ||
*/ | ||
private parseDatasets(selector: string): any; | ||
} | ||
@@ -247,0 +246,0 @@ export type ShippingAddressChangeEvent = any; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
448917
41
7406
364
+ Added@types/stripe-v3@^3.1.14
+ Added@types/stripe-v3@3.1.33(transitive)
- Removedkarma-tap-reporter@0.0.6
- Removed@colors/colors@1.5.0(transitive)
- Removed@socket.io/component-emitter@3.1.2(transitive)
- Removed@types/cors@2.8.17(transitive)
- Removed@types/node@22.13.9(transitive)
- Removedaccepts@1.3.8(transitive)
- Removedansi-regex@5.0.1(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedanymatch@3.1.3(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbase64id@2.0.0(transitive)
- Removedbinary-extensions@2.3.0(transitive)
- Removedbody-parser@1.20.3(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbraces@3.0.3(transitive)
- Removedbytes@3.1.2(transitive)
- Removedcall-bind-apply-helpers@1.0.2(transitive)
- Removedcall-bound@1.0.4(transitive)
- Removedchokidar@3.6.0(transitive)
- Removedcliui@7.0.4(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedconnect@3.7.0(transitive)
- Removedcontent-type@1.0.5(transitive)
- Removedcookie@0.7.2(transitive)
- Removedcors@2.8.5(transitive)
- Removedcustom-event@1.0.1(transitive)
- Removeddate-format@4.0.14(transitive)
- Removeddebug@2.6.94.3.74.4.0(transitive)
- Removeddepd@2.0.0(transitive)
- Removeddestroy@1.2.0(transitive)
- Removeddi@0.0.1(transitive)
- Removeddom-serialize@2.2.1(transitive)
- Removeddunder-proto@1.0.1(transitive)
- Removedee-first@1.1.1(transitive)
- Removedemoji-regex@8.0.0(transitive)
- Removedencodeurl@1.0.2(transitive)
- Removedengine.io@6.6.4(transitive)
- Removedengine.io-parser@5.2.3(transitive)
- Removedent@2.2.2(transitive)
- Removedes-define-property@1.0.1(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-object-atoms@1.1.1(transitive)
- Removedescalade@3.2.0(transitive)
- Removedescape-html@1.0.3(transitive)
- Removedeventemitter3@4.0.7(transitive)
- Removedextend@3.0.2(transitive)
- Removedfill-range@7.1.1(transitive)
- Removedfinalhandler@1.1.2(transitive)
- Removedflatted@3.3.3(transitive)
- Removedfollow-redirects@1.15.9(transitive)
- Removedfs-extra@8.1.0(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedfsevents@2.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-caller-file@2.0.5(transitive)
- Removedget-intrinsic@1.3.0(transitive)
- Removedget-proto@1.0.1(transitive)
- Removedglob@7.2.3(transitive)
- Removedglob-parent@5.1.2(transitive)
- Removedgopd@1.2.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-symbols@1.1.0(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhttp-errors@2.0.0(transitive)
- Removedhttp-proxy@1.18.1(transitive)
- Removediconv-lite@0.4.24(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-binary-path@2.1.0(transitive)
- Removedis-extglob@2.1.1(transitive)
- Removedis-fullwidth-code-point@3.0.0(transitive)
- Removedis-glob@4.0.3(transitive)
- Removedis-number@7.0.0(transitive)
- Removedis-regex@1.2.1(transitive)
- Removedisbinaryfile@4.0.10(transitive)
- Removedjsonfile@4.0.0(transitive)
- Removedkarma@6.4.4(transitive)
- Removedkarma-tap-reporter@0.0.6(transitive)
- Removedlodash@4.17.21(transitive)
- Removedlog4js@6.9.1(transitive)
- Removedmath-intrinsics@1.1.0(transitive)
- Removedmedia-typer@0.3.0(transitive)
- Removedmime@2.6.0(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedms@2.0.02.1.3(transitive)
- Removednegotiator@0.6.3(transitive)
- Removednormalize-path@3.0.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedobject-inspect@1.13.4(transitive)
- Removedon-finished@2.3.02.4.1(transitive)
- Removedonce@1.4.0(transitive)
- Removedparseurl@1.3.3(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedpunycode@1.4.1(transitive)
- Removedqjobs@1.2.0(transitive)
- Removedqs@6.13.0(transitive)
- Removedrange-parser@1.2.1(transitive)
- Removedraw-body@2.5.2(transitive)
- Removedreaddirp@3.6.0(transitive)
- Removedrequire-directory@2.1.1(transitive)
- Removedrequires-port@1.0.0(transitive)
- Removedrfdc@1.4.1(transitive)
- Removedrimraf@3.0.2(transitive)
- Removedsafe-regex-test@1.1.0(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsetprototypeof@1.2.0(transitive)
- Removedside-channel@1.1.0(transitive)
- Removedside-channel-list@1.0.0(transitive)
- Removedside-channel-map@1.0.1(transitive)
- Removedside-channel-weakmap@1.0.2(transitive)
- Removedsocket.io@4.8.1(transitive)
- Removedsocket.io-adapter@2.5.5(transitive)
- Removedsocket.io-parser@4.2.4(transitive)
- Removedsource-map@0.6.1(transitive)
- Removedstatuses@1.5.02.0.1(transitive)
- Removedstreamroller@3.1.5(transitive)
- Removedstring-width@4.2.3(transitive)
- Removedstrip-ansi@6.0.1(transitive)
- Removedtmp@0.2.3(transitive)
- Removedto-regex-range@5.0.1(transitive)
- Removedtoidentifier@1.0.1(transitive)
- Removedtype-is@1.6.18(transitive)
- Removedua-parser-js@0.7.40(transitive)
- Removedundici-types@6.20.0(transitive)
- Removeduniversalify@0.1.2(transitive)
- Removedunpipe@1.0.0(transitive)
- Removedutils-merge@1.0.1(transitive)
- Removedvary@1.1.2(transitive)
- Removedvoid-elements@2.0.1(transitive)
- Removedwrap-ansi@7.0.0(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedws@8.17.1(transitive)
- Removedy18n@5.0.8(transitive)
- Removedyargs@16.2.0(transitive)
- Removedyargs-parser@20.2.9(transitive)