Alipay, China's leading third-party online payment solutionAlipay, China's leading third-party online payment solution

Message encoding

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

Encoding Scenarios

Encoding Method

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

Use the base64UrlEncode function to encode data when calculating to generate a signature.

For the HTTPS URL data, perform URL encoding first before transmitting.

For example:

  • Original URL: https://www.merchant.com/authorizationResult
  • Encoded URL:https%3A%2F%2Fwww.merchant.com%2FauthorizationResult