Face Payment

View Markdown

Last edited on 2026-04-06

Supported only by WMPF < 2.1.0

The functionality in this section is supported only on devices certified by WeChat Pay. For detailed documentation, please refer to this.

We can integrate Mini Program into Face Payment devices, enabling better connectivity with WeChat and unlocking more possibilities.

Mini Program -side

wx.login

Prioritize facial recognition login. If it fails, fall back to QR code login.

Face Payment

wmpf.wxFacePay.facePay

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

Get Deduction Code Token

wmpf.wxFacePay.getFaceCode

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

Client Side

ActivateDeviceByIoT

Payment devices must first be activated via the IOT method.

InitWxFacePayInfo

Then, pre-inject face recognition login and payment-related information for the payment device.

AuthorizeByWxFacePay

Finally, implement face login. At this point, running Mini Program will result in an authenticated login state.