JavaScript-wechat payment, using URL to pass parameters

Source: Internet
Author: User
Yes, I currently need to implement a feature that uses scan QR code to pay. I make a URL link to the QR code, and then call Jsapi in the link to initiate charges, now the problem is that my QR code needs to include a parameter (product ID), then a different ID for the charge, the last record, and considering that there may be an unlimited number of product types so it is impossible to make a sub-page.

Now the question is, do I use a link like http://shop.com/?id=100 to think? The latter part is also part of the link, and can not pass the parameters, how do you realize it?

Reply content:

Yes, I currently need to implement a feature that uses scan QR code to pay. I make a URL link to the QR code, and then call Jsapi in the link to initiate charges, now the problem is that my QR code needs to include a parameter (product ID), then a different ID for the charge, the last record, and considering that there may be an unlimited number of product types so it is impossible to make a sub-page.

Now the question is, do I use a link like http://shop.com/?id=100 to think? The latter part is also part of the link, and can not pass the parameters, how do you realize it?

In the process of generating two-dimensional code, I also encountered this problem, in two ways to practice.

1. As said upstairs, using the rewrite path, the path does not appear "? "This affects the characters that receive the parameter.
2. UrlEncode, "Index.html%3factid%3d3%26from%3d3", after receiving decode, the parameters obtained are: index.html?actid=3&from=3.

In fact, this site is not to inspire you?
http://segmentfault.com/q/1010000004324729

  • 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.