# Weixin Mini Program Confirmation of receiving component access instructions

Developers can open the confirmation receipt component in this Weixin Mini Program by calling wx.openBusinessView, allowing users to complete the confirmation receipt operation.

接口名称:wx.openBusinessView

Interface compatibility:

Weixin Mini Program Repository > = 2.6.0, the lower version prompts users to upgrade to the latest WeChat version.

# Interface parameters

Object

attribute type Required to fill in Introductions
businessType string yes Fixed Configuration: weappOrderConfirm
extraData object yes Used to pass user transaction information to the component, optionally using transaction_id or merchant_id + merchant_trade_no to uniquely specify the order to confirm receipt
attribute type Required to fill in Introductions
transaction_id string no User transaction number
merchant_id string no User transaction merchant number
merchant_trade_no string no Merchant's Order Number

# Component callback

Component through wx.navigateBackMiniProgram callback Weixin Mini Program. Developers can handle callback parameters from ApageonShow.

After receiving a callback for successful confirmation, developers need to check the order shipment status via and the background interface to confirm again whether confirmation has been completed to avoid security risks.

The callback parameter is in referrerInfo, where AppID is fixed as wx1183b055aeec94d1, and the extraData is defined as follows:

Object

attribute type Required to fill in Introductions
status string yes "success": the user confirms the successful receipt of the goods; "fail": the user fails to confirm receipt; "cancel": User cancels
errormsg string no Specific error cause when status is fail
req_extradata object yes Request information when a developer calls a component
attribute type Required to fill in Introductions
transaction_id string no User transaction number
merchant_id string no User transaction merchant number
merchant_trade_no string no Merchant's Order Number

# sample code

//拉起确认收货组件
if (wx.openBusinessView) {
  wx.openBusinessView({
    businessType: 'weappOrderConfirm',
    extraData: {
      merchant_id: '1230000109',
      merchant_trade_no: '1234323JKHDFE1243252',
      transaction_id: '420123123123123123123'
    },
    success() {
      //dosomething
    },
    fail() {
      //dosomething
    },
    complete() {
      //dosomething
    }
  });
} else {
  //引导用户升级微信版本
}

//响应组件回调
App({
  onShow (options) {
    // Do something when show
  }
  })

# Component style screenshot: