Alipay+ DocsAlipay+ Docs

Message encoding

To prevent errors or ambiguity caused by special characters enclosed in a message, encode the message properly before the message is transmitted.

Encoding scenarios

Encoding method

For the byte data, such as the signature and the encrypted content, encode the data with the base64 algorithm before transmitting.

Via the base64 algorithm

For certain fields embedded in the HTTPS URL, encode the field before transmitting.

For example:

  • Original URL: https://test.merchant.com/test.html?key1=value1&key2=https://www.redirecturl.com/authorizationResult
  • Encoded URL: https://test.merchant.com/test.html?key1=value1&key2=https%3A%2F%2Fwww.redirecturl.com%2FauthorizationResult

If such URLs are received, you need to decode the URLs before use.

Via the urlencode