GS Wrapper
Payment Methods Integration
Overview
To integrate a payment processor into our system, one effective method is through the use of an IFrame. This approach allows for seamless embedding of the payment processor's interface within our platform's user interface, providing a smooth and secure transaction experience for the user. By incorporating the payment processor in this manner, we ensure that users can complete their transactions without navigating away from our site, thereby maintaining a consistent and cohesive user journey.
The IFrame integration method involves the following key steps:
-
Secure Configuration: Ensure that the IFrame is configured securely to protect user data. This includes implementing HTTPS to encrypt data in transit and adhering to Payment Card Industry Data Security Standards (PCI DSS) for handling payment information.
-
Customization and Branding: Customize the appearance of the IFrame to match our platform's branding and design. This helps in providing a seamless user experience, making the payment process feel like an integral part of our system.
-
Responsive Design: Ensure that the IFrame is responsive and adaptable to various screen sizes and devices. This is crucial for accommodating users accessing our platform from mobile devices or tablets.
-
Error Handling and Feedback: Implement comprehensive error handling within the IFrame to provide immediate feedback to users for any issues or errors during the payment process. This includes validation errors or payment processing failures.
-
Testing and Compliance: Prior to deployment, thoroughly test the IFrame integration in various scenarios to ensure its reliability and performance. Additionally, ensure that the integration complies with all relevant legal and regulatory requirements related to online payments.
By following these steps, we can effectively integrate a payment processor via an IFrame into our system, enhancing our platform's functionality and user experience.
Integration Steps
This documentation provides a comprehensive guide to seamlessly integrate your payment processor into our system using an IFrame, coupled with configuring a callback URL to receive real-time updates on transaction statuses.
Step 1: Embedding the Payment Processor's IFrame
To integrate the payment processor's IFrame into our application, we'll follow an endpoint data exchange:
1. Endpoint Data Exchange:
We initiate a secure connection by sending a POST request to the designated endpoint of your choice.
The request includes essential user data in the request body, such as:
- User ID
- Transaction amount
- Callback URL (for transaction status notifications)
- TransactionId (our internal identifier for the transaction)
- Any additional required information.
For enhanced security, we can include a private token that need to be provided for us, in the request.
Example Request:
POST https://your-payment-processor.com/api/get-iframe-url
Body: {"userid": 123, "amount": 100, "transactionid": 1234, "token": "our_private_token", "callback_url": 'https://some-callback-url' ...moreUserData}
Example Response:
{"iframe_url": "https://payment-processor.com/iframe-session/xyz123", "status": "success"}
Additional information about the Callback URL
A crucial part of integrating with a payment processor is setting up a callback URL to our system.
-
Determine Your Callback Endpoint: Identify or create an endpoint within our system that will handle incoming POST requests from the payment processor. This endpoint will be responsible for processing transaction status updates.
- Use Verification: Implement a verification mechanism to ensure that the callback originates from the expected source. This can involve secure tokens, IP whitelists, or signature verification.
-
Configure the Callback URL with the Payment Processor: Provide the payment processor with your callback URL. This is typically done through the payment processor's merchant settings or integration configuration panel.
Step 2: Handling Transaction Status Updates
- Receiving a request from the callback URL: Transaction status updates will be received in real-time through the configured callback URL. The body must come with:
- Your transaction ID: To validate the incoming request.
- Our transaction ID: The one we sent when the deposit was created, to update the transaction from our side.
- Transaction Status: We will handle the update of the transaction according to the status.
- Hash: Before handling the status update of the transaction, we will check the veracity of the request. One way to handle this is for both parties to have a secret key, and compare the hash that you can provide us, with the one we will generate at the moment.
- Details: Any details that you consider important can be handled in the field details of our integration.
- Additional data that you consider necessary. For this to happen, we need to share a secret key
Example Request:
POST https://callback-url
Body: {"yours_transactionid": 123, "ours_transactionid": 321, "status": "success", "hash": "transactionId+hash", "details": {...}, ...additionalInfo}
- Check transaction: To verify the veracity of the request, we will compare our generated hash (or your preferred validation method), with the one provided by you.
- Update transaction: We will update the incoming transaction in our database with the status provided by the request.
- Reflect in our System: The deposit transactions for the user will be reflected in our system as soon as they are confirmed through the Callback URL provided.
Best Practices for Security and Reliability
- Secure Your Endpoint: Ensure your callback endpoint is secured using HTTPS to protect the data in transit.
- Validate Incoming Requests: Implement validation mechanisms to verify that incoming requests to your callback URL are genuinely from the payment processor. This could involve checking IP whitelists, verifying signatures, or validating tokens.
- Log Transactions: Maintain logs of all incoming transaction status updates for auditing purposes and to assist with troubleshooting any issues that may arise.
Conclusion
Integrating with a payment processor via an IFrame and configuring a callback URL in our system allows you to securely deposit funds to your customers. Following these steps will ensure a smooth integration process and reliable operation of your payment processing workflow.
Further Assistance
For additional support or questions about the integration process, users are encouraged to consult the API documentation or reach out to the support team for assistance.