Testing Guide
Introduction
This document is crafted to assist our partners in effectively integrating and testing their systems with ours, utilizing our production environment. The emphasis is on employing test users and test products, ensuring that integration tests mimic real-world operations closely without impacting live operations.
Key Concepts
- Test Users: Use your own user accounts created for testing. These accounts simulate real user behaviors and attributes. The activation process links these test users to corresponding entities in our system.
- Test Products: Select products within your system for testing purposes that are mapped to our test products. These products are used to simulate real-world purchases and subscriptions. You will need to communicate the product IDs to us for mapping.
Preparing for Testing
1. Environment Setup
- Production Environment Usage: Engage directly with our production environment for testing to ensure your tests are as realistic as possible.
- Activation Process: The user pairing process is crucial as it establishes the linkage between your test users and our system, effectively mapping users on both ends.
2. Prerequisites
- You must have your Partner ID, Client ID, and Client Secret ready.
- Be familiar with our API specifications, authentication processes, and the user pairing guide provided in our documentation.
Testing Process
User Pairing
- CSU-ID Generation: Implement the user pairing process as described to generate a Client-Specific User ID (CSU-ID) for each of your test users.
- Complete the Activation Process: Redirect test users to the
/api/v1/partners/{partnerId}/activation
endpoint. Ensure successful redirection and retrieval of the CSU-ID, linking your test users to our system.
Authentication
- Access Token Acquisition: Use your
clientId
andclientSecret
to obtain access tokens, adhering to the authentication page guide. - API Calls with Access Token: Utilize the access token for API calls related to subscription management, including the creation and cancellation processes.
Test Scenarios
- Purchase Creation: Execute tests to create purchases for your test users with our system. Check for successful transactions and accurate API responses. Test if the users got access to the purchased test products and can use it as expected.
- Subscription Cancellation: Test the cancellation process for subscriptions, ensuring the system responds as expected.
- Error Handling: Deliberately provoke errors to confirm your system's resilience and proper error handling capabilities. Test scenarios with invalid inputs and verify the API's error responses.
Best Practices
- Response Validation: Rigorously validate API responses, including success confirmations and error messages, ensuring your system accurately interprets and acts on these responses.
- Security Measures: Securely handle your credentials (
clientId
andclientSecret
). Avoid embedding them directly in code and ensure they are securely stored and accessed within your application.