Overview
To enable an instant payment (PULL/PUSH) with an external card-on-file, the following steps are required:
- Add card-on-file
- Using the External Card Creation Widget
- This step is required if you are not PCI certified
- Using API
- You can use this option if you are PCI certified
- Using the External Card Creation Widget
- For
PULLpayments, enable 3-D Secure (3DS) authentication - Initiate external card-on-file payment
Add card-on-file using the External Card Creation Widget
This step is requied if you are not PCI certified.
The External Card Creation Widget allows your customers to securely enter payment card information directly in your application. Since the widget communicates directly between the client and Synctera, it removes the need for you to be PCI certified. The information is stored securely and can be retrieved via Synctera API.
- Card Number (PAN) - Primary account number with automatic formatting
- Cardholder Name - Name on the card
- Expiration Date - Card expiry with MM/YY format
- CVV/CVC - Security code (3-4 digits)
- Billing Address - Optional billing address fields
Getting Started
Prerequisites
Before integrating the widget, ensure you have:- Synctera API Keys - Working API keys for your business
- Widget Token - A widget token for tokenizing cards (obtained from the API)
- Environment Configuration - Know which environment you’re using (
sandbox, orproduction)
API Keys
First, ensure you have your Synctera API Keys working for your business. You’ll need these to obtain widget tokens.Mobile Applications
If you’re integrating the widgets in a mobile application, you may need to use one of the following web views:- WKWebView in an iOS application
- WebView in an Android application
- WebView in React Native
Basic Integration
Step 1: Load the Widget Script
Load the External Card Creation widget script into your page by adding the following script tag to the bottom of thebody of your HTML:
Step 2: Get a Widget Token
Request a widget token for tokenizing cards from your backend using the Synctera API. The widget token is required for the widget to authenticate and submit card data.Step 3: Add the Widget Component
Add the<external-card-creation> web component to your page where you want the card form to appear:
Configuration Options
The<external-card-creation> component supports the following configuration options:
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
token | string | Yes | - | Widget token obtained from the API |
env | string | Yes | - | Environment: sandbox or production |
theme | string | No | "default" | Theme style: "default" or "night-shift" |
include-address | boolean | No | false | Show/hide billing address fields section |
custom-labels | string | No | {} | JSON string of custom labels for form fields |
Environment Configuration
Theenv property determines which API endpoint the widget uses:
sandbox- Sandbox/test environment (recommended for testing)production- Production environment
Theme Options
The widget supports two themes:Custom Labels
Customize the labels and text displayed in the widget by passing a JSON string to thecustom-labels attribute:
widgetTitle- Widget header textcardNameLabel- Name on card labelcardNumberLabel- Card number labelexpirationDateLabel- Expiration date labelsecurityCodeLabel- CVV/CVC labelstreetAddressLabel- Street address labeladdressLine2Label- Address line 2 labelcityLabel- City labelstateLabel- State labelzipCodeLabel- ZIP code labelsubmitButtonText- Submit button textsubmitLoadingText- Loading state textuseAddressOnFileLabel- Address checkbox labelbillingAddressTitle- Billing address section title
Event Handling
The widget dispatches custom events for success and failure scenarios. You can listen to these events to handle the submission results.Success Event
The widget dispatches asuccess event when card tokenization is successful:
Failure Event
The widget dispatches afailure event when card tokenization fails:
Event Callback Properties
You can also provide callback functions directly as properties:Complete Example
Here’s a complete example showing a full integration with widget token fetching and error handling:Address Fields
The widget supports optional billing address collection. Enable address fields by settinginclude-address="true":
- Street Address (Address Line 1)
- Address Line 2 (optional)
- City
- State
- ZIP Code
Field Validation
The widget automatically validates all card fields in real-time:- Card Number (PAN): Validates card number format and runs Luhn algorithm check
- Cardholder Name: Validates alphabetical characters and proper formatting
- Expiration Date: Validates MM/YY format and ensures date is not expired
- CVV/CVC: Validates 3-4 digit security code
- Address Fields: Validates address format, state codes, and ZIP codes
Card verifications
For security purposes, a number of verifications are performed when the card is added. For details, see the Verifications section.Security & PCI Compliance
All sensitive card data is handled in isolated iframes, ensuring that your application never touches PCI-sensitive information.
Security Features
- Iframe Isolation: Each field runs in its own sandboxed iframe
- No Data Exposure: Sensitive data never touches the parent page
- Token-based Authentication: Secure API communication using widget tokens
- Origin Validation: All messages validated against expected origins
- XSS Protection: All input is sanitized and validated
PCI Compliance
The widget is designed to help you maintain PCI compliance:- Sensitive card data is isolated in secure iframes
- Your application never handles raw card data
- All communication uses secure, tokenized endpoints
- The widget handles PCI compliance requirements on your behalf
Troubleshooting
Widget Not Loading
If the widget doesn’t appear on your page:- Check Script Loading: Ensure the widget script is loaded before the component is used
- Check Token: Verify the widget token is valid and not expired
- Check Environment: Ensure the
envattribute matches your API environment - Check Console: Look for JavaScript errors in the browser console
Tokenization Failing
If card submission fails:- Verify Token: Ensure the widget token is valid and not expired
- Check Environment: Ensure the
envmatches your API endpoint - Check Network: Inspect network requests in browser DevTools
- Review Error Events: Listen to the
failureevent for detailed error messages
Additional Information
Supported Browsers
The widget supports all modern browsers:- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
Responsive Design
The widget is fully responsive and adapts to mobile and desktop screens automatically.Custom Styling
The widget comes with a theme option and labels can be passed in as attributesAdd card-on-file using API
If you are PCI certified, you have the option to create the External Card directly using the card credentials by calling POST /v1/external_cards. In addition to the card credentials (pan and expiration_month/expiration_year), you must provide the customer_id and cardholder name (business_id may optionally be provided if applicable). cvv is optional (for migration purposes), but should be provided for adding new cards as it provides an additional layer of security and reduces the risk of fraud. A billing_address can be added optionally, if it is different from the cardholder’s address-on-file on the Synctera platform. For more details on CVV and address verification, see the Verifications section.
Example request/response
Example request:Verifications
When an External Card is created, the following verifications are performed:- CVV2 verification:
- CVV2 provided in the widget or in the API is validated against the CVV2 on file with the issuer
- Address verification:
- Unless billing address is specified in the widget/API, the address stored on the customer’s record on Synctera is validated against the address-on-file with the issuer
- Note that if
business_idis provided, address verification is performed on the Business’s legal address, otherwise, it is performed on the Person’s legal address. However, cardholdernamematching is performed on the Person’s name regardless.
- Name verification:
- Name provided in the widget is validated against the name on file with the issuer
verifications object. In addition to CVV2, address and name, the verifications object contains information about the card, as well as the type of transactions the card supports. If either pull_enabled or push_enabled are false, that type of transaction may not be performed using the card.
Enable 3DS and create payment
Once a card has been added on file, aPULL or a PUSH payment can be initiated with the card. For PULL payments, 3-D Secure (3DS) authentication is required. For details on how to enable 3DS, and how to iniate a payment with a card-on-file, see the Instant Payments - Card-On-File section.
