{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars/sdk_sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["code-group","admonition"]},"type":"markdown"},"seo":{"title":"Sandbox testing","description":"The specifications of Ratepay's APIs for easy payment transactions.","siteUrl":"https://docs.ratepay.com","keywords":"Ratepay developer portal, Ratepay api portal, Ratepay api reference docs","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"sandbox-testing","__idx":0},"children":["Sandbox testing"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Environment.INTEGRATION"]}," is Ratepay's sandbox, a real deployment of the Payments API that accepts test"," ","transactions without moving real money. Use it to validate that your actual request payloads are accepted,"," ","end to end, beyond what a mocked unit test can tell you."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"getting-credentials","__idx":1},"children":["Getting credentials"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Sandbox OAuth credentials (client id/secret) aren't self-service today, email ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["integration@ratepay.com"]}," if"," ","you don't already have a set for the INTEGRATION environment."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"pointing-the-client-at-the-sandbox","__idx":2},"children":["Pointing the client at the sandbox"]},{"$$mdtype":"Tag","name":"CodeGroup","attributes":{"mode":"tabs"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","data-title":"Java","header":{"title":"Java","controls":{"copy":{}}},"source":"RatepayClient client = RatepayClient.builder()\n    .clientId(System.getenv(\"RATEPAY_CLIENT_ID\"))\n    .clientSecret(System.getenv(\"RATEPAY_CLIENT_SECRET\"))\n    .environment(Environment.INTEGRATION)\n    .build();\n","lang":"java"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","data-title":"Kotlin","header":{"title":"Kotlin","controls":{"copy":{}}},"source":"val client = RatepayClient {\n    clientId(System.getenv(\"RATEPAY_CLIENT_ID\"))\n    clientSecret(System.getenv(\"RATEPAY_CLIENT_SECRET\"))\n    environment(Environment.INTEGRATION)\n}\n","lang":"kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This is exactly the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/developer/sdk/getting-started/quickstart"},"children":["quickstart"]},"'s client setup, only the environment and credentials differ from production."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"what-sandbox-testing-is-for-and-isnt","__idx":3},"children":["What sandbox testing is for (and isn't)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Run your real request-building code against ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Environment.INTEGRATION"]}," to catch:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Payloads the API rejects that your local validation (or mocks) wouldn't have caught, like malformed"," ","addresses, currency mismatches, unsupported payment-method combinations, and similar 400/422s."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Whether a full authorize → capture → refund/cancel sequence behaves the way you expect against a real"," ","backend, including realistic response shapes and timing."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["It's not a substitute for the mocked unit tests in"," ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/developer/sdk/testing/unit-testing-the-quickstart-flow"},"children":["Unit testing the quickstart flow"]}," - sandbox calls are real network"," ","requests, so they're slower, require credentials and connectivity, and aren't suitable to run on every"," ","build. A practical split: unit-test your logic against a mocked ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RatepayClient"]}," for fast, deterministic"," ","coverage in CI, and run a smaller number of sandbox-backed integration tests (or a manual pre-release"," ","checklist) to validate against the real API."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"No local stub server option"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can't point the SDK at your own local mock HTTP server as an alternative to the real sandbox."]}]}]},"headings":[{"value":"Sandbox testing","id":"sandbox-testing","depth":1},{"value":"Getting credentials","id":"getting-credentials","depth":2},{"value":"Pointing the client at the sandbox","id":"pointing-the-client-at-the-sandbox","depth":2},{"value":"What sandbox testing is for (and isn't)","id":"what-sandbox-testing-is-for-and-isnt","depth":2}],"frontmatter":{"seo":{"title":"Sandbox testing"}},"lastModified":"2026-11-03T16:42:42.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/developer/sdk/testing/sandbox-testing","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}