예제 #1
0
        private string ValidatePayment(TourClient tourClient, decimal amountToPay)
        {
            _serviceEndPoint = new ServicesEndPoint.GeneralSevices.ServicesEndPoint(_simbaToursUnitOfWork, _emailService);
            var productArray = new List <Product>();

            if (tourClient != null)
            {
                productArray.Add(new Product
                {
                    ProductName   = tourClient.Hotel.Location.LocationName + "-" + tourClient.Hotel.HotelName,
                    Amount        = amountToPay,
                    HasPaidInfull = amountToPay == tourClient.GrossTotalCosts - tourClient.PaidInstallments
                });
            }
            _serviceEndPoint.SavePayment(tourClient, amountToPay);
            var paymentGateway = new PaymentGateway(_applicationConstants.Value.BaseUrl, _applicationConstants.Value.BusinessEmail, _applicationConstants.Value.SuccessUrl, _applicationConstants.Value.CancelUrl, _applicationConstants.Value.NotifyUrl, tourClient.EmailAddress);

            return(paymentGateway.MakePaymentByPaypal(productArray));
        }