### Example Response
Source: https://pay.weixin.qq.com/doc/v2/merchant/4011983158
An example of a complete XML response, illustrating the structure and content of a successful profit distribution query.
```APIDOC
## Example Response
### Description
This example shows a typical XML response for a successful profit distribution query.
### Response Example
```xml
10000100
wx2421b1c4370ec43b
6cefdb308e1e2e8aabd48cf79e546a02
P20150806125346
4006252001201705123297353072
3008450740201411110007820472
FE56DD4AA85C0EECA82C35595A69E153
FINISHED
[
{
"amount": 10,
"fail_reason":"NO_RELATION",
"description": "分帐1900000110"
" finish_time":"2015-05-20T13:29:35.120+08:00",
"receiver_account":"1900000109",
"receiver_mchid":"1900000110",
"result":"SUCCESS",
"type":"MERCHANT_ID",
"detail_id": 36011111111111111111111
} ]
```
```
--------------------------------
### Example XML Request
Source: https://pay.weixin.qq.com/doc/v2/partner/4011941745
An example of the XML structure for a refund notification request.
```APIDOC
## Example XML Request
```xml
SUCCESS
```
```
--------------------------------
### Normal Response Example
Source: https://pay.weixin.qq.com/doc/v2/merchant/4011987320
This is a standard successful response example for a Weixin Pay or QQ Pay transaction.
```APIDOC
## Normal Response Example
### Response
```xml
```
```
--------------------------------
### Example of Redirect URL with Parameters
Source: https://pay.weixin.qq.com/doc/v2/merchant/4011936869
This example demonstrates the correct format for a `redirect_url` when it includes parameters, ensuring it is properly URL-encoded for H5 payment redirection.
```URL
https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx20161110163838f231619da20804912345&package=1037687096&redirect_url=https%3A%2F%2Fwww.wechatpay.com.cn
```
--------------------------------
### WeChat Pay H5 Entrust Web API Request URL
Source: https://pay.weixin.qq.com/doc/v2/partner/4011988368
This is an example of a GET request URL for the H5 Entrust Web API. Ensure all parameters are correctly encoded and signed.
```http
https://api.mch.weixin.qq.com/papay/partner/h5entrustweb?appid=wx426a3015555a46be&contract_code=122&contract_display_account=name1&mch_id=1223816102&sub_mch_id=1223816103¬ify_url=www.qq.com%2Ftest%2Fpapay&plan_id=106&request_serial=123&return_appid=wxcbda96de0b165542&clientip=12.1.1.12×tamp=1414488825&version=1.0&sign=130C7B07DD3B8074F7BF8BEF5C9A86487A1C57478F8C55587876B9C782F72036
```
--------------------------------
### Display Program Help and Parameters
Source: https://pay.weixin.qq.com/doc/v2/merchant/4012203398
View all available command-line parameters and options for the wxpaymonitor tool by running it with the -h flag. This provides a comprehensive list of functionalities.
```bash
./wxpaymonitor -h
```
--------------------------------
### Download Monitoring Program Package
Source: https://pay.weixin.qq.com/doc/v2/merchant/4012203398
Use wget to download the stable version of the wxpaymonitor program package directly on the server. Ensure to use the --no-check-certificate option if necessary.
```bash
wget --no-check-certificate
https://wx.gtimg.com/opitil/file/wxpaymonitor-stable.tgz
```
--------------------------------
### WeChat Pay H5 Entrust Web Request URL
Source: https://pay.weixin.qq.com/doc/v2/merchant/4011987295
This is an example of the GET request URL for initiating an H5 entrust web payment. Ensure all parameters, including the signature, are correctly formatted and included.
```http
https://api.mch.weixin.qq.com/papay/h5entrustweb?appid=wx426a3015555a46be&contract_code=122&contract_display_account=name1&mch_id=1223816102¬ify_url=https%3A%2F%2Fwww.qq.com%2Ftest%2Fpapay&plan_id=106&request_serial=123& return_appid= wxcbda96de0b165542&clientip=12.1.1.12×tamp=1414488825&version=1.0&sign= 130C7B07DD3B8074F7BF8BEF5C9A86487A1C57478F8C55587876B9C782F72036
```
--------------------------------
### Signature Generation Example (MD5)
Source: https://pay.weixin.qq.com/doc/v2/merchant/4011937148
Demonstrates how to construct the string for MD5 signature generation and the expected output. Ensure your merchant platform API key is correctly used.
```plaintext
//key:商户平台设置的apiv2密钥,可参考该文档设置:https://kf.qq.com/faq/180830UVRZR7180830Ij6ZZz.html
stringSignTemp = "appid=wxd678efh567hg6787&noncestr=5K8264ILTKCH16CQ2502SI8ZNMTM67VS&package=Sign=WXPay&partnerid=1900000109&prepayid=wx1217752501201407033233368018×tamp=1490840662&key=qazwsxedcrfvtgbyhnujmikolp111111"
//MD5签名方式
sign = MD5(stringSignTemp).toUpperCase() = "DE9B6A17F5B8391FFE5272E89F33BEE2"
```
--------------------------------
### Example Decrypted `req_info`
Source: https://pay.weixin.qq.com/doc/v2/merchant/4011935223
An example of the content after decrypting the `req_info` field.
```APIDOC
## Example Decrypted `req_info`
```xml
```
```
--------------------------------
### Example XML Notification
Source: https://pay.weixin.qq.com/doc/v2/merchant/4011935223
An example of the XML structure for a refund notification.
```APIDOC
## Example XML Notification
```xml
```
```
--------------------------------
### WXLaunchMiniProgram
Source: https://pay.weixin.qq.com/doc/v2/merchant/4015996790
This API is used to launch a mini-program for contract signing after a merchant has completed the 'Entrusted Deduction APP Pre-signing' process. It requires the WeChat Open SDK and specific configurations on the WeChat Open Platform.
```APIDOC
## WXLaunchMiniProgram
### Description
This API is used to launch a mini-program for contract signing after a merchant has completed the 'Entrusted Deduction APP Pre-signing' process. It requires the WeChat Open SDK and specific configurations on the WeChat Open Platform.
### Method
Not specified (SDK-based invocation)
### Endpoint
Not applicable (SDK function call)
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Parameters
- **userName** (String) - Required - The username of the mini-program to jump to for signing. This can be obtained from the `miniprogram_username` parameter in the pre-signing interface response.
- **path** (String) - Required - The path of the mini-program to jump to for signing. This can be obtained from the `miniprogram_path` parameter in the pre-signing interface response.
- **miniprogramType** (Integer) - Required - Fixed value of 0 (production version).
### Request Example
This API is invoked via an SDK. Refer to the platform-specific development examples:
- [Android Development Example](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Launching_a_Mini_Program/Android_Development_example.html)
- [iOS Development Example](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Launching_a_Mini_Program/iOS_Development_example.html)
- [OHOS Development Example](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Launching_a_Mini_Program/OHOS_Development_example.html)
### Response
#### Success Response
No direct response is provided by this API. Upon successful signing, the merchant system will receive a "Signing, Unsigning Result Notification." Refer to the relevant pre-signing documentation for details on this notification.
#### Response Example
Not applicable. Refer to the "Signing, Unsigning Result Notification" documentation.
```
--------------------------------
### wx.navigateToMiniProgram
Source: https://pay.weixin.qq.com/doc/v2/partner/4011988367
This method is used to navigate to the Weixin Mini Program for deductible signing. It requires specific parameters to be passed for a successful transaction.
```APIDOC
## wx.navigateToMiniProgram
### Description
Initiates the deductible signing process by navigating the user to the Weixin Mini Program.
### Method
wx.navigateToMiniProgram(OBJECT)
### Parameters
#### OBJECT Parameters
- **appId** (string[1,32]) - Required - The fixed Weixin Mini Program AppID for signing: `wxbd687630cd02ce1d`. This AppID must be added to the `navigateToMiniProgramAppIdList` in the Mini Program's `app.json` configuration.
- **extraData** (object) - Required - Contains the signing request parameters. See `extraData` field details for more information.
- **appid** (string[1,32]) - Required - The AppID of the merchant's official account or mobile application.
- **mch_id** (string[1,32]) - Required - The merchant number assigned by Weixin Pay.
- **sub_appid** (string[1,32]) - Optional - The AppID bound to the sub-merchant number. Requires the service provider to bind it in the merchant platform.
- **sub_mch_id** (string[1,32]) - Required - The sub-merchant number assigned by Weixin Pay.
- **plan_id** (string[1,28]) - Required - The agreement template ID. Refer to the development steps for its location.
- **contract_code** (string[1,128]) - Required - The merchant's contract code, unique within the same merchant number. Must consist of numbers and letters.
- **request_serial** (int64) - Required - A unique serial number for the signing request, used for sorting. Must be a pure number, not starting with 0, and within the int64 range.
- **contract_display_account** (string[1,128]) - Required - The display name of the user's account on the signing page. Avoid using UTF8 non-3-byte encoded characters like emojis.
- **notify_url** (string[1,256]) - Required - The callback URL for receiving successful signing notifications. Must start with http or https, be accessible externally, and not contain parameters. The parameter value must be URL-encoded.
- **sign** (string[1,32]) - Required - The signature, generated according to the signature generation algorithm.
- **timestamp** (int64) - Required - The current system time in seconds (10 digits).
- **outerid** (string[1,]) - Optional - The user's identifier on the merchant's side.
- **path** (string[1,64]) - Required - The fixed path for opening the Mini Program: `pages/index/index`.
- **success** (Function) - Required - Callback function executed upon successful API call.
- **fail** (Function) - Required - Callback function executed upon failed API call.
- **complete** (Function) - Required - Callback function executed after the API call completes, regardless of success or failure.
### Request Example
```javascript
wx.navigateToMiniProgram({
appId:'wxbd687630cd02ce1d',
path:'pages/index/index',
extraData:{
appid:'wx426a3015555a46be',
contract_code:'122',
contract_display_account:'张三',
mch_id:'1223816102',
sub_mch_id:'1900000109',
notify_url:'https://www.qq.com/test/papay',
plan_id:'106',
request_serial:123,
timestamp:1414488825,
sign:'FF1A406564EE701064450CA2149E2514'
},
success(res) {
// Successfully navigated to the signing Mini Program
},
fail(res) {
// Failed to navigate to the signing Mini Program
}
})
```
### Response
Upon successful signing and return to the merchant's Mini Program, the `onShow` event will carry parameters indicating the result. Refer to the [Mini Program Development Documentation onShow Parameters](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/app-service/app.html) for details.
```
--------------------------------
### Example Decrypted req_info
Source: https://pay.weixin.qq.com/doc/v2/merchant/4011937201
This is an example of the content after decrypting the `req_info` field from the refund notification.
```APIDOC
## Example Decrypted req_info
```xml
```
```
--------------------------------
### Start Monitoring Program
Source: https://pay.weixin.qq.com/doc/v2/merchant/4012203398
Initiate the WeChat Pay monitoring program by running the start command with the service.sh script. This command is used for the continuous background running mode.
```bash
./service.sh start
```
--------------------------------
### Full XML Response Example
Source: https://pay.weixin.qq.com/doc/v2/partner/4011984209
This XML snippet shows a complete API response for a successful transaction, including standard fields and the promotion_detail field containing JSON-formatted promotional data. This is an example of a typical successful return.
```xml
1
```