wmpf.wxFacePay.facePay(Object object)

View Markdown

Last edited on 2026-04-06

Invokes face recognition payment to obtain the deduction code.

Parameters

Object object

Attribute Type Default Required Description
success function No Callback function when the API call succeeds
fail function No Callback function when the API call fails
complete function No Callback function when the API call completes (executed for both successful and failed calls)

object.success callback function

Parameters

Object res

Property Type Description
return_code string Error code. For common definitions, see Common Error Codes
err_code string Optional. Secondary error code. For common definitions, see Secondary Error Codes
return_msg number Description of the error code
face_code string Face credential, used for face payment
openid string openid (equivalent to user identity)
sub_openid string openid under sub Merchant (Service Provider Mode)
underage_state number User age information. Contact WeChat Pay to enable permissions. Possible values: 0 - Status unclear or permission not enabled; 1 - Adult; 2 - Minor

Sample Code

wmpf.wxFacePay.facePay({
  success: res => {
    console.log(res);
  },
  fail: res => {
    console.log(res);
  }
})