> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tribridge.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Tribridge is a crypto payment gateway for Solana and Sui (TON is coming soon). API base URL is https://tribridge.onrender.com. Server-side calls authenticate with the x-api-key header using a tri_test_... key (fully simulated test mode, no real funds) or tri_live_... key (real mainnet payments) — never expose keys client-side. Merchant test mode is simulated, not testnet. Refunds are automatic only (underpaid/overpaid), there is no manual refund endpoint. Always verify webhook HMAC-SHA256 signatures from the X-Tribridge-Signature header before trusting payloads.

# Testing

> Validate your full integration with simulated test mode — no real funds, no chain waits.

## Using test mode

Test mode is driven by your `tri_test_...` API key plus a **test webhook**. No real funds move and no chain is involved — you trigger payments to completion and Tribridge fires your test webhook exactly like a live payment.

<Steps>
  <Step title="Register a test webhook">
    Create a webhook endpoint with `is_test: true` pointing at your server. For localhost, expose it with a tunnel (e.g. ngrok) so Tribridge can reach it.
  </Step>

  <Step title="Create a test payment">
    Call `POST /payments` with your `tri_test_...` key and open the returned `checkout_url`.
  </Step>

  <Step title="Simulate the payment">
    On the checkout page, click **Simulate Payment** (test mode only). The payment drives straight to `completed` and your test endpoint receives the full event sequence with `is_test: true`.
  </Step>

  <Step title="Verify your handler">
    Confirm your signature check passes, your order updates, and mismatches (try an underpaid simulation path if available) behave correctly. Only then switch to live keys.
  </Step>
</Steps>

<Warning>
  **Test mode ≠ testnet.** Merchant-facing test mode (test keys + test webhooks) is fully simulated on production. Public devnet/testnet networks are used internally by the Tribridge team and are not part of the merchant API. When you're ready for real money, switch to your `tri_live_...` key with live webhooks on mainnet.
</Warning>

## Sandbox best practices

* Always test your webhook signature verification in test mode before going live.
* Use separate environment variables for test and live keys so they can't be mixed up.
* Verify your system handles `payment.expired` correctly (e.g. simulate an unpaid payment passing its window).
* Make handlers idempotent — key off `payment_id` + `event` — since retries can deliver twice.
* Test underpaid/overpaid handling, not just the happy path (see [Refunds](/refunds)).

## Local testing bridge — coming soon

A local testing companion (webhook forwarding + payment simulation from your terminal, no tunnels required) is on the roadmap. Today, the tunnel + Simulate Payment flow above covers the same ground. Availability will be announced at launch.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.