当前位置:网站首页>The parameter field of the callback address of the payment interface is "notify_url", and an error occurs after encoding and decoding the signed special character URL (,,,,,)

The parameter field of the callback address of the payment interface is "notify_url", and an error occurs after encoding and decoding the signed special character URL (,,,,,)

2022-06-26 05:10:00 You are sexy!

Today's docking payment interface , Parameter splicing is finished , When you start calling , Has been an error , Signature error .

But I use the signature given by a third party to test mode Test signature , The return is true.

This is very fucking strange .

After comparing the parameters one by one , I find ,notify_url There is a problem with the parameters .

need Url The original content of the code is “&notify_url=xxxx”  after url Encode and then decode back   “&not” The part becomes “¬”

It goes like this :“name=xxxx¬ify_url=xxxx&randomstr”

No wonder when I call, I always say that the signature is wrong , The field names have changed , It's strange not to report mistakes .

Then Baidu looks up the information

An old man said :” Leave the original text in url Coded & Replace the symbol with &amp, It's normal to transcode after coding .“

That's easy , Replace function with

 
$url = str_replace("&","&amp",'https:www.xxx.com?'.$str);

So the return is “name=xxxx&notify_url=xxxx&randomstr”

原网站

版权声明
本文为[You are sexy!]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206260504427605.html