Solutions to common problems with signatures
1. amount value issue.
2. the encryption method problem.
3. extra field value handling issues.
The example is as follows:
Request Data:
{
"amount":100,
"appId":"appidxxx",
"currency":"INR",
"extra":{
"accountName":"TEST",
"accountNo":"123@gmail.com",
"bankCode":"EMAIL"
},
"merOrderNo":"orderxxx",
"notifyUrl":"http://example.com/notify"
}
The extra field value is processed as:
"accountName=TEST&accountNo=123@gmail.com&bankCode=EMAIL"
The final string to be signed:
"amount=100&appId=appidxxx¤cy=INR&extra=accountName=TEST&accountNo=123@gmail.com&bankCode=EMAIL&merOrderNo=orderxxx¬ifyUrl=http://example.com/notify&key=xxxx"
4. appId and signing key mismatch problem.
If only one pair of appId+key exists in the system, ignore this part.
(The specific appId+key can be viewed in the "Developer" page of the merchant's management background, if the timeout is not displayed, please reset it directly: when resetting, you need to fill in the login password of the management background).
5. other field values for obj objects when shown correctly in the signature issue.
This part is mostly seen in the collection of the order when the response data processing, which "params" field value for obj.
The example is as follows:
Response data:
{
"amount":100,
"params":{
"qrcode":"00020126940014BR.GOV.BCB.PIX2572api-pix.bancobs2.com.br/spi/v2/cobv/255f36f7-6d7d-48fc-9f56-47181be823aa520400005303986540530.005802BR5924Voluti Gestao Financeira6011Pato Branco61088550338162070503***63045F27",
"url":"https://h5.simplypay.vip/payment/94230311013500999186060015?amount=100¤cy=INR&qrcode=00020126940014BR.GOV.BCB.PIX2572api-pix.bancobs2.com.br%2Fspi%2Fv2%2Fcobv%2F255f36f7-6d7d-48fc-9f56-47181be823aa520400005303986540530.005802BR5924Voluti%20Gestao%20Financeira6011Pato%20Branco61088550338162070503***63045F27"
},
"orderStatus":1,
"orderNo":"94230311013500999186060015",
"currency":"INR",
"createTime":1678498652499,
"merOrderNo":"orderxxx",
"updateTime":1678498652719
}
params field value after conversion:
'{"qrcode":"00020126940014BR.GOV.BCB.PIX2572api-pix.bancobs2.com.br/spi/v2/cobv/255f36f7-6d7d-48fc-9f56-47181be823aa520400005303986540530.005802BR5924Voluti Gestao Financeira6011Pato Branco61088550338162070503***63045F27","url":"https://h5.simplypay.vip/payment/94230311013500999186060015?amount=100¤cy=INR&qrcode=00020126940014BR.GOV.BCB.PIX2572api-pix.bancobs2.com.br%2Fspi%2Fv2%2Fcobv%2F255f36f7-6d7d-48fc-9f56-47181be823aa520400005303986540530.005802BR5924Voluti%20Gestao%20Financeira6011Pato%20Branco61088550338162070503***63045F27"}'
The final string to be signed:
"amount=100&createTime=1678498652499¤cy=INR&merOrderNo=orderxxx&orderNo=94230311013500999186060015&orderStatus=1¶ms={"qrcode":"00020126940014BR.GOV.BCB.PIX2572api-pix.bancobs2.com.br/spi/v2/cobv/255f36f7-6d7d-48fc-9f56-47181be823aa520400005303986540530.005802BR5924Voluti Gestao Financeira6011Pato Branco61088550338162070503***63045F27","url":"https://h5.simplypay.vip/payment/94230311013500999186060015?amount=100¤cy=INR&qrcode=00020126940014BR.GOV.BCB.PIX2572api-pix.bancobs2.com.br%2Fspi%2Fv2%2Fcobv%2F255f36f7-6d7d-48fc-9f56-47181be823aa520400005303986540530.005802BR5924Voluti%20Gestao%20Financeira6011Pato%20Branco61088550338162070503***63045F27"}&updateTime=1678498652719&key=xxxx"
6. some fields are not involved in the signature problem.
Modified at 2024-06-20 07:32:24