Overview
Redirect mode redirects your customers to a Payviox-hosted payment page where they complete their payment. This is the simplest and most secure integration method.How it works
1
Create payment session
Your application creates a payment session with customer and order details.
2
Redirect to Payviox
Customer is redirected to the secure Payviox payment page using the session ID.
3
Customer completes payment
Customer enters their payment information on the Payviox-hosted page.
4
Return to your site
After payment, customer is redirected back to your specified URL with the payment result.
Implementation
Example with automatic redirect
payment.js
Session parameters
ThecreateSession() method accepts two parameter objects:
Payment session details (SessionParameters)
Integration options (PayvioxParameters)
Item object structure
Each item in theitems array must have:
Return value
ThecreateSession() method returns a Promise that resolves to:
voidwhen usingredirect: true(page redirects before returning)string(session ID) in all other cases
Best practices
Validate payment parameters
Validate payment parameters
Always validate payment parameters on your server before creating sessions:
Handle network errors gracefully
Handle network errors gracefully
Implement retry logic for transient failures:
Next steps
Iframe integration
Embed payments in your page
Error handling
Handle errors gracefully
Testing
Test your integration