Installation
Install the package from NuGet:The SDK requires .NET 8.0 or later. It works with ASP.NET Core, Console applications, and other .NET project types.
Quick Start
Initialize the client and create a checkout session:Core Features
Async/Await
Full async Task-based API for non-blocking operations
Strong Typing
Comprehensive type safety with nullable reference types
Smart Retries
Automatic retries with exponential backoff for transient errors
Error Handling
Built-in exception hierarchy for precise error management
Configuration
Environment Variables
.env
Manual Configuration
Environments
Switch between live and test mode:Retries
The SDK automatically retries 2 times by default with exponential backoff. It retries on connection errors and status codes 408, 409, 429, and 5xx.Timeouts
Requests time out after 1 minute by default.Per-Request Overrides
Temporarily modify configuration for a single request usingWithOptions:
Common Operations
Create a Checkout Session
Manage Customers
Handle Subscriptions
Billing은 최소한 두 자리 ISO Country 코드를 요구합니다. 기존 고객을 첨부하려면 AttachExistingCustomer를 사용하거나, 새로 생성하려면 NewCustomer를 사용하세요. ProductPrice는 가장 낮은 화폐 단위입니다.에러 처리
SDK는 HTTP 상태 코드에 따라 특정 예외를 던집니다. 모든 4xx 오류는DodoPayments4xxException로부터 상속됩니다.
다른 예외 유형:
DodoPaymentsIOException: I/O 네트워킹 오류DodoPaymentsInvalidDataException: 파싱된 데이터를 해석하는 데 실패함DodoPaymentsException: 모든 예외의 기본 클래스
페이지 매기기
자동 페이지 매기기
모든 페이지의 모든 결과를 반복 처리하려면Paginate 메서드를 사용하여 IAsyncEnumerable를 반환합니다:
수동 페이지 매기기
ASP.NET Core 통합
DI 컨테이너에 클라이언트를 등록하세요:Program.cs
appsettings.json
리소스
NuGet Package
NuGet Gallery에서 패키지 보기
GitHub Repository
소스 코드 보기 및 기여
API Reference
완전한 API 문서
Discord Community
도움 받기 및 개발자와 연결
지원
C# SDK에 대한 도움이 필요하신가요?- 디스코드: 실시간 지원을 위해 커뮤니티 서버에 참여하세요
- 이메일: support@dodopayments.com으로 연락하세요
- GitHub: 저장소에서 이슈를 열어주세요