Esempio n. 1
0
        /// <summary>
        /// Replies as a staff member on the behalf of a patron to a conditonal raised by a previous hold request creation.
        /// </summary>
        /// <param name="holdRequest">The result of the hold request that you are replying to.</param>
        /// <param name="requestingOrgId">The Org ID of the branch processing the request.</param>
        /// <param name="answer">The answer to the conditional.</param>
        /// <param name="state">Which conditional will this answer be replied to?</param>
        /// <returns>An object containing the hold request creation result.</returns>
        /// <seealso cref="HoldRequestReplyData"/>
        /// <seealso cref="HoldRequestResult"/>
        public PapiResponse <HoldRequestReplyData> HoldRequestReply(HoldRequestResult holdRequest, int requestingOrgId, int answer, int state)
        {
            var xml = HoldRequestHelper.BuildHoldRequestReplyXml(holdRequest, requestingOrgId, answer, state);
            var url = $"/PAPIService/REST/public/v1/1033/100/1/holdrequest/{holdRequest.RequestGuid}";

            return(OverrideExecute <HoldRequestReplyData>(HttpMethod.Put, url, body: xml));
        }
        /// <summary>
        /// Replies as a staff member on the behalf of a patron to a conditonal raised by a previous hold request creation.
        /// </summary>
        /// <param name="holdRequest">The result of the hold request that you are replying to.</param>
        /// <param name="requestingOrgID">The Org ID of the branch processing the request.</param>
        /// <param name="answer">The answer to the conditional.</param>
        /// <param name="state">Which conditional will this answer be replied to?</param>
        /// <returns>An object containing the hold request creation result.</returns>
        /// <seealso cref="HoldRequestReplyData"/>
        /// <seealso cref="HoldRequestResult"/>
        public HoldRequestReplyData staff_HoldRequestReply(HoldRequestResult holdRequest, int requestingOrgID, int answer,
            int state)
        {
            var doc = new XDocument(
                new XElement("HoldRequestReplyData",
                             new XElement("TxnGroupQualifier", holdRequest.TxnGroupQualifier),
                             new XElement("TxnQualifier", holdRequest.TxnQualifier),
                             new XElement("RequestingOrgID", requestingOrgID),
                             new XElement("Answer", answer),
                             new XElement("State", state)
                    )
                );

            var request = new RestRequest(string.Format("public/v1/1033/100/1/holdrequest/{0}", holdRequest.RequestGUID),
                                          Method.PUT);
            request.AddParameter("text/xml", doc.ToString(), ParameterType.RequestBody);

            _client.Authenticator = new PolarisProtectedAuthenticator(ApiUser, ApiKey, token);
            return Execute<HoldRequestReplyData>(request);
        }
        /// <summary>
        /// Replies as a staff member on the behalf of a patron to a conditonal raised by a previous hold request creation.
        /// </summary>
        /// <param name="holdRequest">The result of the hold request that you are replying to.</param>
        /// <param name="requestingOrgID">The Org ID of the branch processing the request.</param>
        /// <param name="answer">The answer to the conditional.</param>
        /// <param name="state">Which conditional will this answer be replied to?</param>
        /// <returns>An object containing the hold request creation result.</returns>
        /// <seealso cref="HoldRequestReplyData"/>
        /// <seealso cref="HoldRequestResult"/>
        public HoldRequestReplyData staff_HoldRequestReply(HoldRequestResult holdRequest, int requestingOrgID, int answer,
                                                           int state)
        {
            var doc = new XDocument(
                new XElement("HoldRequestReplyData",
                             new XElement("TxnGroupQualifier", holdRequest.TxnGroupQualifier),
                             new XElement("TxnQualifier", holdRequest.TxnQualifier),
                             new XElement("RequestingOrgID", requestingOrgID),
                             new XElement("Answer", answer),
                             new XElement("State", state)
                             )
                );

            var request = new RestRequest(string.Format("public/v1/1033/100/1/holdrequest/{0}", holdRequest.RequestGUID),
                                          Method.PUT);

            request.AddParameter("text/xml", doc.ToString(), ParameterType.RequestBody);

            _client.Authenticator = new PolarisProtectedAuthenticator(ApiUser, ApiKey, token);
            return(Execute <HoldRequestReplyData>(request));
        }