1. WeChat development platform description

WeChat public account

It is an application account applied for by a developer or a merchant on the WeChat public platform. The account is interoperable with a QQ account. Through the official account, the merchant can realize all-round communication and interaction with specific groups of text, pictures, voice, and video on the WeChat platform. . Formed a mainstream online and offline WeChat interactive marketing method

  • WeChat subscription number
    Subscription number, the ability to disseminate information for the media or individuals

  • WeChat service account
    Service account, which provides enterprises or organizations with more permissions and advanced functions than subscription accounts, including official account menus, payment capabilities, etc.

  • Micro-channel public platform
    Apply to open a platform for service account, subscription account, and mini program functions

  • WeChat Pay
    Payment function integrated in WeChat APP

  • WeChat Pay merchant platform
    A platform for managing WeChat Pay merchant information, transaction information, and fund balance

  • WeChat open platform
    The current development is mainly used to associate multiple official accounts and small programs to use unionid to provide an interface for third-party mobile programs, so that users can publish the content of third-party programs to friends or share them to Moments. Third-party content uses the WeChat platform Gain wider dissemination

The difference between service account and subscription account

  • In terms of push function: the subscription account can push 1 message to the user every day, and the authentication service account can push 4 messages to the user every month.
  • At the display level: the subscription number is displayed in the subscription number folder of the WeChat dialog box, and the service number is directly displayed in the WeChat dialog box.
  • In terms of access function: The service account provides more interface docking capabilities, such as WeChat payment, and more menu management functions.

How to choose service account and subscription account

For more consultation and dissemination, choose a subscription number, and for more functions and services, choose a service number

2. WeChat service account payment function access

WeChat payment related material preparation

  • Application for official account registration: apply for the activation of the service account function on the WeChat official platform.
  • Service provider function application: After the service account authority is activated, go to the WeChat public platform> WeChat payment> Service provider application page and apply for the service provider function according to the WeChat payment service provider access guidelines.
  • Function activation: complete the payment application on the WeChat Merchant Platform> Account Center> Payment Application page; go to the WeChat Merchant Platform> Product Center> Development Configuration page to complete the WeChat payment configuration.

Need to activate permissions

To realize the function of docking WeChat payment with the service account, we need to go to the WeChat Public Platform> Development> Interface Permissions page, and activate the Web Authorization and WeChat Pay permissions

WeChat payment parameter configuration

When all accounts and permission applications involved in WeChat Pay are approved. You need to go to the WeChat public platform and WeChat payment merchant platform to set up the configuration of related data such as docking payment and authorized domain names

The access process of a service account product with WeChat payment capability is:

  1. Docking WeChat user authorization (authorization: including silent authorization and non-silent authorization) to obtain the user’s OpenID and other WeChat user information
  2. Docking the WeChat payment function, you need to use the user's OpenID authorized by WeChat to initiate payment

Configure WeChat webpage authorization data:

  1. Go to the official account development information on the WeChat Official Platform> Development> Basic Configuration page and set the developer key.
  2. If you need to provide the ability to communicate with WeChat accounts (obtain the user's Union ID when authorizing the web page), you need to set the binding of the WeChat official account to the WeChat open platform in the bound WeChat open platform account on the basic configuration page.
  3. Go to WeChat Official Platform> Settings> Official Account Configuration> Function Settings tab, and set the business domain name, JS interface secure domain name, and web authorized domain name.

Configure payment domain name data:

  1. Set the JSAPI payment domain name: Go to the payment configuration of WeChat Pay Merchant Platform> Product Center> Development Configuration page to set the official account payment JSAPI payment authorization directory.
  2. Set API security key: Go to WeChat Pay Merchant Platform> Account Center> API Key on API Security page to set the key

After all these settings are completed, basically the preparation phase is completed, and then the interface docking process

Access parameter acquisition

  1. Obtain the authorization parameters of the WeChat webpage: Go to the official account development information on the WeChat Official Platform> Development> Basic Configuration page to obtain the Developer ID (AppID) and Developer Password (AppSecret).
  2. Get payment merchant parameters: Go to WeChat Pay Merchant Platform> Product Center> Development Configuration page to get the payment merchant number; Go to WeChat Pay Merchant Platform> Account Center> API Security page to obtain API key settings to get the API key

Service account WeChat webpage authorization access

  1. The user agrees to authorize and obtain the code.
  2. Exchange the code for web authorization access_token.
  3. Refresh the access_token (if needed).
  4. Pull user information (the scope needs to be snsapi_userinfo).

WeChat Pay Access

  1. The merchant's business server calls the [Unified Order API] interface to complete the pre-order processing
  2. After the user completes the payment, the merchant service server receives the payment callback. For details, please read the [Payment Result Notification API] interface document
  3. If necessary, you can also use the [Order Inquiry] interface, and the merchant's business server actively inquires the payment status of the order to complete the business logic processing

Precautions

1. Webpage authorization domain name restrictions

The webpage authorizes the domain name, but WeChat only allows one authorized domain name to be set. In the development process, we generally have two servers and domain names, the official server and the test server, which limits the development and maintenance processing. However, we can solve this problem by authorizing the proxy forwarding of the callback domain name on the WeChat webpage.

2. JSAPI Payment Authorization Directory

Set the domain name information of the official account payment authorization directory. Assuming our payment directory is http://localhost/payment/wech... Then you need to set the directory to http://localhost/payment/ when setting, which is the actual The URL address is at most one level more directory than the setting, otherwise it will report the URL of the current page is not registered error

点赞(0)

评论列表 共有 0 评论

暂无评论

微信服务号

微信客服

淘宝店铺

support@elephdev.com

发表
评论
Go
顶部