小程序多端开发ios发起支付这个是什么问题呢?
addPaymentByProductIdentifiers fail {"errMsg": "takeIAPAction:failapi addPaymentByProductIdentifiers fail Can't find SKProduct in cache by productIdentifier. Please make sure productsRequest has been invoked.", "err_code": "-2"} 下面是我的代码: const requestObj = wx.miniapp.IAP.requestSKProducts({
productIdentifiers: [
'com.aizn.tech.mj.item1'
],
success(ret) {
console.log(ret.invalidProductIdentifiers)
console.log(ret.products)
wx.miniapp.IAP.addPaymentByProductIdentifiers({
productIdentifier: 'com.aizn.tech.mj.item1',
success: (args) => {
// addPayment调用成功,但是不代表交易完成。
console.log(`addPaymentByProductIdentifiers success`, args)
},
fail: (args) => {
// addPayment调用成功
console.error(`addPaymentByProductIdentifiers fail`, args)
}
})
},
fail(error) {
console.error(`requestSKProducts failed. ${error}`)
}
})