小游戏 虚拟支付
发布于 5 年前 作者 zhumin 18498 次浏览 来自 问答

小游戏的虚拟支付,只要开通微信支付和虚拟支付后,直接调用就可以吗??

wx.requestMidasPayment({

mode: “game”,          //购买游戏币

env: 1,                //0正式环境 1沙箱环境

offerId: “********”,      //米大师应用ID

currencyType: “CNY”,   //币种(CNY:人民币)

platform: “android”,    //否 申请接入时的平台,platform 与应用id有关。  

buyQuantity: 1,   //购买数量。mode=game 时必填。购买数量。详见 buyQuantity 限制说明。  

zoneId: “1”,           //否  分区 ID 

success: function (res) {   //否 接口调用成功的回调函数 

console.log(“调用成功”);

console.log(res);

},

fail: function (res) {        //否 接口调用失败的回调函数 

console.log(调用失败);

console.log(res);

},

complete: function () {    //否 接口调用结束的回调函数(调用成功、失败都会执行)

}

});

回到顶部