# 5. Wechat Webpage Authorization Reference

# Official Account Payment

# Configuring the Webpage Authorization Domain Name

The WECHAT JSAPI Payment product capability needs to obtain the user's openid in the form of authorization auth2

on the webpage before initiating payment to verify whether the person placing the order and the final payer are the same person.

The domain name used for auth2 authorization needs to be configured on the merchant's wechat official account platform by selecting Settings > Account Info > Function Setting.

The following figure shows the configuration page:

Attention:

  • Note that the authorization callback domain should be filled in with a domain name (which is a string) instead of a URL, so do not add http:// or other protocol headers here.
  • For example, if a domain name requiring webpage authorization is www.qq.com, you can perform OAuth 2.0 authentication on the sub-domain pages http://www.qq.com/music.html and http://www.qq.com/login.html after configuration, but cannot do so on http://pay.qq.com, http://music.qq.com, and http://qq.com.

# Getting Openid

  • When the scope is snsapi_base, the authorization page does not pop up and you can only get the user's openid;

  • when the scope is snsapi_userinfo, the authorization page pops up and you can get the user's alias, gender, and location with openid. Additionally, you can get user information even if they are not following the Official Account, as long as they have granted authorization.

Webpage Authorization Guide of Wechat Official Account (opens new window)

# Mini Program Payment

# Binding Appid

Please contact us to bind appid of mini program.

# Getting Openid

Webpage Authorization Guide of Wechat Mini Program (opens new window)