Secure Payment Tokenization

Accept Payments Securely
with Magpie Components

A powerful, drop-in payment card tokenization SDK. Stripe-compatible API, PCI-compliant by design, and easy to integrate into any web application.

Quick Start

Get up and running in under 2 minutes

<!-- 1. Include the Magpie SDK -->
<script src="https://components.magpie.im/sdk/magpie.js"></script>

<!-- 2. Add a container for the card element -->
<div id="card-element"></div>

<script>
  // 3. Initialize Magpie with your public key
  const magpie = new Magpie('pk_test_your_key_here');

  // 4. Create and mount the card element
  const elements = magpie.elements();
  const card = elements.create('card');
  card.mount('#card-element');

  // 5. Create a payment source
  const {source, error} = await card.createSource({
    name: 'John Doe'
  });
</script>
View Full Documentation →

How It Works

Three simple steps to secure payment collection

1

Embed the SDK

Include our lightweight JavaScript SDK on your checkout page. No server-side dependencies required.

2

Collect Card Data

Card details are entered in a secure iframe. Sensitive data never touches your servers.

3

Get a Token

Receive a secure token to process payments on your backend. PCI compliance simplified.

Built for Developers

Everything you need to accept payments securely

🔒

PCI Compliant

Card data is collected in a secure iframe, never touching your servers. Reduces PCI compliance scope significantly.

Drop-in Compatible

API designed to be compatible with Stripe Elements. Migrate existing integrations with minimal code changes.

🎨

Fully Customizable

Style the payment form to match your brand. Support for custom fonts, colors, and themes.

Real-time Validation

Built-in card validation with real-time feedback. Detect card types, validate expiry dates, and more.

🌐

Framework Agnostic

Works with vanilla JavaScript, React, Vue, Angular, or any modern framework. Examples included.

🛡️

Secure by Default

Built with security best practices. Supports CSP, SRI, HTTPS-only, and more.

Frequently Asked Questions

Everything you need to know about Magpie Components

What is Magpie Components? +
Magpie Components is a secure payment card tokenization SDK that allows you to collect payment card details on your website without handling sensitive data directly. It's designed to be drop-in compatible with Stripe Elements, making migration easy.
Is it PCI compliant? +
Yes! Card data is collected in a secure iframe that's isolated from your page. The sensitive card details never touch your servers, significantly reducing your PCI compliance scope to SAQ-A level.
How is it different from Stripe Elements? +
Magpie Components is designed to be API-compatible with Stripe Elements, so you can use similar code patterns. The main difference is that Magpie Components can be self-hosted and customized for your specific needs, giving you more control over your payment infrastructure.
What frameworks are supported? +
Magpie Components works with any JavaScript framework or vanilla JS. We provide examples for React, Vue, Angular, and more in our documentation. The SDK is framework-agnostic and uses standard web APIs.
Can I customize the styling? +
Absolutely! You can customize fonts, colors, spacing, and more using the style configuration. We support custom CSS properties, themes, and even allow you to load custom web fonts.
What about testing? +
We provide test card numbers for various scenarios including successful payments, declined cards, and error cases. Use your test API keys (pk_test_...) during development, and we'll never charge real cards.

Ready to Get Started?

Start accepting payments in minutes