云开发接单
云开发接单
  • 发布:2022-10-10 19:20
  • 更新:2022-10-11 11:22
  • 阅读:167

苹果内购没有任何信息输出

分类:uni-app

这个真机调用苹果内购,为什么没有任何输出,连complete都不执行
已经能查询内购项目产品的了,项目也导入支付模块

2022-10-10 19:20 负责人:DCloud_uniAD_HDX 分享
已邀请:
云开发接单

云开发接单 (作者) - 专攻云开发,有云开发的小单子可找我

try catch 也没有捕获到异常
nvue vue3.0是不支持这个方法吗?

DCloud_uniAD_HDX

DCloud_uniAD_HDX

这个调用需要等待苹果服务器的响应,等了多久没有输出?

  • 云开发接单 (作者)

    问题找到,官方的示例单词有问题



    // 请求苹果支付

    const transaction = await this._iap.requestPayment({

    productId: this.productId,

    manualFinishTransaction: true,

    // username: username + orderId //根据业务需求透传参数,关联用户和订单关系

    });

    里面的productId应该改为小写productid

    2022-10-11 12:30

  • 云开发接单 (作者)

    但是在沙盒中支付成功了,过了一分钟就报错了,也没有支付成功的返回信息

    后续如何确定已经支付了?


    {  
    "errMsg": "requestPayment:fail Payment_appleiap:Error Domain=SKErrorDomain Code=0 \"发生未知错误\" UserInfo={NSLocalizedDescription=发生未知错误, NSUnderlyingError=0x280191ef0 {Error Domain=ASDErrorDomain Code=500 \"Unhandled exception\" UserInfo={NSUnderlyingError=0x280193690 {Error Domain=AMSErrorDomain Code=100 \"Authentication Failed\" UserInfo={NSLocalizedFailureReason=The authentication failed., NSMultipleUnderlyingErrorsKey=(\n \"Error Domain=NSURLErrorDomain Code=-1001 \\\"\\U8bf7\\U6c42\\U8d85\\U65f6\\U3002\\\" UserInfo={NSErrorFailingURLStringKey=https://sandbox.itunes.apple.com/WebObjects/MZFinance.woa/wa/authenticate?guid=00008101-000135860E9B001E, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <6CB66C82-6BAE-4AD6-A896-E56958755B64>.<50>, AMSStatusCode=0, NSErrorFailingURLKey_desc=https://sandbox.itunes.apple.com/WebObjects/MZFinance.woa/wa/authenticate?guid=00008101-000135860E9B001E, _NSURLErrorRelatedURLSessionTaskErrorKey=(\\n \\\"LocalDataTask <6CB66C82-6BAE-4AD6-A896-E56958755B64>.<50>\\\"\\n), NSLocalizedDescription=\\U8bf7\\U6c42\\U8d85\\U65f6\\U3002, _kCFStreamErrorDomainKey=4, NSUnderlyingError=0x280192f40 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 \\\"(null)\\\" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, _kCFStreamErrorCodeKey=-2102}\",\n \"Error Domain=AKAuthenticationError Code=-7013 \\\"(null)\\\" UserInfo={NSUnderlyingError=0x280193480 {Error Domain=AKAuthenticationError Code=-7075 \\\"(null)\\\"}}\"\n), AMSURL=https://sandbox.itunes.apple.com/WebObjects/MZBuy.woa/wa/inAppBuy?guid=00008101-000135860E9B001E, AMSStatusCode=200, AMSServerPayload_desc={\n \"cancel-purchase-batch\" = 1;\n customerMessage = \"\\U4f7f\\U7528 Apple\\U00a0ID \\U767b\\U5f55\";\n dialog = {\n cancelButtonString = \"\\U53d6\\U6d88\";\n defaultButton = Buy;\n explanation = \"\\U8f93\\U5165 %%appleId%% \\U7684\\U5bc6\\U7801\\U4ee5\\U6388\\U6743\\U6b64\\U4ea4\\U6613\\U3002\\n\\n[Environment: Sandbox]\";\n initialCheckboxValue = 1;\n kind = authorization;\n \"m-allowed\" = 0;\n message = \"\\U4f7f\\U7528 Apple\\U00a0ID \\U767b\\U5f55\";\n okButtonAction = {\n buyParams = \"hasFailedTouchIDChallenge=true&offrd-free-trial=false&salableAdamId=1649323796&showIAPExtraDialog=false&offerName=service_card_3&productType=A&hasBeenAuthedForBuy=true&quantity=1&price=6000&ageCheck=true&pricingParameters=STDQ&vid=4392320E-6720-4E5F-8EDA-4C88B5304D98&bvrs=1366&pg=default&hasConfirmedPaymentSheet=true&bid=apijuhe.jizan&hasWebOptIn=false\";\n itemName = \"service_card_3\";\n kind = Buy;\n };\n okButtonString = \"\\U8d2d\\U4e70\";\n paymentSheetInfo = {\n caseControl = true;\n confirmationTitle = Pay;\n countryCode = CN;\n currency = CNY;\n displayPrice = \"\\U00a56.00\";\n flexList = (\n {\n header = \"\\U8be6\\U7ec6\\U4fe1\\U606f\";\n value = \"\\U4ec5\\U7528\\U4e8e\\U6d4b\\U8bd5\\U3002\\U786e\\U8ba4\\U8d2d\\U4e70\\U540e\\Uff0c\\U7cfb\\U7edf\\U4e0d\\U4f1a\\U6536\\U53d6\\U8d39\\U7528\\U3002\";\n },\n {\n header = \"\\U5e10\\U6237\";\n value = \"%%appleId%%\";\n }\n );\n isLastElementPinned = 1;\n paymentSummary = \"\\U4ef7\\U683c\";\n price = 6;\n requestor = AppStore;\n salableIcon = \"https://is4-ssl.mzstatic.com/image/thumb/Features113/v4/b3/f6/f5/b3f6f530-6b2f-df22-9618-6fbb0a9e2ca2/mza_7020272080795277011.png/144x144bb.png\";\n salableIconType = app;\n salableInfo = (\n \"3\\U5f20\\U670d\\U52a1\\U5361\",\n \"\\U670b\\U53cb\\U5708\\U96c6\\U8d5e\\U5927\\U5e08\",\n \"App \\U5185\\U8d2d\\U4e70\\U9879\\U76ee\"\n );\n title = {\n type = text;\n value = \"\\U6c99\\U7bb1\";\n };\n };\n };\n failureType = \"\";\n \"m-allowed\" = 0;\n metrics = {\n actionUrl = \"sandbox.itunes.apple.com/WebObjects/MZBuy.woa/wa/inAppBuy\";\n dialogId = \"MZCommerceInAppBuy.ConfirmationNeededForBuyOneItem.CPS.Auth\";\n eventType = dialog;\n message = \"\\U4f7f\\U7528 Apple\\U00a0ID \\U767b\\U5f55\";\n mtEventTime = \"2022-10-11 15:44:21 Etc/GMT\";\n osloTitleType = text;\n osloTitleValue = \"AbstractSalableInfoModule.SandboxTitle\";\n };\n pings = (\n \"https://xp.apple.com/report/2/xp_its_main?code=MZCommerceInAppBuy.ConfirmationNeededForBuyOneItem.CPS.Auth&buttons=%E8%B4%AD%E4%B9%B0%3A%E5%8F%96%E6%B6%88&baseVersion=1&dsId=18164600656&eventVersion=1&storeFrontHeader=143465-19%2C30&eventTime=1665503063658&eventType=dialog&message=%E4%BD%BF%E7%94%A8%20Apple%C2%A0ID%20%E7%99%BB%E5%BD%95\"\n );\n}, NSLocalizedDescription=Authentication Failed}}, NSLocalizedFailureReason=An unknown error occurred, NSLocalizedDescription=Unhandled exception}}},https://ask.dcloud.net.cn/article/282",
    "code": 0
    }

    2022-10-11 23:47

要回复问题请先登录注册