예제 #1
0
        /// <summary>
        /// 주문 실행
        /// </summary>
        /// <param name="orderParam"></param>
        /// <param name="orderParamEtc"></param>
        /// <param name="paymenPayMethodtInfo"></param>
        /// <param name="paymentDataOrderInfoList"></param>
        /// <param name="paymentDataCostBasisInfoList"></param>
        /// <param name="paymentOrderItemCostInfoList"></param>
        /// <returns></returns>
        //private List<PaymentGEPOrderMultiResultT> PaymentStartOrder()
        private PaymentGEPPaymentProcessResultT PaymentExecuteOrder(PaymentOrderMultiParamT orderParam
			, PaymentOrderMultiParamEtcT orderParamEtc
			, PaymentInfoCheckT paymenPayMethodtInfo
			, List<PaymentDataOrderInfoT> paymentDataOrderInfoList
			, List<PaymentDataCostBasisInfoT> paymentDataCostBasisInfoList
			, List<PaymentOrderItemCostInfoT> paymentOrderItemCostInfoList)
        {
            PaymentGEPPaymentProcessResultT orderResult = new PaymentGEPPaymentProcessResultT();

            PaymentBiz paymentBiz = new PaymentBiz();
            PaymentProcessQueryBiz paymentProcessQueryBiz = new PaymentProcessQueryBiz();

            orderResult.Result = new GEPBaseResultT();

            #region 주문

            #region 주문 실행

            PaymentGEPPaymentProcessResultT paymentExecuteOrderResult = paymentProcessQueryBiz.PaymentExecuteOrder(
                orderParam
                , orderParamEtc
                , paymenPayMethodtInfo
                , paymentDataOrderInfoList
                , paymentDataCostBasisInfoList
                , paymentOrderItemCostInfoList);

            #endregion

            #region 주문 이후 처리

            GEPBaseResultT followUpResult = PaymentExecuteOrderFollowUp(orderParam);

            if (followUpResult.RetCode != 0)
            {
                orderResult.Result = followUpResult;
            }

            #endregion

            #region 주문 내역 조회

            List<PaymentGEPOrderMultiResultT> orderItemList = GetExecuteOrderItemList(paymentDataOrderInfoList);

            #endregion

            #region 주문 CleanUp

            try
            {
                PaymentExecuteOrderCleanUp(orderParam);
            }
            catch
            {

            }

            #endregion

            paymentExecuteOrderResult.OrderResultList.AddRange(orderItemList);

            #endregion

            #region 주문 결과 처리

            if (paymentExecuteOrderResult.OrderResultList == null)
            {
                orderResult.Result.RetCode = -1107;
                orderResult.Result.RetMessage = "주문 접수중에 문제가 발생하여 결제가 이루어지지 않았습니다. 확인후 다시 주문해 주시기 바랍니다";
            }
            else
            {
                if (paymentExecuteOrderResult.OrderResultList.Count <= 0)
                {
                    orderResult.Result.RetCode = -1108;
                    orderResult.Result.RetMessage = "주문 접수중에 문제가 발생하여 결제가 이루어지지 않았습니다. 확인후 다시 주문해 주시기 바랍니다";
                }
                else
                {
                    orderResult.Result.RetCode = paymentExecuteOrderResult.OrderResultList[0].RetCode;
                    orderResult.Result.RetMessage = paymentExecuteOrderResult.OrderResultList[0].RetReason;

                    orderResult.OrderResultList.AddRange(paymentExecuteOrderResult.OrderResultList);
                }
            }

            #endregion

            return orderResult;
        }