/// <summary> /// Get an authentication usind id /// </summary> /// <param name="auth">Authentications</param> /// <returns>Authentications</returns> public Authentications Get(Authentications authentications, bool includeEnrollment = false) { authentications.SetRequiredFields(new List <string> { GlobalConstants.Id }); authentications.CheckRequiredFields(); Dictionary <string, string> queryStr = new Dictionary <string, string>(); StringBuilder toInclude = new StringBuilder(); if (includeEnrollment) { toInclude.Append("enrollmentchecks"); } queryStr.Add("fields", toInclude.ToString()); Request request = new Request( uri: PrepareUri("/accounts/" + _client.Account() + "/authentications/" + authentications.Id()), queryString: queryStr ); dynamic response = _client.ProcessRequest(request); return(new Authentications(response)); }
private Request SubmitInternal(Authentications authentications) { authentications.SetRequiredFields(new List <string> { GlobalConstants.MerchantRefNum, GlobalConstants.PaResp, }); authentications.CheckRequiredFields(); return(new Request( method: RequestType.Post, uri: PrepareUri("/accounts/" + _client.Account() + "/enrollmentchecks/" + authentications.EnrollmentId() + "/authentications"), body: authentications )); }
/// <summary> /// Submit an authentications request /// </summary> /// <param name="Authentications">Authentications</param> /// <returns>Authentications</returns> public Authentications Submit(Authentications authentications) { authentications.SetRequiredFields(new List <string> { GlobalConstants.MerchantRefNum, GlobalConstants.PaResp, }); authentications.CheckRequiredFields(); Request request = new Request( method: RequestType.Post, uri: PrepareUri("/accounts/" + _client.Account() + "/enrollmentchecks/" + authentications.EnrollmentId() + "/authentications"), body: authentications ); dynamic response = _client.ProcessRequest(request); return(new Authentications(response)); }
private Request GetInternal(Authentications authentications, bool includeEnrollment) { authentications.SetRequiredFields(new List <string> { GlobalConstants.Id }); authentications.CheckRequiredFields(); Dictionary <string, string> queryStr = new Dictionary <string, string>(); StringBuilder toInclude = new StringBuilder(); if (includeEnrollment) { toInclude.Append("enrollmentchecks"); } queryStr.Add("fields", toInclude.ToString()); return(new Request( uri: PrepareUri("/accounts/" + _client.Account() + "/authentications/" + authentications.Id()), queryString: queryStr )); }