MD5与RSA2签名,以下分别介绍两种签名的流程res_body 字段需在签名前单独排序,同样按 ASCII 码升序(字典序) 排序。res_body 字段应为 字符串类型,如 PHP 中使用 json_encode 转换成 JSON 字符串。sign_type 必须加入签名,签名时请勿遗漏该字段。stringA,格式如下:open_userid=39783479234&res_body={"channel_type":"ALIPAY","notify_url":"https://www.example1.com","out_trade_no":"124890dj2934","pay_body":"test","pay_name":"test","return_url":"https://www.example1.com","server_url":"https://www.example1.com","sub_type":"SYSTEM","total_fee":100,"user_ip":"127.0.0.1"}&service=gateway.unified.pay&&sign_type=MD5&version=2.0stringA,格式如下:open_userid=39783479234&res_body={"channel_type":"ALIPAY","notify_url":"https://www.example1.com","out_trade_no":"124890dj2934","pay_body":"test","pay_name":"test","return_url":"https://www.example1.com","server_url":"https://www.example1.com","sub_type":"SYSTEM","total_fee":100,"user_ip":"127.0.0.1"}&service=gateway.unified.pay&&sign_type=MD5&version=2.0stringA 末尾直接拼接商户秘钥,格式如下:open_userid=39783479234&res_body={"channel_type":"ALIPAY","notify_url":"https://www.example1.com","out_trade_no":"124890dj2934","pay_body":"test","pay_name":"test","return_url":"https://www.example1.com","server_url":"https://www.example1.com","sub_type":"SYSTEM","total_fee":100,"user_ip":"127.0.0.1"}&service=gateway.unified.pay&&sign_type=MD5&version=2.0您的秘钥MD5,生成的 sign 签名值请统一转为 小写,不可使用大写签名值。