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 by clicking this card.
Website Access
Access to modify the HTML/JavaScript of your website.
HTTPS
A website that uses HTTPS for secure communication.
Implementation Steps
1
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.2
Create a container
Add a container element where the widget will be rendered:
3
Initialize the widget
Configure and initialize the widget with your settings:
Replace
See supported locales
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 it to true for non-US MIDs.failOnThreeDSChallenge should be set to false by default. Set to true if you want to proceed to payment without 3DS.cancelOnThreeDSFailure should be set to false by default. Set to true if you want to cancel the payment if the 3DS not successfully completed.locale must be in the format xx-XX (e.g. en-US, fr-FR | 'language'-'COUNTRY').See supported locales
4
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.
5
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.- If you provide an email in the
customerobject, 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
1
Use test mode
Set the environment to
'sandbox' for testing:2
Use Test Cards in Sandbox
When testing in the sandbox environment, use specific test cards to simulate various payment scenarios:
- Basic Testing
- NMI Test Cards PANs
- More Test Cards
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
3
Check your test transactions
View your test transactions in the Paysight dashboard under Transactions
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.