components/VueStripeCardElement.ts

vue-stripe · packages/vue-stripe/src/components/VueStripeCardElement.ts · typescript · MIT
payments

Vue component wrapping Stripe Card Element with event handling and custom options.

// Source: https://github.com/vue-stripe/vue-stripe | License: MIT | Copyright 2021-2026 Jofferson Ramirez Tiquez
// Provided via justclaw.it.com; keep this notice with the code.
import type {
  StripeCardElement,
  StripeCardElementChangeEvent,
  StripeCardElementOptions
} from '@stripe/stripe-js'
import type {
  BaseElementEvents,
  CreateOnly,
  LoadErrorEvent,
  NetworksChangeEvent
} from '../utils/element-factory'
import { createStripeElement } from '../utils/element-factory'

type CardEvents = BaseElementEvents<StripeCardElement, StripeCardElementChangeEvent> & {
  networkschange: NetworksChangeEvent<'card'>
  loaderror: LoadErrorEvent<'card'>
}

/** Single-line card input (number, expiry, CVC, postal code). Use within `<VueStripeElements>`. */
export default /* @__PURE__ */ createSt

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key