Core Concepts
Understanding the fundamental concepts of the PaySight Widget SDK
Core Concepts
The PaySight Widget SDK is built on several core concepts that are essential to understand for effective integration and usage.
Architecture Overview
Secure iFrame Integration
The widget runs in a secure iFrame, isolating the payment form from your main application. This architecture:
- Ensures PCI compliance
- Prevents sensitive data exposure
- Maintains security across origins
- Enables seamless integration
Message-Based Communication
Communication between your application and the widget occurs through a secure message-based system:
- Events are passed via
postMessage
- All messages are validated and origin-checked
- Type-safe payload structures
- Bi-directional communication
Key Components
Widget Instance
The main interface for interacting with the payment form:
Configuration
Controls the widget’s behavior and appearance:
Event System
Handles all communication with the widget:
Core Features
Payment Processing
The widget handles the complete payment flow:
- Card data collection
- Validation
- 3D Secure verification (when required)
- Payment processing
- Result communication
Form Customization
Flexible form field configuration:
Theming System
Comprehensive styling capabilities:
Security Features
PCI Compliance
- Sensitive data handled in secure iFrame
- No card data touches your servers
- Compliant with PCI DSS requirements
3D Secure
Built-in 3DS support:
Data Validation
- Real-time field validation
- Type-safe configurations
- Secure message validation
State Management
Widget Lifecycle
-
Initialization
-
Configuration Updates
-
Cleanup
Event-Driven Updates
The widget maintains its own state and communicates changes through events:
Best Practices
Error Handling
Implement comprehensive error handling:
Resource Management
Clean up resources when the widget is no longer needed:
Type Safety
Use TypeScript for better development experience:
Next Steps
- Installation Guide - Detailed installation instructions
- Event Handling - Learn about the event system
- Styling Guide - Customize the widget appearance
- API Reference - Complete API documentation