Exemple #1
0
        public ActionResult Return(string commerceReturnUrl)
        {
            var paymentId = Convert.ToInt32(Request["add_paymentId"]);
            var payment   = _paymentService.Find(paymentId);
            var method    = _paymentMethodService.Find(payment.PaymentMethodId);
            var result    = ProcessResponse(payment, method.LoadProcessorConfig <BuckarooConfig>());

            _paymentService.AcceptProcessResult(payment, result);

            return(Redirect(Url.Payment().DecorateReturn(commerceReturnUrl, payment)));
        }
Exemple #2
0
        /// <summary>
        /// 删除数据
        /// </summary>
        /// <returns>返回Json串</returns>
        public string Delete()
        {
            long id = Convert.ToInt64(System.Web.HttpContext.Current.Request.Params["id"]);              //主表主键

            FindedResults <PaymentMethodModel> paymentMethods = PaymentMethodService.Find(t => t.PhId == id);

            if (paymentMethods != null && paymentMethods.Data.Count > 0)
            {
                string dm = paymentMethods.Data[0].Dm;
                FindedResults <ProjectDtlBudgetDtlModel> findedResults1 = ProjectMstService.FindPaymentMethod(dm);
                if (findedResults1 != null && findedResults1.Status == ResponseStatus.Error)
                {
                    return(DataConverterHelper.SerializeObject(findedResults1));
                }

                FindedResults <BudgetDtlBudgetDtlModel> findedResults2 = BudgetMstService.FindPaymentMethod(dm);
                if (findedResults2 != null && findedResults2.Status == ResponseStatus.Error)
                {
                    return(DataConverterHelper.SerializeObject(findedResults2));
                }
            }

            var deletedresult = PaymentMethodService.Delete <System.Int64>(id);

            return(DataConverterHelper.SerializeObject(deletedresult));
        }
        public void Report()
        {
            var iDealTransactionId = Request["transaction_id"];
            var payment            = _paymentService.Query().ByThirdPartyTransactionId(iDealTransactionId, "iDeal");

            var paymentMethod = _paymentMethodService.Find(payment.PaymentMethodId);
            var settings      = paymentMethod.LoadProcessorConfig <IDealConfig>();
            var idealCheck    = new IdealCheck(settings.PartnerId, settings.TestMode, iDealTransactionId);

            ProcessPaymentResult result = null;

            if (idealCheck.Error)
            {
                result = ProcessPaymentResult.Failed(idealCheck.ErrorMessage, iDealTransactionId);
            }
            else if (idealCheck.Payed)
            {
                result = ProcessPaymentResult.Success(iDealTransactionId);
            }

            if (result != null)
            {
                _paymentService.AcceptProcessResult(payment, result);
            }
        }
Exemple #4
0
        /// <summary>
        /// 根据主键获取数据
        /// </summary>
        /// <returns>返回Json串</returns>
        public string GetPaymentMethodInfo()
        {
            long   id           = Convert.ToInt64(System.Web.HttpContext.Current.Request.Params["id"]); //主表主键
            string tabtype      = System.Web.HttpContext.Current.Request.Params["tabtype"];             //Tab类型
            var    findedresult = PaymentMethodService.Find(id);

            return(DataConverterHelper.ResponseResultToJson(findedresult));
        }
        public ActionResult BasicInfo(int?id)
        {
            var model = new PaymentMethodEditorModel
            {
                AvailablePaymentProcessors = GetAvailablePaymentProcessors()
            };

            if (id != null)
            {
                var method = _paymentMethodService.Find(id.Value);
                model.Id                      = method.Id;
                model.Name                    = method.Name;
                model.UserKey                 = method.UserKey;
                model.ProcessorName           = method.ProcessorName;
                model.AdditionalFeeChargeMode = method.AdditionalFeeChargeMode;
                model.AdditionalFeeAmount     = method.AdditionalFeeAmount;
                model.AdditionalFeePercent    = method.AdditionalFeePercent;
            }

            return(View(model));
        }