public TerminationInquiry GetTerminationInquiry(TerminationInquiryHistoryOptions options) { string response = ""; Dictionary<string, string> responseMap = doRequest(GetURL(options), "GET", null); responseMap.TryGetValue(MESSAGE, out response); return Serializer<TerminationInquiry>.Deserialize(response); }
private string GetURL(TerminationInquiryHistoryOptions options) { String url; if (this.environment == Environments.Environment.PRODUCTION) { url = PRODUCTION_URL; } else { url = SANDBOX_URL; } url = url.Replace("XYZ", options.getInquiryReferenceNumber().ToString()); url = URLUtil.AddQueryParameter(url, "PageOffset", options.GetPageOffset().ToString(), false, ""); url = URLUtil.AddQueryParameter(url, "PageLength", options.GetPageLength().ToString(), false, ""); url = URLUtil.AddQueryParameter(url, "AcquirerId", options.GetAcquirerId().ToString(), false, ""); return url; }
public void TestService() { TerminationInquiry inquiry = service.GetTerminationInquiry( request, new TerminationInquiryRequestOptions(0, 10) ); Assert.AreEqual(true, inquiry.TerminatedMerchant.Count > 0); Assert.AreEqual(true, inquiry.Ref != null && inquiry.Ref.Length > 0); Assert.AreEqual(true, inquiry.TransactionReferenceNumber != null && inquiry.TransactionReferenceNumber.Length > 0); Assert.AreEqual(true, inquiry.GetReferenceId().Length > 0); TerminationInquiryHistoryOptions historyOptions = new TerminationInquiryHistoryOptions( 0, 10, 1996, long.Parse(inquiry.GetReferenceId()) ); TerminationInquiry terminationInquiry = historyService.GetTerminationInquiry(historyOptions); Assert.AreEqual(true, terminationInquiry.TerminatedMerchant != null); }