Пример #1
0
        /// <summary>
        /// Method Name     : CallPostPaymentTransaction
        /// Author          : Hiren Patel
        /// Creation Date   : 15 Feb 2018
        /// Purpose         : Calls the post payment transaction.
        /// Revision        :
        /// </summary>
        /// <returns>The post payment transaction.</returns>
        /// <param name="paymentTransactonModel">Payment transacton model.</param>
        /// <param name="paymentGatewayModel">payment gateway model.</param>
        private async Task CallPostPaymentTransaction(PaymentTransactonModel paymentTransactonModel, PaymentGatewayModel paymentGatewayModel)
        {
            APIResponse <PaymentModel> serviceResponse = new APIResponse <PaymentModel>()
            {
                STATUS = false
            };
            string errorMessage = string.Empty;

            try
            {
                paymentModel.CustomerID        = paymentGatewayModel.CustomerID;
                paymentModel.MoveID            = DTOConsumer.dtoMoveData.MoveNumber;
                paymentModel.TransactionNumber = paymentTransactonModel.TransactionID;
                paymentModel.TransactionDate   = UIHelper.DisplayDateFormatForEstimate(DateTime.Now);
                paymentModel.CustomerID        = paymentGatewayModel.CustomerID;
                paymentModel.TransactionAmount = Convert.ToString(paymentGatewayModel.TransactionAmout);
                CalculateDueAmountToPaymentModel();
                serviceResponse = await payment.PutPaymentAmount(paymentModel);
            }
            catch (Exception error)
            {
                errorMessage = error.Message;
            }
            finally
            {
                if (!string.IsNullOrEmpty(errorMessage))
                {
                    await UIHelper.ShowMessageWithOKConfirm(string.Empty, errorMessage, AppConstant.ALERT_OK_BUTTON_TEXT);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Method Name     : CallPostPaymentTransaction
        /// Author          : Hiren Patel
        /// Creation Date   : 15 Feb 2018
        /// Purpose         : Calls the post payment transaction.
        /// Revision        :
        /// </summary>
        /// <returns>The post payment transaction.</returns>
        /// <param name="paymentTransactonModel">Payment transacton model.</param>
        /// <param name="estimateModel">Estimate model.</param>
        private async Task CallPostPaymentTransaction(PaymentTransactonModel paymentTransactonModel, EstimateModel estimateModel)
        {
            APIResponse <PaymentModel> serviceResponse = new APIResponse <PaymentModel>()
            {
                STATUS = false
            };
            string errorMessage = string.Empty;

            try
            {
                List <PaymentModel> paymentModelList = new List <PaymentModel>();
                PaymentModel        paymentModel     = new PaymentModel();
                paymentModel.MoveID            = estimateModel.MoveId;
                paymentModel.TransactionNumber = paymentTransactonModel.TransactionID;
                if (!IsNullOrEmptyOrWhiteSpace(estimateModel.Deposit))
                {
                    paymentModel.TransactionAmount = RemoveCurrencyFormat(estimateModel.Deposit);
                }

                paymentModel.TransactionDate = UIHelper.DisplayDateFormatForEstimate(DateTime.Now);
                paymentModel.CustomerID      = LoginCustomerData.CustomerId;

                paymentModelList.Add(paymentModel);
                serviceResponse = await payment.PostPaymentTransaction(paymentModelList);
            }
            catch (Exception error)
            {
                errorMessage = error.Message;
            }
            finally
            {
                if (!string.IsNullOrEmpty(errorMessage))
                {
                    await UIHelper.ShowMessageWithOKConfirm(string.Empty, errorMessage, AppConstant.ALERT_OK_BUTTON_TEXT);
                }
            }
        }