Beispiel #1
0
        private logpayment ConstructLogPayment(PaymentStatusResponseViewModel paymentStatus)
        {
            var paymentInfo = paymentStatus.PaymentInfo;
            var requestReferrerUrl = Request.UrlReferrer.AbsolutePath;

            var log = new logpayment
            {
                Amount = paymentInfo.Amount.ToDecimal(),
                AuthCode = paymentStatus.AuthCode,
                CreateDT = DateTime.Now,
                Currency = paymentInfo.Currency,
                ErrDesc = paymentStatus.ErrDesc,
                MerchantCode = paymentInfo.MerchantCode,
                PaymentId = paymentInfo.PaymentId.ToInt(),
                RefNo = paymentInfo.RefNo,
                Remark = paymentInfo.Remark,
                RequestReferrerUrl = requestReferrerUrl,
                Signature = paymentInfo.Signature,
                Status = paymentStatus.Status,
                TransId = paymentStatus.TransID
            };

            return log;
        }
Beispiel #2
0
        private PaymentStatusResponseViewModel ConstructPaymentResponseModel()
        {
            var paymentInfo = new CheckoutPaymentInfo
            {
                MerchantCode = Request["MerchantCode"] ?? "",
                PaymentId = Request["PaymentId"] ?? "",
                RefNo = Request["RefNo"] ?? "",
                Amount = Request["Amount"] ?? "",
                Currency = Request["Currency"] ?? "",
                Remark = Request["Remark"] ?? "",
                Signature = Request["Signature"] ?? ""
            };

            var viewModel = new PaymentStatusResponseViewModel
            {
                PaymentInfo = paymentInfo,
                TransID = Request["TransId"] ?? "",
                AuthCode = Request["AuthCode"] ?? "",
                Status = Request["Status"] ?? "",
                ErrDesc = Request["ErrDesc"] ?? ""
            };

            return viewModel;
        }