示例#1
0
        public ActionResult <UpdatePaymentStatusResponseModel> handling([FromBody] NotificationHandlingModel data)
        {
            MidTransBL bl = new MidTransBL(DbContext, AppSettings);

            UpdatePaymentStatusInputModel input = new UpdatePaymentStatusInputModel();

            return(bl.SaveMidtransLog(data, ModeMidTransEnum.Listener));
        }
示例#2
0
        public UpdatePaymentStatusResponseModel SaveMidtransLog(NotificationHandlingModel data, ModeMidTransEnum mode)
        {
            MidTransLog temp = new MidTransLog();


            temp.CreateByUserID = Guid.NewGuid();
            temp.CreateDate     = DateTime.Now;
            temp.MidTransStatus = 3;
            temp.PaymentID      = Guid.NewGuid();

            var      iString = data.transaction_time;
            DateTime oDate   = DateTime.ParseExact(iString, "yyyy-MM-dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture);

            temp.Transaction_Time   = oDate;
            temp.Transaction_Status = data.transaction_status;
            temp.Transaction_ID     = data.transaction_id;
            temp.Status_Message     = data.status_message;
            temp.Status_Code        = data.status_code;
            temp.Signature_Key      = data.signature_key;
            temp.Payment_Type       = data.payment_type;
            temp.Order_ID           = data.order_id;
            temp.Merchant_ID        = data.merchant_id;
            temp.Gross_Amount       = data.gross_amount;
            temp.Currency           = data.currency;
            temp.Approval_Code      = data.approval_code;
            temp.ModeTransaction    = (int)mode;

            MidtransLogRepository repo = new MidtransLogRepository(DbContext);

            var res = repo.Insert(temp);

            UpdatePaymentStatusOutputModel output = new UpdatePaymentStatusOutputModel();

            output.Message = res.Message;

            UpdatePaymentStatusResponseModel response = new UpdatePaymentStatusResponseModel();

            response.Message  = res.Message;
            response.Response = true;


            return(response);
        }