收藏
回答

虚拟支付调用报错 requestVirtualPayment OFFER_NOT_INIT?

昨天开通了虚拟支付,今天调用报错 requestVirtualPayment OFFER_NOT_INIT

errCode: -15008
errMsg"requestVirtualPayment:fail OFFER_NOT_INIT"
errno: -15008

在小程序后台也没看到哪里需要再审核或者提交资料的地方了啊?

回答关注问题邀请回答
收藏

2 个回答

  • J.smile
    J.smile
    04-18

    支付参数

    {"mode":"short_series_goods","signData":"{\"offerId\":\"1450513993\",\"outTradeNo\":\"202604180953592020\",\"productId\":\"854435933618\",\"goodsPrice\":5,\"activitySellingPrice\":5,\"buyQuantity\":1,\"currencyType\":\"CNY\",\"env\":1}","paySig":"6ab739cf9f4ba1da14968ffba400ba71ce75ce9cc8087be1731b0f347f3102bf","signature":"47a4d6c00a3ff96585b5bce81e29b0568c3903ebde18388384425945608d41c1","showToast":false}
    

    请求时间 2026-04-18 09:54:02

    小程序APPID wxa8135bfc3d5f797b

    商户号 1450513993

    服务端调用凭证的获取方式

    async accessToken() {
        const { AppID, AppSecret } = await this.getApplet();
        const memkey = `wxsp_at_` + AppID;
        let accessToken = await this.ctx.service.memcache.get(memkey);
        if (typeof accessToken === 'undefined') {
          const APP_URL = 'https://api.weixin.qq.com/cgi-bin/stable_token';
          const res = await this.ctx.curl(APP_URL, {
            method: 'post',
            dataType: 'json',
            contentType: 'json',
            data: {
              grant_type: 'client_credential',
              appid: AppID,
              secret: AppSecret,
            },
          });
          const data = res.data;
          if (this.ctx.helper.isEmpty(data) || this.ctx.helper.isEmpty(data.access_token)) {
            await this.ctx.service.log.insert({
              user_id: 0,
              item_type: 'getAccessToken',
              action: 'POST',
              remarks: JSON.stringify(res.data),
              more_details: '{}',
              item_id: 0,
              success: 400,
            });
            this.ctx.returnError('获取 access_token 失败');
          }
    
          accessToken = data.access_token;
          await this.ctx.service.memcache.set(memkey, accessToken, 60 * 10);
        }
    
        return accessToken;
      }
    
    04-18
    有用
    回复
  • 智能回答 智能回答 本次回答由AI生成
    04-18
    有用
    回复
登录 后发表内容