Widget SDK Quick Start Guide
Integrate the PaySight Widget SDK into your website in minutes
Widget SDK Quick Start Guide
Prerequisites
Before you begin integrating the Widget SDK, ensure you have:
Paysight Account
An active Paysight merchant account. Contact your account manager to get access.
Product ID
A product ID from from a Paysight product. Create a product here
Website Access
Access to modify the HTML/JavaScript of your website.
HTTPS
A website that uses HTTPS for secure communication.
Implementation Steps
Add the SDK to your page
Include the Paysight Widget SDK in your HTML:
Create a container
Add a container element where the widget will be rendered:
Initialize the widget
Configure and initialize the widget with your settings:
Handle payment events
Implement event handlers to respond to payment status:
Update customer data (if needed)
If you don’t have all required customer data at initialization, you can update it later:
Complete Implementation Example
Configuration Options
Required Parameters
Your PaySight product ID that identifies your merchant account and product configuration. 7900 can be used for testing purposes.
A unique identifier for the payment session. This should be unique for each payment attempt.
The payment amount in the selected currency.
The environment to run the widget in. The options are ‘production’ and ‘sandbox’.
Required Form Fields
An array of field configuration objects that define form fields. Must include an email field.
Semi-Required Customer Data
Customer’s first name. Can be provided via customer object or a name field.
Customer’s last name. Can be provided via customer object or a name field.
Customer’s state/province. Can be provided via customer object or a state field.
Customer’s country code (e.g., ‘US’). Can be provided via customer object or a country field.
Optional Parameters
Enable 3D Secure authentication for the payment. Recommended for enhanced security.
Enable ecommerce mode. This is used if the payment is for a ecommerce product.
Set the language and region for the widget interface.
The currency code for the payment. Must be a valid ISO 4217 currency code.
Custom text for the payment button. Use this to match your brand voice or specific action.
UI theme customization options to match your brand. Includes font, colors, and styling.
Override the merchant ID for the payment. Requires special permissions.
Additional custom data to include with the payment. Useful for tracking and analytics.
Fields Configuration
The fields
parameter allows you to customize the form fields displayed in the widget. This is useful for collecting additional information from customers or customizing the checkout experience.
An array of field configuration objects that define custom form fields.
Each field object supports the following properties:
The label text displayed to the user.
Placeholder text shown in the input field when empty.
The type of field to display. Supported values:
email
- Email address input with validation (required)name
- Name input fieldphone
- Phone number input with formattingaddress
- Street address inputcity
- City inputstate
- State/province inputzip
- Postal/ZIP code inputcountry
- Country selection dropdowntext
- Generic text inputdivider
- Visual divider (not an input field)
Label position relative to the input field. Options: above
or below
.
Field width within the form. Options: full
, half
, or third
.
Whether the field is required to be filled before submission.
Customer Data Pre-filling
Pre-fill customer information to streamline the checkout process. This will populate the corresponding form fields.
Theme Customization
The theme
parameter allows you to customize the appearance of the widget to match your brand.
Object containing theme customization options.
URL to a custom font to use in the widget. We currently support Google Fonts only. This is a beta feature.
Base theme to use. Options: light
or dark
.
Custom CSS properties for different widget elements.
Additional Data
The data
parameter allows you to include custom data with the payment transaction, which is useful for tracking and analytics.
An object containing additional data to associate with the payment.
Testing Your Integration
Use test mode
Set the environment to ‘sandbox’ for testing:
Use test card numbers
In Sandbox mode, you can use specific test cards to simulate various real-life scenarios. These cards can be used with any valid expiry date and CVV.
Successful Payment
Card: 4242 4242 4242 4242 Expiry: Any future date CVV: Any 3 digits
Failed Payment
Card: 4000 0000 0000 0002 Expiry: Any future date CVV: Any 3 digits
Successful Payment
Card: 4242 4242 4242 4242 Expiry: Any future date CVV: Any 3 digits
Failed Payment
Card: 4000 0000 0000 0002 Expiry: Any future date CVV: Any 3 digits
These cards will trigger a 3D-Secure challenge flow, requiring additional authentication:
Visa
Any valid Visa card Expiry: Any future date CVV: Any 3 digits
Mastercard
Any valid Mastercard Expiry: Any future date CVV: Any 3 digits
American Express
Any valid Amex card Expiry: Any future date CVV: Any 4 digits
These cards will trigger a successful 3D-Secure frictionless flow (no challenge):
Visa
4111 1101 1663 8870 Expiry: Any future date CVV: Any 3 digits
Mastercard
5555 5501 3065 9057 Expiry: Any future date CVV: Any 3 digits
American Express
3782 8224 6310 005 Expiry: Any future date CVV: Any 4 digits
These cards will trigger a failed 3D-Secure frictionless flow:
Visa
4111 1117 3897 3695 Expiry: Any future date CVV: Any 3 digits
Mastercard
5555 5504 8784 7545 Expiry: Any future date CVV: Any 3 digits
American Express
3782 8224 6310 013 Expiry: Any future date CVV: Any 4 digits
These cards will trigger an attempted authentication flow:
Visa
4111 1101 4848 6405 Expiry: Any future date CVV: Any 3 digits
Mastercard
5555 5588 2481 5604 Expiry: Any future date CVV: Any 3 digits
American Express
3782 8224 6310 021 Expiry: Any future date CVV: Any 4 digits
Customization Options
Customize the appearance of the widget to match your brand:
Customize the appearance of the widget to match your brand:
Set the language and region for the widget:
Pre-fill customer information to streamline the checkout process: