# Scan Code Payment

# (1) Payment callback interface

After calling the WeChat charging interface, the business party receives the charging result notification.

# 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
sign string And 1Signature of field 5

The decrypted parameters are as follows:

Parameter Name type Required Remarks
openid string And User openid under applid
bank_type string And Payment type
total_fee int And Total payments in points
trade_state string And Payment status: SUCCESS/FAIL
trade_msg string N Return if payment fails
transaction_id string And WeChat Payment Voucher
out_trade_No string And Bus Code Business Order Number
attach string N The cost of the API input, the original back
time_end string And Payment completion time, in the format yyyy MMddHHmmss, such as December 25, 2009 9: 10: 10 seconds represented as 20091225091010
qrcode string And two-dimensional barcode

# 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

# 3、 sample code

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

Post-decryption data:

{"openid":"fafwefawef","bank_type":"CFT","total_fee":100,"trade_state":"SUCCESS",...}

# WeChat Charge Interface (WeChat API Interface)

The utility model is used for the receiving business party to conduct secret deduction for the user according to the information obtained by the scan code interface.

# 1, request parameters

Parameter Name type Required Remarks
qrcode string And Bus code data, need base64
total_fee int And Total payment, divided into units (after discount)
original_fee int And Total amount paid, divided into units (before discount)
machine_ip string N Scan code access IP
machine_latitude float N Scanners GPS latitude
machine_longitude float N Scanner GPS longitude
body string And Bus withholding/Subway deduction
start_time string And to get on or into/Travel time, such as 20091225091010
end_time string N Get off time, format Ditto, suitable for the scene of the second brush code
line_name string And Bus route
trade_scene string And METRO/BUS
start_qrcode string N When the code is brushed twice, the two-dimensional code used for the first time is passed in.
out_order_No string N Business side custom order number, need to ensure unique
attach string N Business-side custom data, and the statements and query interfaces return as is

# 2、 Return parameters

Parameter Name type Required Remarks
Errcode int 32Y Return code
errmsg string N Return Information

# 3、 sample code

Participation:

{"qrcode":"afefawefwef",....}

return

{"errcode":0,....}