예제 #1
0
        protected async override Task <object> OnPerform()
        {
            var content = new StringContent(JsonConvert.SerializeObject(_couponContract)
                                            , Encoding.UTF8, ApplicationJSON);
            var response = await _checkoutRestClient.PaymentByCoupon(content);

            var data = await response.Content.ReadAsStringAsync();

            switch (response.StatusCode)
            {
            case HttpStatusCode.OK:
                var paymentByCoupon = new DeSerializer().MapTenderSummary(data);
                return(new Mapper().MapTenderSummary(paymentByCoupon));

            default:
                return(await HandleExceptions(response));
            }
        }