Card payments
Accept credit and debit cards with secure, PCI-compliant input elements.
PaymentKit.js renders card inputs inside isolated iframes, ensuring sensitive card data never touches your servers.
Setup
CDN
NPM/ES Modules
Create and mount card elements
Element options
Pass options to createElement to customize appearance and behavior:
Styling
The style object applies CSS properties directly to the input element inside the iframe. For layout properties like height, border, and background, style the parent container in your HTML instead:
PaymentKit.js automatically reads your container’s padding and applies it to the input inside the iframe, so text alignment and vertical centering match your container’s styling.
Submit payment
3D Secure
3D Secure (3DS) authentication is handled automatically by PaymentKit.js when required by the card issuer or payment processor.
When 3DS is required, PaymentKit.js displays a Stripe.js authentication modal. The customer completes authentication (entering a code or biometric), and PaymentKit.js verifies the result and completes the payment. No additional code is required in your submit() call.
For 3DS to work, include Stripe.js in your page: <script src="https://js.stripe.com/v3/"></script>