Conversation
📝 WalkthroughWalkthroughThis PR replaces the TheSieuToc card provider with TheSieuRe. The new provider uses partner credentials for authentication, implements charging and waiting-card status checking via distinct request types, parses JSON responses with status-based success logic, and logs transaction IDs while maintaining player notifications. Factory wiring, configuration files, and test coverage are updated accordingly. ChangesTheSieuRe Provider Migration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Replaces the existing thesieutoc.net card provider integration with a new thesieure.com integration. The new TheSieuReCP follows the same pattern as Card2KCP (partner-id/partner-key with MD5 signing) and uses the waiting-card flow for delayed settlement.
Changes:
- Removes
TheSieuTocCPprovider, its YAML config, and its test; addsTheSieuReCP,providers/thesieure.yml, andTheSieuReCPTest. - Registers the
thesieurekey inCardProvider.initand updates the supported-provider comment inconfig.yml. - Implements
parseResponse/isProcessedagainst the thesieure.com v2 charging API (statuses 1/99 accepted, status code mapping for check responses).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| dotman-plugin/src/main/java/net/minevn/dotman/providers/types/TheSieuReCP.kt | New provider implementation for thesieure.com. |
| dotman-plugin/src/main/java/net/minevn/dotman/providers/CardProvider.kt | Swaps the thesieutoc registration branch for thesieure. |
| dotman-plugin/src/main/resources/providers/thesieure.yml | New provider config with partner-id/partner-key placeholders. |
| dotman-plugin/src/main/resources/providers/thesieutoc.yml | Removed old provider config. |
| dotman-plugin/src/main/resources/config.yml | Updates supported-provider comment list. |
| dotman-plugin/src/test/java/net/minevn/dotman/test/providers/TheSieuReCPTest.kt | New mock-based test covering API URL and a sample doRequest call. |
| dotman-plugin/src/test/java/net/minevn/dotman/test/providers/TheSieuTocCPTest.kt | Removed test for the deleted provider. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@dotman-plugin/src/main/java/net/minevn/dotman/providers/types/TheSieuReCP.kt`:
- Around line 35-37: The parseResponse method currently prints raw provider
responses to stdout via println(response); remove that call from the CardResult
creation in parseResponse (method parseResponse in TheSieuReCP) to avoid leaking
sensitive data and noisy logs, and if you need to keep the response for
debugging use the existing logger at debug/trace level or sanitize the payload
before logging instead of printing to stdout.
- Around line 79-93: Wrap the network/JSON chain starting at get(getApiUrl(),
parameters = params).parseJson() in a try-catch so parse/network exceptions
don't short-circuit the waiting-card cycle: in the catch set isSuccess = false,
set message to a clear error (e.g. include e.message or a generic "network/parse
error"), and return true (or the value that keeps the card in waiting) so the
polling continues; implement this around the existing let block that reads
status/sets message and uses status != 99 to decide completion.
In
`@dotman-plugin/src/test/java/net/minevn/dotman/test/providers/TheSieuReCPTest.kt`:
- Around line 42-50: The testCard currently performs a live HTTP request and
only assertsNotNull; make it deterministic by stubbing the HTTP boundary used by
the provider (the mockedTheSieuReCP instance or its internal HTTP client) to
return a fixed JSON fixture, then call mockedTheSieuReCP.doRequest("testplayer",
Card("69420","67", CardPrice.CP_50K, CardType.VIETTEL)) and assert the parsed
response fields (isSuccess/boolean, message/String, transactionId/String) match
the fixture values; keep existing setup calls
(setInstance(MainConfig::class.java, mockedConfig), doReturn("testserver")...
and mockedTheSieuReCP.setInternal("main", mockedMain)) but replace real network
I/O with a mock/stub on the HTTP client used by TheSieuReCP so the test becomes
fast and deterministic.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a0246605-4070-44f0-beba-2ad88c59dead
📒 Files selected for processing (9)
dotman-plugin/src/main/java/net/minevn/dotman/providers/CardProvider.ktdotman-plugin/src/main/java/net/minevn/dotman/providers/types/Card2KCP.ktdotman-plugin/src/main/java/net/minevn/dotman/providers/types/TheSieuReCP.ktdotman-plugin/src/main/java/net/minevn/dotman/providers/types/TheSieuTocCP.ktdotman-plugin/src/main/resources/config.ymldotman-plugin/src/main/resources/providers/thesieure.ymldotman-plugin/src/main/resources/providers/thesieutoc.ymldotman-plugin/src/test/java/net/minevn/dotman/test/providers/TheSieuReCPTest.ktdotman-plugin/src/test/java/net/minevn/dotman/test/providers/TheSieuTocCPTest.kt
💤 Files with no reviewable changes (4)
- dotman-plugin/src/main/resources/providers/thesieutoc.yml
- dotman-plugin/src/test/java/net/minevn/dotman/test/providers/TheSieuTocCPTest.kt
- dotman-plugin/src/main/java/net/minevn/dotman/providers/types/Card2KCP.kt
- dotman-plugin/src/main/java/net/minevn/dotman/providers/types/TheSieuTocCP.kt

Hỗ trợ thesieure.com, và xóa bỏ tàn dư của thesieutoc
Summary by CodeRabbit
Release Notes
New Features
Tests
Chores