Card Payments — Using Elements
Ozura Elements lets you build a card form that lives on your own page — your brand, your layout — while keeping raw card data completely off your servers. Input fields run inside isolated iframes served from Ozura’s domain. Tokenization happens in the browser; you receive a vault token (and an optional CVC session) that your backend can use to process payment.Want to skip the client-side integration? If you prefer a fully hosted payment page, see Checkout instead. If you need to tokenize from your backend, see Using the API.
How It Works
Card data travels directly from the browser to the Ozura Vault — your server only ever sees a token.Install the SDK
Quick Start
1. Get your credentials
You need both credentials from the Ozura Dashboard. Both must be passed to initialize the SDK — tokenization will fail if either is missing.| Credential | Where | Used for |
|---|---|---|
| Vault API Key | Dashboard → Vault → Applications | Client-side key |
| Vault Pub Key | Dashboard → Vault → Applications | Authenticates the tokenize request |
Both keys are required. Do not hardcode credentials directly in source code. Use environment variables to inject them at build time.
Testing? For development, you can use this pub key:
pk_prod_jys4le1jgncomgda_L8HbeakKLNRWdBXoX5A6QJUYOlhUkNleDo not use this test pub key in production or with sensitive card data. For a production pub key, contact ammar@ozura.com. See Vault Quick Start for full details.2. Initialize the vault and mount card fields
3. Process the payment on your backend
Your backend receives thetoken and cvcSession and proxies them to your payment processor:
React Integration
Using React? TheOzElements provider and hooks make wiring up card fields straightforward:
Field Validation & UX
Elements firechange events so you can reflect validation state in your UI without ever seeing the raw value:
- Format card numbers as the user types (
4111 1111 1111 1111) - Validate with the Luhn algorithm
- Detect card brand and adjust the CVV length (3 digits for most, 4 for Amex)
- Auto-advance focus from card number → expiry → CVV on completion
Styling
Pass astyle option to each element to match your design system. All standard CSS properties for text, color, and spacing are supported:
Test Cards
Use these test card numbers during integration:| Brand | Number | CVC | Expiry |
|---|---|---|---|
| Visa | 4111 1111 1111 1111 | Any 3 digits | Any future date |
| Mastercard | 5555 5555 5555 4444 | Any 3 digits | Any future date |
| Amex | 3782 822463 10005 | Any 4 digits | Any future date |
Next Steps
Elements SDK Reference
Complete API reference — all methods, options, events, and TypeScript types.
Styling & Appearance
Customize fonts, colors, and states to match your brand.
Proxy
Forward the token to your payment processor.
API Reference — Tokenize
Token response shape and all tokenize options.