# Raw code

WeChat backstage requests the source data of the QR code from the business side, and the front end can generate the bus code according to the source.

# 1、 Request parameters

Parameter Name type Required Remarks
appid string And Mini Programs
appidmch_id string And Payment Merchant Number
nuncio_st string And Random string
encrypted_data string And Using AESCBCPKCS7PADDING
iv string And IV for decryption(After base 64)
sign string And 1Signature of field 5

encrypted_Data decryption data

Parameter Name type Required Remarks
openid string And user
idcard_id string And Third Party User ID (if there is a registration link)
user_public_key string And User public key in hexadecimal format, 130 bytes total

# 2、 Return parameters

Parameter Name type Required Remarks
Errcode int And 0 for success
errmsg string N Error message
nuncio_st string And Unaltered bring back
encrypted_data string And Using AESCBCPKCS7PADDING

encrypted_Data decryption data

Parameter Name type Required Remarks
base64_svr_data string And Transportation Code Standard 115 field splicing binary stream, base64 easy to network transmission

# 3、 sample code

Request:

{"appid":"test","mch_id":"123456","nonce_str":"abcdefg","encrypted_data":"jfiwajeofjiefef","iv":"afweifwefe"}

encrypted_After decryption of data:

{"openid":"1234","user_public_key":"123123","card_id":"2342343"}

Returns:

{"errcode":0,"nonce_str":"abcdefg","encrypted_data":"jfiwajeofjiefef","iv":"afweifwefe"}

encrypted_Data after decryption:

{"base64_svr_data":"xxafdafd"}