收藏
回答

Android 支付返回-1

这次很奇怪反复检查了包名和签名

使用demo里面的测试https://wxpay.wxutil.com/pub_v2/app/app_pay.php

结果依旧是-1 这是为啥?

x.record D/MicroMsg.PaySdk.WXFactory: createWXAPI, appId = wxb4ba3c02aa476ea1, checkSignature = false
2020-03-10 19:49:51.517 5824-5824/com.yanx.record D/MicroMsg.SDK.WXApiImplV10: <init>, appId = wxb4ba3c02aa476ea1, checkSignature = false
2020-03-10 19:49:51.518 5824-5824/com.yanx.record D/MicroMsg.SDK.WXMsgImplComm: ignore wechat app signature validation
2020-03-10 19:49:51.518 5824-5824/com.yanx.record D/MicroMsg.SDK.WXApiImplV10: registerApp, appId = wxb4ba3c02aa476ea1
2020-03-10 19:49:51.518 5824-5824/com.yanx.record D/MicroMsg.SDK.WXApiImplV10: registerApp, appId = wxb4ba3c02aa476ea1
2020-03-10 19:49:51.518 5824-5824/com.yanx.record D/MicroMsg.SDK.WXApiImplV10: register app com.yanx.record
2020-03-10 19:49:51.527 5824-5824/com.yanx.record D/MicroMsg.SDK.MMessage: send mm message, intent=Intent { act=com.tencent.mm.plugin.openapi.Intent.ACTION_HANDLE_APP_REGISTER (has extras) }, perm=com.tencent.mm.permission.MM_MESSAGE
2020-03-10 19:49:51.528 5824-5824/com.yanx.record D/MicroMsg.SDK.WXMsgImplComm: ignore wechat app signature validation
2020-03-10 19:49:51.528 5824-5824/com.yanx.record D/MicroMsg.SDK.WXMsgImplComm: ignore wechat app signature validation
2020-03-10 19:49:51.528 5824-5824/com.yanx.record I/MicroMsg.SDK.WXApiImplV10: sendReq, req type = 5
2020-03-10 19:49:51.529 5824-5824/com.yanx.record D/MicroMsg.SDK.MMessageAct: send, targetPkgName = com.tencent.mm, targetClassName = com.tencent.mm.plugin.base.stub.WXPayEntryActivity
2020-03-10 19:49:51.531 5824-5824/com.yanx.record I/Timeline: Timeline: Activity_launch_request time:898450912
2020-03-10 19:49:51.571 5824-5824/com.yanx.record D/MicroMsg.SDK.MMessageAct: send mm message, intent=Intent { flg=0x18000000 cmp=com.tencent.mm/.plugin.base.stub.WXPayEntryActivity (has extras) }
2020-03-10 19:49:51.823 5824-5824/com.yanx.record W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@d167d95
2020-03-10 19:49:51.845 5824-5824/com.yanx.record D/MicroMsg.PaySdk.WXFactory: createWXAPI, appId = wx83600e3a1ef831d0, checkSignature = true
2020-03-10 19:49:51.846 5824-5824/com.yanx.record D/MicroMsg.SDK.WXApiImplV10: <init>, appId = wx83600e3a1ef831d0, checkSignature = true
2020-03-10 19:49:51.846 5824-5824/com.yanx.record I/MicroMsg.SDK.WXApiImplV10: handleIntent, cmd = 5
2020-03-10 19:49:51.847 5824-5848/com.yanx.record D/ViewContentFactory: initViewContentFetcherClass
2020-03-10 19:49:51.847 5824-5848/com.yanx.record I/ContentCatcher: ViewContentFetcher : ViewContentFetcher
2020-03-10 19:49:51.847 5824-5848/com.yanx.record D/ViewContentFactory: createInterceptor took 1ms
2020-03-10 19:49:51.848 5824-5824/com.yanx.record I/微信支付回调: {"prepayId":"wx10153106308261c2f94cc2051509765632","errCode":-1}
回答关注问题邀请回答
收藏

3 个回答

  • 微信支付技术助手8
    微信支付技术助手8
    03-11

    首先按文档中业务流程和开发步骤接入,按照文档流程排查;如果还有问题,需要按以下环节排查:

    #
    1、统一下单返回是否正常(后面步骤都用到了这个接口的appid,mchid,prepayid,看参数是否匹配
    #
    2、第二次签名过程是否正确(此步骤商户一定要严格按文档的参数列表来做签名)
    #
    2.1、此处涉及一个细节:该接口没有sign_type参数,如果统一下单用的HMAC-SHA256签名,本步骤也必须按HMAC-SHA256
    #
    2.2、本次签名的参数列表要跟文档完全匹配:大小写要一致,参数值要与统一下单接口的保持一致,特别注意参数名:partnerid,取值为mchid(开平SDK历史原因,无法改名)
    #
    2.3、本步骤生成的sign与统一下单的不是同一个,经常有商户直接传同统一下单接口的sign过来
    #
    3、检查客户端调用sendReq(PayReq)对象赋值的正确性(必要时让商户提供数据),有一种情况是商户会通过异步获取到后台数据,比如data对象是通过异步请求得到的对象:request.appId = data.appid; 实际appid属性值为空,
    #
    4、 检查配置
    #
    4.1、 Android要求在开放平台后台配置正确的应用签名和包名
    #
    4.2、 IOS则不需要在开平配置,而是要求商户在开发环境红配置正确的URLSchemes为对应APPID
    03-11
    有用
    回复
  • 亦可赛艇
    亦可赛艇
    06-10

    api.registerApp调用了吗

    06-10
    有用
    回复
  • Kings Soul
    Kings Soul
    03-11
    {"appid":"wx83600e3a1ef831d0","sign":"A961BC6A6A1FE7DA76BCE05103104D4DD30D5F0075D62DB587B1434310F2CCED","prepayid":"CCD7BC46DC61DD0D935B3732193E0D4B0AD3CA87B3A3342713E6FBA4C19D9828","noncestr":"kKkywHCGOMrBu48RXE3mYBAiyNzkNrVf","timestamp":"1583916823","partnerid":"1576991101","pack_age":"Sign=WXPay"}
    

    这个是二次签名之后的数据 能否帮忙看 签名这些是否是对的

    03-11
    有用
    回复
登录 后发表内容
问题标签