Exemple #1
0
        public void ModifyBusifavorStockBudgetAsyncTest()
        {
            if (createBusifavorStockResult is null)
            {
                CreateBusifavorStockAsyncTest();
            }

            var key          = TenPayHelper.GetRegisterKey(Config.SenparcWeixinSetting);
            var TenPayV3Info = TenPayV3InfoCollection.Data[key];

            // TODO:流水号?这样是否有效?
            var modify_budget_request_no = string.Format("{0}{1}{2}", TenPayV3Info.MchId /*10位*/, SystemTime.Now.ToString("yyyyMMddHHmmss"), TenPayV3Util.BuildRandomStr(6));
            var requestData = new ModifyBusifavorStockBudgetRequestData(createBusifavorStockResult.stock_id, 20, null, null, null, modify_budget_request_no);

            var marketingApis = new MarketingApis();
            var result        = marketingApis.ModifyBusifavorStockBudgetAsync(requestData).GetAwaiter().GetResult();

            Console.WriteLine("微信支付 V3 修改批次预算接口:" + result.ToJson(true));

            Assert.IsNotNull(result);
            Assert.IsTrue(result.ResultCode.Success);
            Assert.IsTrue(result.VerifySignSuccess == true);//通过验证
        }