# Test and troubleshoot Dodo Payments (https://talivia.com/docs/revenue-guides/dodo-payments/testing-and-troubleshooting)



Use the [shared payment testing setup](https://talivia.com/docs/revenue-guides/testing-payment-providers) to keep test revenue separate from production, then apply the Dodo-specific checks below.

## Connect the test account [#connect-the-test-account]

Create an API key with write access in the Dodo test environment and connect it to your sandbox Talivia website. Talivia detects whether the key belongs to Dodo Test or Live, then uses the matching API to validate the business, import available history, and create the webhook.

There is no Dodo environment selector in Talivia. If a current Dodo key does not contain an environment prefix, Talivia validates it against the provider environments and stores the successful connection.

## Minimum test matrix [#minimum-test-matrix]

| Scenario                               | Expected Talivia result                               |
| -------------------------------------- | ----------------------------------------------------- |
| Payment Link clicked on a tracked page | Payment matched to the originating session            |
| API-created Checkout Session           | Payment matched through `metadata.talivia_session_id` |
| Overlay or Inline Checkout             | Same result as its underlying Checkout Session        |
| Link opened without visiting your site | Payment recorded as **Unattributed**                  |
| Full or partial refund                 | Original payment remains and net revenue is reduced   |
| Repeated webhook                       | No duplicate payment or refund                        |

## The connection fails [#the-connection-fails]

* **Rejected in both environments:** copy a new API key from Dodo and try again.
* **Webhook creation is forbidden:** enable write access for the key.
* **No business is found:** confirm the key belongs to a Dodo account with an available business or brand.

Reconnecting updates the managed endpoint for the Talivia webhook URL. When the account or environment changes, Talivia imports the new history and removes the previous managed endpoint.

## No payment appears [#no-payment-appears]

In the Dodo webhook settings, confirm the Talivia endpoint is enabled and the `payment.succeeded` delivery returned a successful response. Refund updates require `refund.succeeded`.

If delivery is missing, reconnect Dodo so Talivia can repair the webhook and retrieve its signing secret. If delivery is rejected, confirm the event came from the same Dodo environment as the connected key.

## The payment is unattributed [#the-payment-is-unattributed]

* **Payment Link:** open it through a normal link on a page where the Talivia tracker is running.
* **Checkout Session, Overlay, or Inline Checkout:** add the current session as `metadata.talivia_session_id` when your backend creates the Checkout Session.
* **Shared raw link:** an unattributed payment is expected when the buyer never visits your tracked website.

Do not use the Talivia session id as authentication. It is only an opaque attribution value.
