SDK Integration Guide
Onerway SDK provides a secure, optimized payment experience with various integration options.
Introduction
The SDK integration is an embedded payment solution that allows merchants to integrate payment functionality directly into their applications or websites:
- Integration Point: Directly embedded into the merchant's website or application
- Control Method: The merchant controls the UI/UX of the payment flow, while Onerway handles the payment processing
This SDK solution offers:
- Customizable payment interface
- Support for multiple payment methods
- Secure payment environment
- Processing of sensitive payment data
- PCI DSS compliance
- Optimized payment experience
Note
The SDK payment component is powered by Onerway core functionality, allowing merchants to customize the interface according to their needs while reducing compliance burden and security responsibilities.
Integration Flow
The SDK integration flow is as follows:
- Client obtains customer order information
- Client sends order information to server
- Server requests Onerway transaction API to obtain
transactionId
andredirectUrl
- Server sends
transactionId
andredirectUrl
to client - Client loads Onerway
JavaScript
library - Client initializes the
SDK
to render the payment component usingtransactionId
andredirectUrl
- Customer completes payment in the
SDK
payment interface - Server receives webhook notification, updates payment result, and responds with the
transactionId
Flow Diagram
⚠️ Important: After processing the webhook notification, you must return the transactionId
received in the notification payload.
Integration Best Practices
- Security Verification: Always verify notifications from Onerway to ensure authenticity
- Asynchronous Processing: Implement proper webhook handling logic to ensure transaction status is accurately updated
- Error Handling: Implement appropriate error handling and fallback mechanisms in your SDK integration
- Responsive Design: Ensure the SDK payment interface displays properly on various devices
- Testing: Thoroughly test the payment flow before deploying to production