Card Element
A single card input field that collects card number, expiry, and CVC in one compact element. Ideal when you want a simple card form with your own submit button and surrounding layout.
How it works
1 Create session (server)
2 Initialise SDK (client)
3 Create & mount card element
4 Submit payment
All-in-one card input field
Your own submit button and form layout
element.submitPayment() to process payment Real-time validation and error display
Automatic 3DS challenge handling
Works with HTML/JS and React
Before getting started
1. Get merchant credentials
As a partner you take payments on behalf of the merchants you serve. Each merchant's Client ID and Client Secret are delivered to your registrationWebhook when the merchant connects Teya to your platform, along with the store_id and payment_webhook_public_key.
Use
client_credentials grant to obtain access tokens Each merchant store has its own set of credentials
Store credentials securely and never expose them in client-side code
A separate Client ID and Client Secret per merchant
Unlike POSLink credentials, these aren't shared across your merchant base. Each merchant you serve gets its own Client ID and Client Secret, delivered to your registrationWebhook when they connect - keep each merchant's credentials separate and don't reuse one set across multiple merchants.
Not registered yet?
Set up your partner account and implement the merchant registration flow first. Teya sends each merchant's credentials to your registration webhook.
2. API URLs
| Service | Staging | Production |
|---|---|---|
| Online Payments API | https://api.teya.xyz | https://api.teya.com |
| OAuth | https://id.teya.xyz/oauth/v2/oauth-token | https://id.teya.com/oauth/v2/oauth-token |
| Business Portal | https://business.teya.xyz | https://business.teya.com |
3. Required scopes
Request these scopes when obtaining your access token:
| Scope | Description |
|---|---|
transactions/online/create | Process an online transaction |
transactions/online/id/get | Get online transaction details |
checkout/sessions/create | Create a session for the SDK |
Install the SDK
npm install @teyaproduct/teya-blocks-js
For React applications, also install the React wrapper:
npm install @teyaproduct/teya-blocks-js @teyaproduct/teya-blocks-react
See SDK Initialization for initTeyaBlocks() options, including developmentMode for staging.
Related
- Customize - Themes, CSS variables, and element options
- Split Card - Separate card number, expiry, and CVC fields
- Apple Pay - Native Apple Pay button
- Webhooks - Receive payment confirmation notifications
- Testing - Test cards and integration checklist
Try it - Card Element
Follow the interactive quickstart below to build a working integration with the Card Element.