public KlarnaCreateCaptureOrderResponse CreateKlarnaCaptureOrder(KlarnaCreateCaptureOrderRequest request) { var res = _client.CreateCaptureOrder(MakeCaptureOrderRequest(request)); KlarnaCreateCaptureOrderResponse response = new KlarnaCreateCaptureOrderResponse { CaptureId = res.CaptureId, ErrorMessage = res.ErrorMessage, KlarnaOrderStatus = res.IsSuccess ? "Created" : "Failed" }; return(response); }
private CreateCaptureOrderRequest MakeCaptureOrderRequest(KlarnaCreateCaptureOrderRequest request) { CreateCaptureOrderRequest req = new CreateCaptureOrderRequest { KlarnaOrderId = request.KlarnaOrderId, CaptureData = new OrderManagementCreateCapture { CapturedAmount = int.Parse(request.CapturedAmount.ToString("0.00").Replace(".", "").Replace(",", "")), Description = request.Description } }; return(req); }