Comprehensive implementation guide for the Paysight Widget SDK, including configuration, interfaces, error handling and endpoints
Section | Description |
---|---|
Configuration | WidgetConfig interface, parameter reference |
Instantiation | How to create and control your widget instance |
Error Handling | Error codes, troubleshooting, recovery actions |
Environments | local, sandbox, production |
Advanced Topics | Theming, localization, advanced usage, examples |
sessionId
to ensure security and track activity.FieldConfig
: Custom field setup (label, placeholder, type, size, position).FieldConfig
field types at API ReferenceCustomerMetadata
: Pre-fill customer info (email, phone, address, etc.).WidgetTheme
: Light/dark mode, font, CSS specified custom classes.update(updates: Partial<WidgetConfig>)
: Live-update widget config.destroy()
: Cleanup widget resources after use.Code | Meaning | Typical Cause | How to Fix |
---|---|---|---|
INVALID_CONFIG | Invalid widget configuration | Missing/incorrect WidgetConfig | Review parameter requirements |
INVALID_MERCHANT | Merchant not found or not permitted | Bad merchant ID, account setup | Check your productId/midOverride |
INVALID_ENVIRONMENT | Bad environment value | Typo in ‘environment’ field | Use ‘production’ or ‘sandbox’ |
INVALID_LOCALE | Locale not found | Locale value in config is not recognized or supported | Use only supported values (e.g., ‘en-US’, ‘fr-FR’) |
INVALID_CURRENCY | Currency not found | Currency code is missing, misspelled or unsupported | Set a valid ISO currency code (e.g., ‘USD’, ‘EUR’) |
INVALID_URL | Invalid widget URL | Widget endpoint URL is malformed or points to disallowed origin | Check the endpoint URL, use official sandbox or production endpoints |
CONFIGURATION_ERROR | Configuration error occurred | WidgetConfig is missing required fields or parameters are in invalid format | Review WidgetConfig: ensure all required settings are present and valid. |
INITIALIZATION_ERROR | Widget failed to initialize | Bad targetId or environment | Check DOM and endpoint usage |
COMMUNICATION_ERROR | Communication with widget failed | Bad or missing config fields | Check all required config values |
VALIDATION_ERROR | Validation failed (e.g., email, amount) | Invalid field or payload | Check form field content |
CONTEXT_ERROR | Context error occurred | Wrong environment or missing target | Use browser, valid container/ID |
UNKNOWN_ERROR | Unexpected/unknown error | Rare/edge cases | Check SDK logs and contact support |
Environment | Endpoint URL |
---|---|
Local | http://localhost:3001/widget |
Sandbox | https://payment.paysight.io/widget |
Production | https://payment.paysight.io/widget |