Beispiel #1
0
        public ActionResult GetTokenAndPid(string reason, decimal amount, string currency, int itemId = 0)
        {
            var clientToken = _braintreeService.GetClientToken();
            var payment     = new PaymentRecord {
                Reason        = reason,
                Amount        = amount,
                Currency      = currency,
                ContentItemId = itemId
            };

            payment = _posService.StartPayment(payment);
            var result = new { Token = clientToken, Pid = payment.Id };

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        public HttpResponseMessage Get()
        {
            var clientToken = _braintreeService.GetClientToken();

            // create response and return
            var result = new HttpResponseMessage(HttpStatusCode.OK);

            result.Content = new System.Net.Http.StringContent(clientToken, Encoding.UTF8, "text/plain");
            return(result);
        }