Alipay payment configuration stamped on the pit __ Alipay payment Configuration

Source: Internet
Author: User

The following error occurred while calling Alipay payment:

After referring to the official error-free document (RSA2 the private key to fill in the wrong set), still did not find the problem.

Finally, a step-by-step breakpoint debugging found that the original project to configure the merchant's private key is directly read. A PEM private key file that already contains the "BEGIN" and "End" tails, And the official SDK provided in the aopclient.php file in the sign method has such a piece of code:

That is, only the main body of the merchant's private key, the beginning and the program has automatically helped us Add.

So I saved the back of the. pem file and then read it again, and found that the same error was reported. After some debugging, the original is my editor at the time of saving automatically at the end of the file to add a line of blank, after the sign function, the merchant's private key to the head and tail, however, "end" before a line more than a row, resulting in the final signature parameter value is an empty string. After the blank line is removed, everything runs smoothly.

It is recommended to configure Alipay payment configuration when the text is read, as far as possible not to read the way the file.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.