/// <summary> /// Returns the access key for the account once they have granted access /// </summary> /// <param name="secretKey">Guid ID that was passed when requesting access</param> /// <returns></returns> public string FetchAccessToken(Guid secretKey) { var service = EbayServiceContext(ServiceCallType.FetchToken); var r = new FetchTokenRequest { RequesterCredentials = Properties.EbayCredentials }; var rt = new FetchTokenRequestType { Version = Properties.ServiceVersion, SecretID = secretKey.ToString() }; var res = service.FetchToken(ref r.RequesterCredentials, rt); if (res.Errors == null) { return(res.Ack != AckCodeType.Success ? string.Empty : res.Any.First().InnerText); } foreach (var e in res.Errors) { _logger.WriteToLog(e, EventLogEntryType.Error); } return(res.Ack != AckCodeType.Success ? string.Empty : res.Any.First().InnerText); }
/// <summary> /// Returns the access key for the account once they have granted access /// </summary> /// <param name="secretKey">Guid ID that was passed when requesting access</param> /// <returns></returns> public string FetchAccessToken(Guid secretKey) { var service = EbayServiceContext(ServiceCallType.FetchToken); var r = new FetchTokenRequest { RequesterCredentials = Properties.EbayCredentials }; var rt = new FetchTokenRequestType { Version = Properties.ServiceVersion, SecretID = secretKey.ToString() }; var res = service.FetchToken(ref r.RequesterCredentials, rt); if (res.Errors == null) return res.Ack != AckCodeType.Success ? string.Empty : res.Any.First().InnerText; foreach (var e in res.Errors) { _logger.WriteToLog(e, EventLogEntryType.Error); } return res.Ack != AckCodeType.Success ? string.Empty : res.Any.First().InnerText; }