Openid cannot be found after WeChat payment refresh

Source: Internet
Author: User
Tags openid
{Code...} refresh or error return prompt: the required parameter openid is missing in the unified payment interface! When trade_type is JSAPI, openid is a required parameter!
If (! Isset ($ _ GET ['code']) {// return code $ url = $ jsApi-> createOauthUrlForCode (WxPayConf_pub: JS_API_CALL_URL); Header ("Location: $ url ") ;}else {// GET the code to GET openid $ code =$ _ GET ['code']; $ jsApi-> setCode ($ code ); $ openid = $ jsApi-> getOpenId () ;}$ unifiedOrder-> setParameter ("openid", "$ openid ");

Refresh or error response prompt:

Required parameters are missing in the unified payment Interfaceopenid!trade_typeIsJSAPI,openidRequired parameter!

Reply content:
If (! Isset ($ _ GET ['code']) {// return code $ url = $ jsApi-> createOauthUrlForCode (WxPayConf_pub: JS_API_CALL_URL); Header ("Location: $ url ") ;}else {// GET the code to GET openid $ code =$ _ GET ['code']; $ jsApi-> setCode ($ code ); $ openid = $ jsApi-> getOpenId () ;}$ unifiedOrder-> setParameter ("openid", "$ openid ");

Refresh or error response prompt:

Required parameters are missing in the unified payment Interfaceopenid!trade_typeIsJSAPI,openidRequired parameter!

The first step of the subject has completed Oauth authentication.
Is the link that can get the openid... TX jump isXXXX.com&code=123
Then Exchange code for openid ..
Code. If the life cycle is not used, it takes only 5 minutes.
The process of the subject directly produces the prepay_id display payment page ..

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.