public PaymentResponseDto MakePayment(PaymentPaypalDto input)
 {
     PaymentResponseDto results = new PaymentResponseDto();
     return (PaymentResponseDto)_creditsHeroConnect.CallCreditsHeroService<PaymentResponseDto>(results, input,
         "api/services/app/Susbcribers/MakePaypalPurchase");
 }
        public async Task<ActionResult> PostProcessPayment()
        {
            string role = GetUserRole();
            Users.User user = await GetUser();
            CreditsHero.Subscribers.Dtos.GetSubscribersInput input = await BuildCreditsHeroSubscriberInput(user);

            var companyInput = new CreditsHero.Common.Companies.Dtos.GetCompanyInput() { CompanyId = input.CompanyId.Value.ToString() };
            //Get Company entity so we can use the cost per credits
            var company = _companyService2.GetCompany(companyInput);

            //Get Company Configuration
            var companyConfig = _companyService2.GetCompanyConfig(companyInput);

            PaymentResponseDto paymentResponse = new PaymentResponseDto();
            PaymentDto payment = new PaymentDto();

            //TODO: Determine type of payment
            //PayPal Post Payment Process
            payment = new PaymentPaypalDto()
            {
                CompanyConfigurationSettings = companyConfig,
                CompanyId = company.Id,
                PayerId = Request.QueryString["PayerID"],
                PaymentGuid = Request.QueryString["Guid"],
                PaymentId = Request.QueryString["PaymentId"],
                Token = Request.QueryString["Token"],
                PaymentGatewayType = "PayPal",
                PaymentMethod = "PayPal",
                SubscribersEmail = input.SubscribersEmail,
                SubscribersId = input.SubscribersId,
                SubscribersName = input.SubscribersName,
                TaxAmount = 0,
                TransactionType = "PayPalExecute"
            };
            paymentResponse = _memberAppService.MakePayment(payment as PaymentPaypalDto);
            if (paymentResponse.AuthCode == "created")
            {
                return Redirect(paymentResponse.ResponseCode);
            }
            else
            {
                rooferlocator.com.Web.Models.ServiceResponse response = new Models.ServiceResponse()
                {
                    FriendlyMessage = paymentResponse.MessageCode == "sale"
                        ? String.Format("Payment accepted.  Transaction #: ", paymentResponse.TransactionId)
                        : String.Format("Processing Payment.  Transaction #: ", paymentResponse.TransactionId)
                };

                return Redirect((Url.Action("Index", "Home", response)));
            }
            //?guid = 3772 & paymentId = PAY - 5UN73352KF9557105K3KJ2JY & token = EC - 1BC22799SN423381H & PayerID = WWWCHTZE5U74L
        }