public async Task <IActionResult> UpdateIngenicoPayment([FromBody] ODataActionParameters value) { CommandsController commandsController = this; if (!commandsController.ModelState.IsValid || value == null) { return((IActionResult) new BadRequestObjectResult(commandsController.ModelState)); } string orderId = value["orderId"].ToString(); string brand = value["brand"].ToString(); string status = value["status"].ToString(); UpdateIngenicoPaymentCommand command = commandsController.Command <UpdateIngenicoPaymentCommand>(); bool result = await command.Process(commandsController.CurrentContext, orderId, brand, status); return((IActionResult) new ObjectResult((object)command)); }
public async Task <IActionResult> AddIngenicoPayment([FromBody] ODataActionParameters value) { CommandsController commandsController = this; if (!commandsController.ModelState.IsValid || value == null) { return((IActionResult) new BadRequestObjectResult(commandsController.ModelState)); } if (!value.ContainsKey("cartId") || value["cartId"] == null || !value.ContainsKey("payment") || value["payment"] == null) { return((IActionResult) new BadRequestObjectResult(value)); } string cartId = value["cartId"].ToString(); IngenicoPaymentComponent paymentComponent = JsonConvert.DeserializeObject <IngenicoPaymentComponent>(value["payment"].ToString()); AddPaymentsCommand command = commandsController.Command <AddPaymentsCommand>(); Cart cart = await command.Process(commandsController.CurrentContext, cartId, new List <PaymentComponent>() { paymentComponent }); return((IActionResult) new ObjectResult((object)command)); }