Exemple #1
0
        public ActionResult GetPaymentContext()
        {
            //// TODO :-move to a translator at some point?

            PaymentContextViewModel viewModel = new PaymentContextViewModel
            {
                CustomerName   = paymentManager.GetCustomerName(UmbracoContext),
                AuthToken      = paymentManager.GetAuthToken(UmbracoContext),
                Environment    = paymentManager.GetEnvironment(UmbracoContext),
                NodeId         = CurrentPage.Id.ToString(),
                MakePaymentUrl = "/umbraco/Surface/Payment/MakePayment",
                AutoAllocate   = Request.QueryString[PaymentsQueryStringConstants.AutoAllocate],
                AppointmentId  = Request.QueryString[PaymentsQueryStringConstants.AppointmentId],
                InvoiceId      = Request.QueryString[PaymentsQueryStringConstants.InvoiceId],
                EmailAddress   = Request.QueryString[PaymentsQueryStringConstants.EmailAddress],
                PaymentAmount  = Request.QueryString[PaymentsQueryStringConstants.PaymenyAmount]
            };

            string jsonString = JsonConvert.SerializeObject(viewModel,
                                                            new JsonSerializerSettings
            {
                ContractResolver = new CamelCasePropertyNamesContractResolver()
            });

            return(Content(jsonString));
        }