# Mobile Phone Number Quick Verification Component

This capability is designed to help developers initiate mobile phone application to users, andMust be approved by the user, developers can obtain a mobile phone number verified by the platform, and then provide users with corresponding services.

This ability andMobile phone number real-time verification componentThe difference is:

  1. Mobile phone number quick verification component, the platform will verify the number, butDoes not guarantee real-time verification
  2. Mobile phone number real-time verification module,On each request, the platform verifies the phone number selected by the user in real time.

Please note:

  1. The interface is currently targeted atNon-individual developers, and completed the certification of the Mini Program open (foreign entities are currently only open in some countries and regions,See the documentation
  2. When this ability is used, the user can choose to bind the number, or add the number independently. The platform will verify the number based on the underlying capabilities such as SMS provided by the three major operators in China.Does not guarantee real-time verification
  3. Ask developers to judge and choose whether to use according to the needs of business scenarios, and consider adding other security verification methods if necessary.
  4. Fair use by the developer, if found or reported by the user**Unreasonably **Requiring users to provide personal information such as mobile phone number interrupts the normal use process and affects the user's experience.WeChat has the right toWeChat Mini Program Platform Operation and Management SpecificationProcessing of this Mini ProgramCommon violations and specific analysis

# Dxplaination of charges

From August 28, 2023, the mobile phone number rapid verification component will require a fee to use. Standard unit price is: each component call success, charge 0.03 yuan. More package prices please see[WeChat Public Platform - Payment Management](https://mp.weixin.qq.com/cgi-bin/loginpage?redirect _url=/wxamp/wxacharge)。

Purchase Operation Guide

Frequently Asked Questions

Please note:

  1. Experience quota: Each Mini Program account will have 1000 experience quota for development, debugging and experience. The 1000 times of experience amount for the official version, the experience version and the development version of the Mini Program share, after the excess, the experience version and the development version of the Mini Program call with the official version of the Mini Program, are charged
  2. Resource Pack Validity: For orders purchased before August 28, 2023, the Resource Pack will take effect on August 28, 2023For orders purchased after 28 August 2023, the Resource Pack will take effect immediately upon successful payment.Each Resource Pack will be calculated according to the expiry date selected at the time of purchase.
  3. Resource Usage Order: By default, it is deducted from the experience amount first, and then deducted from the paid resource package after the deduction is completed.If there are more than one paid resource pack, the most recently expired resource pack will be deducted in chronological order of the resource pack expiration, and so on
  4. Refund Policy: If the purchase is incorrect and you have not officially started using the resource pack, you can apply for a refund within 7 days after the successful payment. The money will be returned from the original payment path within 3-5 working days.If the Resource Pack has already been used (once or more), you cannot request a refund.If no refund application has been initiated more than 7 days after the successful payment, no refund can be applied for.
  5. Exception investigation: If there is any doubt about the amount of calls, refer to theMobile Number Billing Error Troubleshooting GuideAnd run a sweep.

# Free rules

Mini Program that meets one of the following conditions, there is no charge for the use of this ability, as follows:

  1. accountWeChat Certification Body TypeSmall programs for government and non-profit organizations
  2. accountWeChat Certification Body TypeFor the public service unit, and the category is the government affairs people's livelihood small procedure
  3. Small programs for public medical institutions and academic education (schools)

Developers can query the WeChat certification subject type of the mini program in the following two ways:

  1. Get into[WeChat Official Platform](mp.weixin.qq .com )->Click on the Mini Program information ->View basic information ->WeChat Certification Body Type
  2. Get into[WeChat Official Platform](mp.weixin.qq .com )->Click on the top right corner account avatar ->Basic information can be viewed ->WeChat Certification Body Type

# Gathering mode

It aims to provide more efficient landing tools, support bulk procurement of resource packs, can be flexibly allocated to multiple Mini programs to use. Gathering mode[Access Guidelines](https://developers.weixin.qq.com/doc/oplatform /service_market/charge/Guide/intro.html)。

# Query and Charge Node Dxplaination

  • Query node: When the user clicks the button, the resource package quota is queried. If the query amount is insufficient, the developer will receive an error code. e.detail.errno===1400001 At the same time, the user side will receive the platform default half-screen prompt "This function has reached the current Mini Program limit and cannot be used for the time being." If the developer wants to be compatible with the default logic, it can be button In the componentphone-number-no-quota-toast The value of the falseAt this time, the platform will not be prompted on the user side
  • Chargeback Node: The developer gets bindgetphonenumber The event's success When the information is called back, it is deducted.

# Methods of Use

Step 1: The need to place button assembly open-type The value of the getPhoneNumber, when the user clicks and agrees, through the bindgetphonenumber Event to get callback information

Step 2: Will bindgetphonenumber Dynamic Token in Event CallbackCodeTo the developer background, and in the developer background call WeChat background provided by the [phonenumber.getPhoneNumber ](https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/phone number /phonenumber.getPhoneNumber .html) Interface, ConsumptionCodeIn exchange for a phone number. EachCodeIt is valid for 5 minutes and can only be consumed once.

Note:getPhoneNumber Returned Code and wx.login Returned Code The effect is different, can not be mixed.

Be careful

Starting from the base library 2.21.2, the method of exchanging mobile phone number information in step 2 has been safely upgraded, and the above is the guide for using the new method. (The Old WayIt can still be used, butSuggest new ways for developers to enhance Mini Program security) Also, the new wayno longerNeed to call in advancewx.loginLog in.

# Code Examples

<button open-type="getPhoneNumber"  bindgetphonenumber="getPhoneNumber" ></button>
Page({
  getPhoneNumber (e) {
    console.log(e.detail.code)  // Dynamic token
    console.log(e.detail.errMsg) // Callback information (returns on success or failure)
    console.log(e.detail.errno)  // Error code (returned on failure)
  }
})

# Return Parameter Dxplaination

parameter type Introductions Minimum version
Code String Dynamic token. The user's mobile phone number can be exchanged for a dynamic token. Details of how to use [phonenumber.getPhoneNumber ](https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/phone number /phonenumber.getPhoneNumber .html) interface