# Mobile phone number rapid verification component

This capability is designed to help developers initiate a mobile phone number request from users, and requires user consent before developers can obtain a mobile number verified by the platform and provide services to users.

This capability differs from the mobile number real-time verification component by:

  1. Mobile number quick verification component, the platform will verify the number, but does not guarantee real-time verification ;
  2. Mobile phone number real-time verification component, At each request, the platform will verify the mobile phone number selected by the user in real time .

Please note:

  1. The interface is currently open to non-personal subjects who have completed authentication of Weixin Mini Program (foreign subjects are currently only open in some countries, [see the documentation for details]]](https://docs.qq.com/doc/DZWpqblRwU3labktJ) )
  2. When this capability is used, users can choose to bind a number or add a number on their own.The platform will verify the number based on the underlying capabilities such as SMS provided by the three major Chinese carriers, but does not guarantee real-time verification ;
  3. Developers are asked to determine whether to use it based on business scenarios, and consider adding additional security verification when necessary.
  4. The developer needs to use it reasonably. If it is found or the user reports the developer, **unreasonably asks the user for personal information such as mobile phone number, interrupts the normal usage process and affects the user's usage experience. **WeChat has the right to process this Weixin Mini Program in accordance with [the Weixin Mini Program Platform Operations Management Standard]]](https://developers.weixin.qq.com/miniprogram/product/#_15-%E7%94%A8%E6%88%B7%E9%9A%90%E7%A7%81%E5%92%8C%E6%95%B0%E6%8D%AE%E8%A7%84%E8%8C%83) . Examples of common violations and specific analysis ;

# Payment Instructions

From August 28, 2023, the mobile phone number rapid verification component will be subject to a fee. The standard unit price is: 0.03 yuan per component invocation successfully.For more package prices, please see WeChat public platform - paid management .

Guidelines for purchasing operations

FAQs

Please note:

  1. Experience Credits: Each Weixin Mini Program account will have 1,000 experience credits for development, debugging, and experience. The 1,000 experience quota is shared between the official, experience and development Mini Programs. After the quota exceeds, the experience and development app calls are charged the same as the official Mini Programs;
  2. Duration of Resource Pack: Orders purchased before August 28, 2023. Resource Pack will be effective on August 28, 2023; For orders purchased after August 28, 2023, the resource package will be effective as soon as payment is successful; Each resource package will be calculated as a corresponding maturity and valid period based on the period of validity selected at the time of purchase;
  3. The order in which resources are used: by default, they are charged first from the experience allowance and then from the paid resource package after they have been charged; If there are more than one paid resource packet, the latest resource packet will be deducted in order of expiry, starting with the most recent resource packet and so on;
  4. Refund Rules: If the purchase was made incorrectly and you have not officially started using the resource package, you can apply for a refund within 7 days of the successful payment. The payment will be returned from the original payment path within 3-5 business days; If the resource package has already been used (used 1 time or more), you cannot apply for a refund. If you have not initiated a refund application for more than 7 days after the payment is successful, you cannot apply for a refund again.
  5. Exception Investigation: If there is any doubt about the number of calls, you can refer to "Mobile Number Billing Error Problem Investigation Guide" for investigation.

# Free Rules

If Weixin Mini Program meets one of the following conditions, there is no charge for using this capability, as follows:

  1. Account number WeChat Authentication subject type for government, non-profit organization Weixin Mini Program;
  2. The account WeChat is a public service unit , and the category is Weixin Mini Program;
  3. Account category for public medical institutions, academic education (school) Weixin Mini Program

Developers can query the WeChat authentication principal types for Weixin Mini Program in two ways:

  1. Go to " [ WeChat Public Platform]]](mp.weixin.qq.com) -> Click on Weixin Mini Program Information -> View Basic Information > WeChat Authenticating Subject Type"
  2. Go to " WeChat public platform [[]] -> Click on the account avatar in the top right corner > can see basic information > WeChat authentication subject type"

# Mining patterns

Designed to provide more efficient landing tools, support bulk procurement of resource packs, can be flexibly allocated to multiple Weixin Mini Program use. Access Guidelines .

# Dxplaination of query and charge node

  • Query node: When the user clicks the button, the resource package quota is queried.If the query quota is insufficient, the developer will receive an error codee.detail.errno = = = 1400001,At the same time, the user side will receive the platform's default half-screen prompt "The number of times the function has reached the current Weixin Mini Program limit, temporarily unable to use."If developers want to be compatible with the default logic themselves, they can add the button component to thephone-number-no-quota-toasthas a value set tofalse,At this point, the platform will not prompt the user;
  • Chargeback node: Chargeback occurs when the developer gets the success callback information for thebindgetphonenumberevent.

# How to use it

Step 1 : You need to set the value of button componentopen-typeto`` getPhoneNumber, when the user clicks and agrees, the callback information is obtained through thebindgetphonenumber`event;

Step 2 : Bindbindgetphonenumberdynamic token in the event callbackcodepassed to the developer background and called in the developer background WeChat provided by the background phonenumber.getPhoneNumber interface, consumingcodein exchange for the user's phone number.Eachcodeis valid for 5 minutes and can only be consumed once.

Note:getPhoneNumber``codeworks differently thanwx.loginreturnscode]]and cannot be mixed.

Be careful

Beginning with base library 2.2.2, a security upgrade was made to the way in which cell phone number information was exchanged in step 2, and the above is a guide to using the new method.( The old way can continue for now, but recommends that developers use the new way to enhanceWeixin Mini Program security ) Also, the new way no longer requires an advance call wx.login`to log in.

# Code examples

<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"></button>
Page({
  getPhoneNumber (e) {
    console.log(e.detail.code)  // 动态令牌
    console.log(e.detail.errMsg) // 回调信息(成功失败都会返回)
    console.log(e.detail.errno)  // 错误码(失败时返回)
  }
})

# Return parameter explaination

parameter type Introductions Minimum version
code String Dynamic tokens. Dynamic tokens can be exchanged for a user's mobile phone number.Details of use phonenumber.getPhoneNumber Interface