@vue-stripe/vue-stripe
Version:
Vue Stripe elements and composables for Stripe.js
97 lines • 3.68 kB
TypeScript
import { StripeElements } from '@stripe/stripe-js';
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue-demi';
type ElementsOptions = Record<string, any>;
/**
* Mode for Payment Element - determines the type of intent
* - 'payment': For PaymentIntent (one-time payments)
* - 'setup': For SetupIntent (saving payment methods for future use)
* - 'subscription': For Subscription billing
*/
type ElementsMode = 'payment' | 'setup' | 'subscription';
/**
* Indicates intent to save payment method for future use
* - 'off_session': Save for off-session payments (e.g., recurring charges)
* - 'on_session': Save for on-session payments (customer present)
*/
type SetupFutureUsage = 'off_session' | 'on_session';
/**
* Controls when to capture funds from customer's account
* - 'automatic': Capture automatically after authorization
* - 'automatic_async': Capture automatically with async processing
* - 'manual': Capture manually via API call
*/
type CaptureMethod = 'automatic' | 'automatic_async' | 'manual';
interface Props {
/**
* Client secret from PaymentIntent or SetupIntent.
* When provided, Elements will use the intent-based flow.
* When omitted, use mode/currency/amount for deferred intent creation.
*/
clientSecret?: string | undefined;
/**
* Mode for deferred intent creation (without clientSecret).
* Required when clientSecret is not provided.
* - 'payment': One-time payment
* - 'setup': Save payment method for future
* - 'subscription': Recurring billing
*/
mode?: ElementsMode | undefined;
/**
* Currency code (e.g., 'usd', 'eur') for deferred intent creation.
* Required when using mode without clientSecret.
*/
currency?: string | undefined;
/**
* Amount in smallest currency unit (e.g., cents for USD).
* Required for 'payment' and 'subscription' modes.
* Shown in Apple Pay, Google Pay, and BNPL UIs.
*/
amount?: number | undefined;
/**
* Indicates intent to save payment method for future use.
* When set, displays additional input fields and mandates as needed.
*/
setupFutureUsage?: SetupFutureUsage | undefined;
/**
* Controls when to capture funds from customer's account.
*/
captureMethod?: CaptureMethod | undefined;
/**
* List of payment method types to display.
* Omit to use Dashboard payment method settings.
*/
paymentMethodTypes?: string[] | undefined;
/**
* Additional options passed to stripe.elements().
* See Stripe documentation for all available options.
*/
options?: ElementsOptions | undefined;
}
declare function __VLS_template(): {
attrs: Partial<{}>;
slots: {
error?(_: {
error: string;
}): any;
loading?(_: {}): any;
default?(_: {}): any;
};
refs: {};
rootEl: any;
};
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
declare const __VLS_component: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
error: (error: string) => any;
ready: (elements: StripeElements) => any;
}, string, PublicProps, Readonly<Props> & Readonly<{
onError?: (error: string) => any;
onReady?: (elements: StripeElements) => any;
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};
//# sourceMappingURL=VueStripeElements.vue.d.ts.map