The UnionPay electronic trading agreement used in a project, posted, I hope to help people need!
protocol
trasaction code
trasaction code
description
101
Transfer request
102
Query request
201
Transfer response
202
Query response
Description:
A. All transaction code above, in the transmission process, in the form of string.
B. "10X" format transaction data refers to data sent from the payment gateway to the bank front machine.
C. "20x" format transaction data refers to data from the bank front machine to the payment gateway.
D. Bank customer request data package plus 6-digit length, less than 6 digits left alignment, ie, the package customer request package is: 6-digit package length 3 transaction code data content (package long finger trading The length of code data content).
E. Bank should add 6-digit length, less than 6 digits, less than 6 digits, ie the bank returned to: 6-bit package length 3 transaction code data content (package length refers to transaction code The length of the data content).
F. The alignment of the long string in the packet will be used to use the "left alignment right."
Response status code
Return Status Code Returns Information
0000 transfer is successful
search successful
When the 1001 transfer, the balance of the source account is insufficient, and the transfer failed.
When the 1002 transfer, the source account does not exist, the transfer failed
When the query, the account does not save, the query failed
When the 1003 transfers, the target account does not exist, the transfer failed
When transferring 1004, the bank is settled, and the transfer failed.
When inquiries, the bank is settlement, and the query failed.
When transferring 1005, the source account is illegal, the transfer failed
When queries, the account is illegal, the query failed
When 1098 transfers, other banks have failed, transfer failure
When queries, the bank is other errors, the query failed
When transferring 1099, the source account cannot be transferred, and the transfer failed.
When the query, the account cannot be inquired, the query failed
When transferred by 1100, the transfer request, transfer is successful
Description:
A. The above table is the status code returned by the bank, and the custom status code cannot be added without returning.
B. Return to the status that is most description.
C. If the error is not specified in this table, you need to return to 1098.
D. When the bank has successfully successfully and returns the response message, it is not allowed to return 1100 when the same draw request is received, and the repetition will not be repeated (can be judged by the drawn water number).
E. Unexpected alignment in the packet is all in the "left alignment of the right space".
Transfer request agreement [101]
name
Type / length
description
trasaction code
Char (3)
'
101 '
Merchant coding
Char (10)
Pingle string
Transfer water number
Char (20)
Pingle string
Bank Code
Char (4)
Pingle string
Source account
VARCHAR (50)
Growth string
Target account VARCHAR (50)
Growth string
Transfer amount Decimal (14, 2) becomes long real string
Send a sign char (1) set up a leader string
Finally send time char (14) fixed length string
Remark information varchar (40) becomes long string
Description:
A. The total length of the packet is 206 characters.
B. Banks are drawn according to the "transfer amount".
C. "Transfer Water No." As the only identification of this transaction as the bank end to prevent repetitive drawbacks; this number is different for different transactions. D. "Send Sign" Referring to: "0" Send to the bank for the first time; "1" has been sent to the bank but does not receive response data; "2" Bank returns an unsuccessful response result.
E. "Last Transmit Time" fills in the local time when sending the transaction data. The time format is "YYYYMMDDHHMMMSS", which is 14-bit set string.
F. The alignment of the long string in the packet will be used to use the "left alignment right."
Transmission response protocol [201]
name
Type / length
description
trasaction code
Char (3)
201
Merchant coding
Char (10)
Pingle string
Transfer water number
Int (20)
Pingle string
Bank Code
Char (4)
Pingle string
Request transfer amount
Decimal (14, 2)
Growth string
Actual transfer amount
Decimal (14, 2)
Growth string
transaction hour
Char (14)
Pingle string
Response status code
Char (4)
Pingle string
Remark information
Varchar (40)
Growth string
Description:
A. The total length of the packet is 123 characters.
B. If successful, the bank has transferred according to the "actual transfer amount".
C. "Trading Time" fills in the local time when sending this response data. The time format is "YYYYMMDDHHMMMSS", which is 14-bit set string.
D. The alignment of the long string in the packet will be used to use "left alignment to the right space."
E. Returns the status code in "Response Status Code", and the request results can be analyzed according to the response status code.
Query request agreement [102]
name
Type / length
description
trasaction code
Char (3)
'
102 '
Merchant coding
Char (10)
Pingle string
Bank Code
Char (4)
Pingle string
Query account
VARCHAR (50)
Growth string
Send time char (14) fixed length string
Remark information varchar (40) becomes long string
Description:
A. The total length of the packet is 121 characters.
B. "Send Time" fills in the local time when sending the transaction data. The time format is "YYYYMMDDHHMMMSS", which is 14-bit set string.
C. The alignment in the packet is not necessarily used in the "left alignment of the right."
Query Agreement [202]
name
Type / length
description
trasaction code
Char (3)
202
Merchant coding
Char (10)
Pingle string
Bank Code
Char (4)
Pingle string
account balance
Decimal (14, 2)
Growth string
transaction hour
Char (14)
Pingle string
Response status code
Char (4)
Pingle string
Remark information
Varchar (40)
Growth string
Description:
A. The total length of the packet is 89 characters.
B. If successful, the account balance is returned in the Account Amount.
C. "Trading Time" fills in the local time when sending this response data. The time format is "YYYYMMDDHHMMMSS", which is 14-bit set string.
D. The alignment of the long string in the packet will be used to use "left alignment to the right space."
E. Returns the status code in "Response Status Code", and the request results can be analyzed according to the response status code.