Javascript-WeChat payment, using url to PASS Parameters

Source: Internet
Author: User
In this case, I need to implement a function to pay by scanning the QR code. I made the QR code into a url link and called JSAPI in the link to initiate charges. Now the problem is that my QR code needs to contain a parameter (item ID ), fees are charged by different IDs, and the last record is ,... in this case, I need to implement a function to pay by scanning the QR code. I made the QR code into a url link and called JSAPI in the link to initiate charges. Now the problem is that my QR code needs to contain a parameter (item ID ), different IDs are used to charge fees, and the records are recorded at last. Considering that there may be an infinite number of product types, it is impossible to make them into subwebpages.

The problem now is that I am using http://shop.com /? The link id = 100 will think? The following parts are also part of the link, and parameters cannot be passed. How do you implement them?

Reply content:

In this case, I need to implement a function to pay by scanning the QR code. I made the QR code into a url link and called JSAPI in the link to initiate charges. Now the problem is that my QR code needs to contain a parameter (item ID ), different IDs are used to charge fees, and the records are recorded at last. Considering that there may be an infinite number of product types, it is impossible to make them into subwebpages.

The problem now is that I am using http://shop.com /? The link id = 100 will think? The following parts are also part of the link, and parameters cannot be passed. How do you implement them?

I encountered this problem in the program that generated the QR code. I tried this problem in two ways.

1. As mentioned above, when using the rewrite path, "?" is not displayed in the path. This will affect the characters that receive parameters.
2. Urlencode,define index.html % 3 factid % 3d3% 26 from % 3d3 ", after receiving decode, the obtained parameter is: index.html? Actid = 3 & from = 3.

Does this website 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.