public static PurchaseVoidRequest ToPurchaseVoidRequest(GeoITDPurchaseRequest src_) { PurchaseVoidRequest retVal = new PurchaseVoidRequest(); try { retVal = new PurchaseVoidRequest() { PosID = src_.PosID, SystemId = src_.SystemID, Branch = src_.Branch, ClientAppId = src_.ClientAppId, UserId = src_.UserId, TicketNumber = src_.OriginalTicket, }; } catch { } return(retVal); }
/*public bool PurchaseAnnulment(PurchaseVoidRequest request_, out PurchaseQueryResponse response_) * { * LOG.Debug("ENTER"); * * bool retVal = false; * response_ = null; * * try * { * tws.geoitd.GeoITDClientSOAP.POSInterfaceServiceClient svc = new tws.geoitd.GeoITDClientSOAP.POSInterfaceServiceClient(); * svc.ChannelFactory.Endpoint.ListenUri = new Uri("http://geoitddev.geocom.com.uy:8554/v2/itdservice"); * * request_.SystemId = Settings.Default.GeoITD_SystemID; * request_.PosID = Settings.Default.GeoITD_PosID; * request_.Branch = Settings.Default.GeoITD_Branch; * * var purchaseResponse = svc.processFinancialPurchaseVoidByTicket(request_); * * if (purchaseResponse.ResponseCode != 0) * return false; * * tws.geoitd.GeoITDClientSOAP.PurchaseQueryResponse purchaseStatus = new PurchaseQueryResponse(); * bool keepReading = true; * while (keepReading) * { * tws.geoitd.GeoITDClientSOAP.PurchaseQueryRequest pqr = new tws.geoitd.GeoITDClientSOAP.PurchaseQueryRequest(); * pqr.SystemId = request_.SystemId; * pqr.PosID = request_.PosID; * pqr.Branch = request_.Branch; * pqr.ClientAppId = request_.ClientAppId; * pqr.UserId = request_.UserId; * pqr.TransactionDateTimeyyyyMMddHHmmssSSS = request_.TransactionDateTimeyyyyMMddHHmmssSSS; * pqr.TransactionId = purchaseResponse.TransactionId; * pqr.STransactionId = purchaseResponse.STransactionId; * * purchaseStatus = svc.processFinancialPurchaseQuery(pqr); * * keepReading = (purchaseStatus.ResponseCode == 10 || purchaseStatus.ResponseCode == 12); * Thread.Sleep(100); * } * * if (retVal = (purchaseStatus.ResponseCode == 0)) * response_ = purchaseStatus; * } * catch (Exception ex) * { * LOG.Fatal(ex, "{Message}", "Exception caught."); * } * finally * { * LOG.Debug("EXIT"); * } * * return retVal; * } */ //public bool PurchaseVoid(PurchaseVoidRequest request_, out PurchaseQueryResponse statusResponse_) //{ // LOG.Debug("ENTER"); // bool retVal = false; // statusResponse_ = null; // try // { // var code = GeoITDOperationCall( // (out long trId_) => // { // var resp = mPOSClient.processFinancialPurchaseVoidByTicket(request_); // trId_ = resp.TransactionId; // return resp.ResponseCode; // }, request_, out statusResponse_, out retVal); // } // catch (Exception ex) // { // LOG.Fatal(ex, "{Message}", "Exception caught."); // } // finally // { // LOG.Debug("EXIT"); // } // return retVal; //} public bool PurchaseVoid(PurchaseVoidRequest request_, out PurchaseVoidResponse response_) { LOG.Debug("ENTER"); bool retVal = false; response_ = null; try { response_ = mPOSClient.processFinancialPurchaseVoidByTicket(request_); retVal = (response_.ResponseCode == 0); } catch (Exception ex) { LOG.Fatal(ex, "{Message}", "Exception caught."); } finally { LOG.Debug("EXIT"); } return(retVal); }