At a Glance
Section | What’s Covered |
---|---|
Core API | Widget instantiation and main methods |
Configuration | WidgetConfig options, types, and parameters |
Events & Messages | Supported event types and message structure |
State Management | Widget state and lifecycle |
Error Handling | Error types, codes, and best practices |
Usage Examples | Integration, customization, and error flows |
Paysight Widget SDK API Reference
Welcome to the comprehensive Paysight Widget SDK API reference. This document details all core methods, configuration options, events, type definitions, error handling, and usage patterns to build secure, customizable payment integrations.Core API
createWidget
, WidgetOptions
and Widget
Create a new Paysight Widget instance:
WidgetConfig
Defines the options for configuring how the widget behaves, collects data, and appears.
Events & Message Types
The widget communicates state and important actions through events.Event Type | Description |
---|---|
READY | The widget has fully loaded and is ready for user input or payment initiation. |
DESTROY | The widget has been removed from the page and its resources have been cleaned up. |
PAYMENT_START | A payment process has begun, typically after the user submits the payment form. |
PAYMENT_SUCCESS | The payment was successfully authorized and completed. |
PAYMENT_ERROR | There was an error processing the payment e.g., decline, network, or system error. |
PAYMENT_3DS_START | 3D Secure authentication flow has started for the payment (if required/available). |
PAYMENT_3DS_SUCCESS | 3D Secure authentication completed successfully. |
PAYMENT_3DS_ERROR | An error occurred during the 3D Secure authentication process. |
PAYMENT_3DS_FAILURE | 3D Secure authentication failed (user challenge failed or was rejected). |
VALIDATION_ERROR | The user’s input did not pass validation (fields missing or formatted incorrectly). |
NETWORK_ERROR | The widget could not complete a server request due to network connectivity problems. |
State Management
Error Handling
Use theonError
callback to handle errors and integrate with your app’s UI/UX.
Type Definitions
Add/override form fields to control data collection.
Parameters
Defines the type of input field rendered. Use for collecting card, contact, or user details.
If true, the field is mandatory for form submission; if false/undefined, field is optional.
Places the field label above or below the input box for layout control.
Defines the field’s width: full spans container, half allows fields side-by-side.
Custom validation: supply a RegExp
pattern
and an error message
for extra input checks.Usage Examples
Next Steps
Basic Integration Example
Simple implementation example
Custom Styling Example
Customize widget appearance
For detailed configuration options, field extensions, and advanced use cases, see related guides above. Always test with sandbox credentials before launching live payments.