Appearance
Payment Session
A payment session is a mandatory channel that enables end-users to complete a payment flow. Every payment transaction is associated with exactly one session, which serves as the foundation for the entire payment process.
Overview
Payment sessions are the core building blocks of StableMint's payment infrastructure. They provide a secure and controlled environment for processing payments, ensuring that each transaction is properly tracked, authenticated, and completed.
Types of Sessions
StableMint offers two types of payment sessions, each designed for different integration scenarios:
Hosted Session
A hosted session redirects users to StableMint's hosted checkout page. This is the simplest integration method and requires minimal development effort.
Best for:
- Quick integration
- Standard checkout flows
- When you want to maintain a consistent checkout experience
- When you don't need to customize the checkout UI
Learn more about Hosted Sessions →
Embedded Session
An embedded session integrates the payment flow directly into your website using StableMint's widget. This provides a seamless experience for your users without leaving your website.
Best for:
- Custom checkout experiences
- Single-page applications
- When you want to maintain your website's look and feel
- When you need more control over the payment flow
Learn more about Embedded Sessions →
Key Features
Both session types provide:
Security
- Encrypted communication
- Session-based authentication
- Fraud prevention measures
Flexibility
- Support for multiple payment methods
- Customizable user experience
- Webhook notifications
Reliability
- Idempotent requests
- Error handling
- Session expiration management
Implementation Considerations
When choosing between session types, consider:
Technical Requirements
- Hosted sessions require redirect handling
- Embedded sessions require widget integration
- Both require proper error handling
User Experience
- Hosted sessions provide a consistent experience
- Embedded sessions offer more customization
- Both support mobile and desktop devices
Development Effort
- Hosted sessions are quicker to implement
- Embedded sessions require more integration work
- Both require proper testing
Maintenance
- Both types require monitoring
- Both need proper error handling
- Both should implement webhook processing
Best Practices
Session Management
- Always validate session status
- Handle session expiration
- Implement proper error handling
Security
- Use HTTPS for all communications
- Implement proper authentication
- Follow security best practices
User Experience
- Provide clear error messages
- Implement proper loading states
- Handle edge cases gracefully
Testing
- Test in sandbox environment
- Verify all payment flows
- Test error scenarios
Getting Started
To implement payment sessions:
- Choose the appropriate session type based on your needs
- Follow the specific implementation guide for your chosen type
- Implement proper error handling and webhook processing
- Test thoroughly in the sandbox environment
- Monitor and maintain your implementation
For detailed implementation guides, refer to: