Testing and Debugging
Integrating with Cleeng's platform requires meticulous testing and debugging to ensure seamless performance and a robust user experience.
This guide outlines essential strategies and tools to assist developers in effectively testing and debugging their Cleeng integrations.
Test Environment
Cleeng provides two technical environments:
- sandbox
- production
When testing with Cleeng, we recommend using our Sandbox environment, available here.
Cleeng Sandbox is a safe testing space that closely mirrors our production environment. All components and their versions are identical between environments, ensuring consistency. However, please note that any offers (e.g. subscriptions, passes) need to be created separately in each environment, and values such as publisherToken
, paymentMethodId
or offerID
will differ between Production and Sandbox.
Unlike Production, the Sandbox environment is linked to test systems like Apple’s Sandbox or Adyen’s test environment, allowing end-to-end integration testing without real transactions.
The primary purpose of the Sandbox is to validate your integration with Cleeng before going live. We highly recommend using it to ensure everything works as expected in a controlled setup. Additionally, it can be used for automated testing and easily integrated into your CI pipeline, helping you catch regressions early and maintain stability across deployments.
The Sandbox is also a perfect place to experiment with different offer configurations. You can create multiple offers and fine-tune them to match your product strategy and monetization goals - all without affecting your live setup.
Tip
Sandbox makes it super easy to test recurring payments for subscriptions by letting you create subscription offers with a one-day billing period - only in Sandbox!
You can learn more about using the Sandbox here.
API Testing
Our API documentation provides an easy way to test endpoints in real-time using our sandbox environment. You can explore our API with our well-documented references:
You can also test requests directly on our API documentation pages using the “Try It” option.
For manual testing, we recommend using Postman or any other API client for quick and efficient API validation.
Preparing for API Testing
Before starting API testing, follow these steps:
- Register your Publisher Account: Sign up at Cleeng Sandbox and contact our B2B Support to specify the payment methods you want to use. We will configure them in our system.
- Set Up Offers: Configure your offers for purchase in Cleeng Sandbox.
- Obtain API Key: Retrieve your API Key (also called a publisher token) from the Cleeng Dasboard->Admin Panel: Get API Keys.
- Set Up Webhooks: You can subscribe to webhooks using this endpoint: Webhook Settings. Detailed information on the required webhook topics can be found here.
With these steps completed, you're ready to start testing API calls, such as registering a customer.
You can refer to this demo for guidance.
End-to-end testing
End-to-end testing in our system is straightforward, requiring just a few steps:
- Register at Cleeng Sandbox and contact our B2B Support to specify which payment methods you want to use. We will configure them in our system.
- Set up offers for purchase in Cleeng Sandbox.
- Integrate the offers on your website using our pre-built components (MediaStore SDK) or directly via our API (Getting Started).
- Subscribe to Webhooks: Before processing payments, ensure you subscribe to the necessary webhooks to receive real-time transaction updates. You can subscribe to webhooks using this endpoint: Webhook Settings. Detailed information on the required webhook topics can be found here.
- Perform a test purchase on your website.
- Verify the transaction in our Dashboard by checking the newly registered user details.
Key Test Scenarios
To ensure a comprehensive validation of your integration, we recommend covering the following scenarios:
- Initial Payment: Simulate a new user purchasing a subscription or a one-time offer.
- Recurring Billing: Test the renewal process to confirm that subscriptions automatically renew as expected.
- Coupon Redemption: Apply discount codes during checkout to verify that promotional offers work correctly.
- Refunds: Validate the refund process, ensuring that transactions can be correctly reversed according to platform-specific guidelines.
- One-Day Subscriptions: We recommend using one-day subscriptions for testing, as they are available exclusively in the sandbox environment and allow for faster validation of recurring payments.
Important for in-app purchases
For in-app transactions, follow our detailed guides (links below). Refunds and transaction management must be handled through the respective platforms. For example, an Apple subscription refund request must be made directly through Apple.
Automation
Automation is highly recommended. Integrating automated tests with Cleeng helps ensure that changes on your side do not unintentionally break your integration with our platform.
You can implement automation on both the API and GUI levels to cover all critical user flows and edge cases, depending on your setup and requirements. We recommend prioritizing automation of key revenue-related flows such as purchase processes, entitlement checks, and authentication/login scenarios.
Cleeng is compatible with all major testing frameworks and tools, including:
- Postman,
- RestAssured,
- Selenium, Cypress, and
- Playwright.
You should be able to connect your existing tools and pipelines with ease, making continuous testing a seamless part of your development lifecycle.
All automated tests can and should be run in the Sandbox environment, giving you a safe and isolated space to validate changes without impacting production data. These tests can be fully integrated into your CI/CD workflows to ensure every release is stable and compatible with Cleeng.
Internally, the entire Cleeng platform is automatically tested at least once per day, covering key functionalities across the system. While these tests ensure the overall health and stability of the platform, we recognize that each client may have unique configurations and implementation details tailored to their business. As such, we recommend implementing complementary tests on your side to reflect your specific setup.
When needed, we’re also available to support your automation efforts - whether through guidance, examples, or helping ensure your coverage aligns with Cleeng’s setup.
Performance testing
Performance testing is not allowed on the Cleeng platform. We handle all performance and load testing internally to ensure the stability and scalability of our systems under high traffic.
If you have specific performance concerns or would like insight into how our platform behaves under load, we’re happy to help — our team can share the latest performance test results upon request.
If you have any questions or would like to discuss particular performance scenarios relevant to your setup, please contact our B2B Support Team - we’ll be glad to assist and provide the necessary information.
You can read more on Load Testing with Cleeng here.
Staying updated with Cleeng's developments
Cleeng's platform evolves over time, introducing new features or deprecating existing ones. Regularly review Cleeng's developer documentation and release notes to stay informed about changes that could impact your integration. This proactive approach helps maintain compatibility and leverage new functionalities effectively.
Updated 6 days ago