Widget SDK Quick Start Guide
Get started integrating the Paysight Widget SDK in minutes. This guide covers the minimal setup for most use cases. For advanced configuration, see the Configuration Guide and Styling Guide.
The Paysight Widget SDK allows you to embed secure payment processing directly into your website or application. This guide will walk you through the implementation process step by step.
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 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:
If using a framework (React, Vue, Angular, etc.), load the script via your framework’s asset loader or <head>
component.
Create a container
Add a container element where the widget will be rendered:
Initialize the widget
Configure and initialize the widget with your settings:
Replace productId
with your actual product ID from your Paysight account.
amount
should be a decimal (e.g. 1.00 for $1.00).
country
is always required (two-letter code, uppercase, e.g. US
or UK
).
state
is required for US transactions (two-letter code, e.g. CA
).
Use a real zip code for best approval rates.
Email is not required in fields
if provided in the customer
object.
threeDSRequired
should be set to false
by default. Set to true
for non-US MIDs.
locale
must be in the format xx-XX
(e.g. en-US
, fr-FR
| 'language'
-'COUNTRY'
).
See supported locales
Handle payment events
Implement event handlers to respond to payment status:
Example of a failed Payment Event Payload
Example of a failed Payment Event Payload
You can access all relevant transaction, customer and card data in the message.payload
object.
When handling payment events, always log or inspect the full message.payload
object. This gives you access to all transaction, customer, and card details for debugging.
See the Events Guide for a complete list of events and payload details.
Update customer data (if needed)
If you don’t have all required customer data at initialization, you can update it later:
Updating customer data does not auto-update UI fields if already rendered.
Prefill vs. Fields: Two Approaches
You can either prefill customer data using the customer
object (fields are hidden and prefilled), or collect data from the user using the fields
array.
You can also mix both—prefill some fields and collect others.
Key points:
- If you provide an email in the
customer
object, you do not need an email field infields
. The payment button will be enabled as long as a valid email is present in either source. - The more customer data you provide, the better the chance of transaction approval.
Testing Your Integration
Use test mode
Set the environment to 'sandbox'
for testing:
Use Test Cards in Sandbox
When testing in the sandbox environment, use specific test cards to simulate various payment scenarios:
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
For comprehensive 3D-Secure testing, refer to the Configuration Guide which includes cards for challenge flows, frictionless flows, and attempted authentication scenarios.
Check your test transactions
View your test transactions in the Paysight dashboard under Transactions v2
Next Steps
Configuration Guide
Explore all configuration options for the widget.
Event Handling
Learn how to handle all widget events.
Styling Guide
Customize the widget appearance to match your brand.
For a complete reference of all Widget SDK features and options, see the Technical Reference.