Merged
Conversation
Contributor
Author
There was a problem hiding this comment.
Pull Request Overview
This PR adds the new device parameter to the WeChat Pay Score API models and updates tests to include serialization of this field.
- Introduces a
Deviceclass to represent device information. - Adds a
devicefield to bothWxPayScoreRequestand partner requests, and updates Javadoc. - Updates tests to build requests with
deviceand outputs example JSON.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/Device.java | New POJO for device information with GSON annotations. |
| weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPayScoreRequest.java | Added device field and updated Javadoc example. |
| weixin-java-pay/src/test/java/com/github/binarywang/wxpay/bean/payscore/WxPayScoreRequestTest.java | Updated test to include .device(...) in builder and example JSON. |
| weixin-java-pay/src/test/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerPayScoreRequestTest.java | New test class for partner request covering the device parameter. |
Comments suppressed due to low confidence (2)
weixin-java-pay/src/test/java/com/github/binarywang/wxpay/bean/payscore/WxPayScoreRequestTest.java:18
- The test currently only prints the JSON output; consider adding assertions (e.g., using a JSON comparison or JsonAssert) to verify that the
deviceobject is serialized with the correct field names and values.
.device(new Device("deviceId","deviceId","212323232"))
weixin-java-pay/src/test/java/com/github/binarywang/wxpay/bean/payscore/WxPartnerPayScoreRequestTest.java:19
- This test prints the JSON without any assertions; adding assertions to confirm that the
devicefields appear correctly in the serialized output will catch regressions in serialization.
.device(new Device("deviceId","deviceId","212323232"))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

微信支付分接口 https://pay.weixin.qq.com/doc/v3/merchant/4012587900 新增字段device