May 18, 2021 WeChat Mini Program Development Document
WeChat background to the business side to request QR source data, the front end can be based on the source data to generate ride code.
The name of the argument | Type | Required | Note |
---|---|---|---|
appid | string | Y | Small program |
appidmch_id | string | Y | Pay the merchant number |
nonce_str | string | Y | Random string |
encrypted_data | string | Y | Use AESCBCPKCS7PADDING |
Ⅳ | string | Y | IV for decryption (after base64) |
sign | string | Y | Signature of 1 to 5 fields |
encrypted_data decrypted data
The name of the argument | Type | Required | Note |
---|---|---|---|
Openid | string | Y | User |
idcard_id | string | Y | Third-party user id (there is a registration link) |
user_public_key | string | Y | User public key, 16-step format, total 130 bytes |
The name of the argument | Type | Required | Note |
---|---|---|---|
errcode | Int | Y | 0 is a success |
errmsg | string | N | The error message |
nonce_str | string | Y | Bring it back as is |
encrypted_data | string | Y | Use AESCBCPKCS7PADDING |
encrypted_data decrypted data
The name of the argument | Type | Required | Note |
---|---|---|---|
base64_svr_data | string | Y | The binary stream stitched by the traffic code standard 1 to 15 fields, base64 is convenient for network transmission |
Request:
{"appid":"test","mch_id":"123456","nonce_str":"abcdefg","encrypted_data":"jfiwajeofjiefef","iv":"afweifwefe"}
encrypted_data decrypted:
{"openid":"1234","user_public_key":"123123","card_id":"2342343"}
Return:
{"errcode":0,"nonce_str":"abcdefg","encrypted_data":"jfiwajeofjiefef","iv":"afweifwefe"}
encrypted_data decrypted data:
{"base64_svr_data":"xxafdafd"}