/// <summary> /// 取消接口 /// </summary> /// <param name="requestData"></param> /// <returns></returns> public string CancelOrder(RequestData requestData) { var request = _tongChengGateway.CheckCancelOrder(requestData.RequestBody); var data = request.Data; var response = _ticketGateway.CancelOrder(new OrderCancelRequest { Body = new OrderCancelBody { OrderInfo = new OrderCancelInfo { OrderId = data.partnerOrderId, OrderPrice = 0, OrderQuantity = data.tickets, reason = data.reason, Seq = data.orderSerialId } } }); if (response.Head.Code == "000000") { var tongChengResponse = new CancelOrderResponse { refundStatus = 1, remark = "成功" }; return(_tongChengGateway.CancelOrder(tongChengResponse)); } else if (response.Head.Code == "114007") { var tongChengResponse = new CancelOrderResponse { refundStatus = 3, remark = "订单取消失败,不支持部分取消" }; return(_tongChengGateway.CancelOrder(tongChengResponse)); } else if (response.Head.Code == "114004") { return(_tongChengGateway.ErrorResult(ResultCode.OrderNumberNotExist, response.Head.Describe)); } else if (response.Head.Code == "114009" || response.Head.Code == "114013") { return(_tongChengGateway.ErrorResult(ResultCode.CancelOrderForConsume, response.Head.Describe)); } else if (response.Head.Code == "114010") { return(_tongChengGateway.ErrorResult(ResultCode.CancelOrderForCancel, response.Head.Describe)); } else if (response.Head.Code == "114011") { return(_tongChengGateway.ErrorResult(ResultCode.CancelOrderForExpired, response.Head.Describe)); } else if (response.Head.Code == "114012") { return(_tongChengGateway.ErrorResult(ResultCode.Error, response.Head.Describe)); } return(_tongChengGateway.ErrorResult(ResultCode.DataError, response.Head.Describe)); }
/// <summary> /// 取消接口 /// </summary> /// <param name="requestData"></param> /// <returns></returns> public string CancelOrder(string request) { var requestBody = _ctripGateway.CheckCancelOrder(request); var data = requestBody.Data; var response = _ticketGateway.CancelOrder(new OrderCancelRequest { Body = new OrderCancelBody { OrderInfo = new OrderCancelInfo { OrderId = data.vendorOrderId, OrderPrice = 0, OrderQuantity = data.cancelCount, reason = "", Seq = data.sequenceId } } }); if (response.Head.Code == "000000") { var responseBody = new CancelOrderBodyRespose { orderStatus = "3", cancelCount = data.cancelCount, charge = 0, auditDuration = 0 }; return(_ctripGateway.CancelOrder(responseBody)); } else if (response.Head.Code == "114007") { return(_ctripGateway.ErrorResult(ResultCode.CancelOrderForNotCount, "取消数量不正确,同时不支持部分取消")); } else if (response.Head.Code == "114004") { return(_ctripGateway.ErrorResult(ResultCode.CancelOrderNumberNotExist, response.Head.Describe)); } else if (response.Head.Code == "114009" || response.Head.Code == "114013") { return(_ctripGateway.ErrorResult(ResultCode.CancelOrderForConsume, response.Head.Describe)); } else if (response.Head.Code == "114010") { return(_ctripGateway.ErrorResult(ResultCode.CancelOrderForCancel, response.Head.Describe)); } else if (response.Head.Code == "114011") { return(_ctripGateway.ErrorResult(ResultCode.CancelOrderForExpired, response.Head.Describe)); } else if (response.Head.Code == "114012") { return(_ctripGateway.ErrorResult(ResultCode.SystemError, response.Head.Describe)); } return(_ctripGateway.ErrorResult(ResultCode.CancelOrderForError, response.Head.Describe)); }