Configuration Guide
How to configure the Paysight Widget for your specific needs, with up-to-date best practices.
Widget Configuration
The Paysight Widget is highly configurable to meet your business needs. This guide covers required parameters, customer data handling, optional settings, and best practices for a robust integration.
Required Parameters
Your Paysight product ID that identifies your merchant account and product configuration. 7900
can be used for testing purposes.
A unique identifier for the payment session. This should be unique for each payment attempt.
The payment amount in the selected currency. 1.00
= $1.00
is the default value for testing or a specified amount for live testing (e.g. 14.99
= $14.99
).
The environment to run the widget in. The options are ‘production’ and ‘sandbox’.
Semi-Required Customer Data
The following customer fields are semi-required. They can be provided either via the customer
object or as fields in the fields
array.
Customer’s first name. Can be provided via customer object or a name field.
Customer’s last name. Can be provided via customer object or a name field.
Customer’s state/province. Can be provided via customer object or a state field.
Customer’s country code (e.g., ‘US’). Can be provided via customer object or a country field.
This string is only required if the country is US.
Optional Parameters
Enable 3D Secure authentication for the payment. Recommended for enhanced security.
Enable ecommerce mode. This is used if the payment is for a ecommerce product.
Currently not supported in the widget. Stay tuned for updates on this feautre.
Set the language and region for the widget interface.
The currency code for the payment. Must be a valid ISO 4217 currency code.
Custom text for the payment button. Use this to match your brand voice or specific action.
UI theme customization options to match your brand. Includes font, colors, and styling.
Override the merchant ID for the payment. Requires special permissions.
Disable specific card types from being used in the payment.
Supported values:
visa
mastercard
american-express
discover
diners
jcb
Additional custom data to include with the payment. Useful for tracking and analytics.
Fields Configuration
The fields
parameter allows you to customize the form fields displayed in the widget. This is useful for collecting additional information from customers or customizing the checkout experience.
An array of field configuration objects that define custom form fields.
Each field object supports the following properties:
The label text displayed to the user.
Placeholder text shown in the input field when empty.
The type of field to display. Supported values:
email
- Email address input with validation (required)name
- Name input fieldphone
- Phone number input with formattingaddress
- Street address inputcity
- City inputstate
- State/province inputzip
- Postal/ZIP code input
It is recommended to put a real ZIP code if you were to test live MIDs due to Address Verification Service (AVS) check, which is a fraud prevention measure used for processing credit card transactions.
country
- Country selection dropdowntext
- Generic text inputdivider
- Visual divider (not an input field)
Label position relative to the input field. Options: above
or below
.
Field width within the form. Options: full
, half
, or third
.
Whether the field is required to be filled before submission.
Theme Configuration
The theme
parameter allows you to customize the appearance of the widget to match your brand.
Object containing theme customization options.
URL to a custom font to use in the widget. We currently support Google Fonts only. This is a beta feature.
Base theme to use. Options: light
or dark
.
Custom CSS properties for different widget elements.
See the Styling Guide for detailed theme customization options.
Additional Data
The data
parameter allows you to include custom data with the payment transaction, which is useful for tracking and analytics.
An object containing additional data to associate with the payment.
Google tracking parameters (gclid
, wbraid
, and gbraid
) are automatically captured from URL parameters when available, but can also be manually specified.
Feature-Specific Configuration
You can customize the text displayed on the payment button to better match your brand voice or the specific action being taken.
The custom button feature allows you to replace the default “Pay Now” text with your own text, such as “Complete Purchase”, “Subscribe”, or “Donate Now”.
Default Button Text
By default, the payment button displays “Pay Now” or its localized equivalent based on the selected locale.
You can customize the text displayed on the payment button using the buttonText
property:
This allows you to:
- Match the button text to your specific use case (e.g., “Subscribe”, “Donate”, “Pay Now”)
- Maintain consistent language across your application
- Improve conversion rates with action-oriented text
The button text will automatically update when the payment is processing to indicate the current state.
You can customize the text displayed on the payment button to better match your brand voice or the specific action being taken.
The custom button feature allows you to replace the default “Pay Now” text with your own text, such as “Complete Purchase”, “Subscribe”, or “Donate Now”.
Default Button Text
By default, the payment button displays “Pay Now” or its localized equivalent based on the selected locale.
You can customize the text displayed on the payment button using the buttonText
property:
This allows you to:
- Match the button text to your specific use case (e.g., “Subscribe”, “Donate”, “Pay Now”)
- Maintain consistent language across your application
- Improve conversion rates with action-oriented text
The button text will automatically update when the payment is processing to indicate the current state.
For advanced use cases, you can override the default merchant ID using the midOverride
property:
This feature is useful for:
- Multi-merchant platforms
- White-label solutions
- Testing specific merchant configurations
Complete Configuration Example
Full HTML Example
Full HTML Example
Configuration Best Practices
Validate Required Fields
Always ensure all required fields are provided with valid values.
Missing or invalid required fields will prevent the widget from initializing properly.
Use Unique Session IDs
Generate a unique session ID for each payment attempt to prevent duplicate charges and ensure proper tracking.
Implement Error Handling
Always provide an onError
handler to catch and respond to configuration errors.
Test Configuration Changes
When updating configuration dynamically, test all possible combinations to ensure a smooth user experience.
Use test card numbers
In Sandbox mode, you can use specific test cards to simulate various real-life scenarios. These cards can be used with any valid expiry date and CVV.
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
These cards will trigger a 3D-Secure challenge flow, requiring additional authentication:
Visa
Any valid Visa card Expiry: Any future date CVV: Any 3 digits
Mastercard
Any valid Mastercard Expiry: Any future date CVV: Any 3 digits
American Express
Any valid Amex card Expiry: Any future date CVV: Any 4 digits
These cards will trigger a successful 3D-Secure frictionless flow (no challenge):
Visa
4111 1101 1663 8870 Expiry: Any future date CVV: Any 3 digits
Mastercard
5555 5501 3065 9057 Expiry: Any future date CVV: Any 3 digits
American Express
3782 8224 6310 005 Expiry: Any future date CVV: Any 4 digits
These cards will trigger a failed 3D-Secure frictionless flow:
Visa
4111 1117 3897 3695 Expiry: Any future date CVV: Any 3 digits
Mastercard
5555 5504 8784 7545 Expiry: Any future date CVV: Any 3 digits
American Express
3782 8224 6310 013 Expiry: Any future date CVV: Any 4 digits
These cards will trigger an attempted authentication flow:
Visa
4111 1101 4848 6405 Expiry: Any future date CVV: Any 3 digits
Mastercard
5555 5588 2481 5604 Expiry: Any future date CVV: Any 3 digits
American Express
3782 8224 6310 021 Expiry: Any future date CVV: Any 4 digits
When prompted for 3DS authentication in test mode, use any value to complete the process.