Skip to main content

Overview

Test mode lets you simulate payments without processing real transactions. All test credentials only work in test mode — never use them in production.

No Real Charges

Test transactions don’t process actual payments or affect real accounts.

Full API Access

All API endpoints work identically in test and live modes.

Webhook Testing

Webhooks fire for test transactions just like production.
Test credentials only work in test mode. Attempting to use them in live mode will result in payment failures.

Test Cards

Use these card numbers to simulate successful and declined payments across different regions.
For all test cards, use expiry date 06/32 (or 12/34) and CVV 123.

How to Test Renewal Failure

1

Create a test subscription

Create a subscription with your test API keys using a success test card (for example, 4242 4242 4242 4242). The initial charge should succeed and the subscription should become active.
2

Swap in the failure card via Customer Portal

Open the Customer Portal, find the subscription you just created, and click Update Payment Method. Enter the failure test card 4000 0000 0000 0341 (Expiry: 12/34, CVC: 123) and save it as the subscription’s payment method.
3

Advance the next billing date (optional)

To trigger renewal immediately instead of waiting for the natural billing cycle, use the Update Subscription API to set next_billing_date to the current UTC time. The value must be an ISO 8601 / RFC 3339 UTC timestamp (the Z suffix is required).
See the Update Subscription API reference for details.
4

Verify the failure

On the next billing attempt:
  • The renewal charge declines on the failure card
  • The subscription moves to On-Hold status
  • A payment.failed webhook event is delivered
  • The customer can return to the Customer Portal to update the payment method and retry
This card is specifically for testing renewal failures. The charge will decline on the next billing date, allowing you to test payment retry logic, customer notifications, and failure handling.

Test UPI

UPI testing uses special VPA (Virtual Payment Address) identifiers that simulate different payment outcomes.

Requirements for UPI Testing

  • Billing country must be set to IN
  • Currency must be INR
  • For non-Indian merchants: Adaptive Currency must be enabled
For complete UPI documentation including RBI mandate testing for subscriptions, see the India Payment Methods page.

Test BNPL

Buy Now Pay Later providers have specific test data requirements.

Klarna Test Data

Use these details to simulate Klarna payments in test mode:
Klarna requires a minimum transaction amount of $50.01 to appear as a payment option.

Afterpay Testing

1

Select Afterpay

Choose Afterpay as the payment method in checkout and click Pay.
2

Test successful payment

Use any valid email address and shipping address for successful payments.
3

Test failed authentication

To simulate failure, close the Afterpay modal window on the redirect page. The payment transitions from requires_action to requires_payment_method.
Afterpay requires a minimum transaction amount of $50.01 to appear as a payment option.
Để xem tài liệu BNPL đầy đủ, bao gồm cả việc kiểm thử Billie B2B, hãy xem trang Buy Now Pay Later.

Kiểm thử Digital Wallets

Apple Pay

1

Enable test mode

Sử dụng test API keys của Dodo Payments.
2

Add a card to Apple Wallet

Thêm một thẻ thật vào Apple Wallet. Trong test mode, thẻ sẽ không bị tính phí.
3

Complete test purchase

Mở checkout trên thiết bị Apple và hoàn tất quy trình Apple Pay.
Apple Pay yêu cầu HTTPS. Tính năng này sẽ không xuất hiện trên localhost nếu chưa thiết lập SSL đúng cách. Việc xác minh domain cũng phải được hoàn tất.

Google Pay

1

Join the test card group

Tham gia nhóm thẻ kiểm thử Google Pay để tự động thêm test cards vào wallet của bạn.
2

Enable test mode

Sử dụng test API keys của Dodo Payments.
3

Complete test purchase

Chọn một trong các test cards trong Google Pay để hoàn tất giao dịch.

Amazon Pay, Cash App Pay & RevolutPay

Sử dụng test API keys và làm theo quy trình checkout tiêu chuẩn. Các giao dịch kiểm thử được mô phỏng mà không phát sinh khoản phí thực tế. Để xem tài liệu Digital Wallets đầy đủ, bao gồm việc xác minh domain cho Apple Pay, hãy xem trang Digital Wallets.

Kiểm thử các phương thức châu Âu

Các phương thức thanh toán châu Âu (iDEAL, Bancontact, EPS, Multibanco) có thể được kiểm thử trong sandbox mode.
1

Enable test mode

Sử dụng test API keys của Dodo Payments.
2

Set billing address

Đặt quốc gia của billing address khớp với phương thức thanh toán:
  • NL cho iDEAL
  • BE cho Bancontact
  • AT cho EPS
  • PT cho Multibanco
3

Set currency

Các phương thức châu Âu yêu cầu currency EUR.
4

Complete test flow

Làm theo quy trình xác thực ngân hàng mô phỏng trong môi trường kiểm thử.
Để xem tài liệu đầy đủ về các phương thức thanh toán châu Âu, hãy xem trang Europe.

Các phương pháp kiểm thử tốt nhất

Đừng chỉ kiểm thử các khoản thanh toán thành công. Hãy kiểm thử cả các trường hợp bị từ chối, bị hủy và các trường hợp đặc biệt như không đủ tiền.
Đảm bảo các webhook endpoints của bạn xử lý chính xác tất cả event types, đặc biệt là payment.succeeded, payment.failed và các subscription events.Sử dụng Dodo Payments CLI để kiểm thử webhooks trên local:
  • dodo wh listen chuyển tiếp live test webhooks đến local server của bạn
  • dodo wh trigger gửi mock payloads cho tất cả 22 event types
Đối với Apple Pay và Google Pay, hãy kiểm thử trên các thiết bị iOS và Android thực tế. Simulator không mô phỏng đầy đủ hành vi của wallet.
Các phương thức thanh toán theo khu vực (UPI, iDEAL, v.v.) yêu cầu billing address tương ứng. Billing address tại Hoa Kỳ sẽ không hiển thị iDEAL.
Các phương thức BNPL yêu cầu mức tối thiểu $50.01. Hãy kiểm thử để đảm bảo chúng được hiển thị/ẩn chính xác dựa trên tổng giá trị giỏ hàng.

Các trang liên quan

Cards

Kiểm thử thẻ, 3D Secure và các phương thức thanh toán đã lưu.

Digital Wallets

Kiểm thử Apple Pay, Google Pay và Amazon Pay.

BNPL

Kiểm thử Klarna, Afterpay và Billie.

India

Kiểm thử UPI và RBI mandate.

Europe

Kiểm thử iDEAL, Bancontact, EPS và Multibanco.

Webhooks

Thiết lập webhooks cho các test events.

CLI Webhook Testing

Kiểm thử webhooks trên local bằng Dodo Payments CLI.
Lần sửa đổi cuối 31 tháng 7, 2026