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
Get your Vault API Key from ozuravault.com → your project → Applications. Your first vault project is a test project by default. To create a production project, use the project dropdown in the top-left → Create new project → enable the Production switch.| Credential | Required | Where |
|---|---|---|
| Vault API Key | Always | ozuravault.com → Applications |
| Vault Pub Key | Production only | Provided when you set up a production project — contact ammar@ozura.com |
Test/sandbox vault API key? No pub key needed — you can omit
pubKey entirely. Production vault API key? Pass your production pub key as pubKey. Do not hardcode credentials in source code; use environment variables.See Sandbox for how to create a Test project at ozuravault.com and grab a test vault key.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.