예제 #1
0
        /// <summary>
        /// 取得 7-11 超商繳費 BarCode 圖片
        /// </summary>
        /// <param name="model">取得標的物資料(繳款紀錄) Input</param>
        /// <returns>取得往來明細清單(未繳/逾期) Output</returns>
        public async Task <BaseResult <Barcode711Output> > Get711BarCodeImg(Barcode711Input model)
        {
            // 透過 Api 把資料送出去
            string apiUrl = "APP_FORM_PAY/GET_711_BARCODE_IMG";
            BaseResult <Barcode711Output> result = await ApiService.Instance.ApiGet711BarCodeImg(model, apiUrl);

            return(result);
        }
예제 #2
0
        public async Task <ActionResult> Get711BarCodeImg(List <ArList> arList)
        {
            BaseResult <MergeBarcodeOutput> resultModel = await this.GetMergeBarCodeData(arList);

            if (resultModel.Result.ReturnCode != 0)
            {
                return(null);
            }

            // 7-11 要自行抽換 barCode 前四碼
            string checkBarCodeHead = ConfigurationManager.AppSettings["CheckBarCodeHead"];
            string barCodeHead      = barCodeHead = ConfigurationManager.AppSettings["711BarCodeHead"];

            // 如果前四碼不是G800的話,就抽換成創鉅的 G910
            if (resultModel.Data.BARCODE2.Substring(0, 4) != checkBarCodeHead)
            {
                barCodeHead = ConfigurationManager.AppSettings["711BarCodeHead2"];
            }

            string barCode2    = barCodeHead + resultModel.Data.BARCODE2.Substring(4, resultModel.Data.BARCODE2.Length - 4);
            int    totalAmount = arList.Sum(x => int.Parse(x.AR_AMT));

            Barcode711Input model = new Barcode711Input
            {
                COMP_ID   = this.TokenVerify.CustId,
                Oino      = resultModel.Data.OINO,
                OL_Amount = totalAmount.ToString(),
                OL_Code_2 = barCode2,
                TraceID   = barCode2,
                MbrId     = this.TokenVerify.MbrId,
                DevId     = this.TokenVerify.DevId,
                Token     = this.TokenVerify.Token,
                SYS_ID    = Common.GetSysId()
            };

            AppFormPayService             appFormPayService = new AppFormPayService();
            BaseResult <Barcode711Output> result            = await appFormPayService.Get711BarCodeImg(model);

            return(this.Json(result));
        }
예제 #3
0
        /// <summary>
        /// 取得 7-11 超商繳費 BarCode
        /// </summary>
        /// <param name="model">param</param>
        /// <param name="apiUrl">Api 路徑</param>
        /// <returns>result</returns>
        public async Task <BaseResult <Barcode711Output> > ApiGet711BarCodeImg(Barcode711Input model, string apiUrl)
        {
            BaseResult <Barcode711Output> result = await this.GetApiResultAsync <BaseResult <Barcode711Output> >(apiUrl, model);

            return(result);
        }