in sdk/SdkSamples/Invoice/GetEstimatesLinks.cs [28:65]
protected override void RunScenario()
{
var partnerOperations = this.Context.UserPartnerOperations;
string selectedCurencyCode = this.Context.Configuration.Scenario.DefaultCurrencyCode;
if (string.IsNullOrWhiteSpace(selectedCurencyCode))
{
// prompt the user the enter the currency code
selectedCurencyCode = this.Context.ConsoleHelper.ReadNonEmptyString("Please enter 3 digit currency code to retrieve the estimates links ", "The currency code can't be empty");
}
else
{
Console.WriteLine("Found Currency code: {0} in configuration.", selectedCurencyCode);
}
// Retrieving estimates links
this.Context.ConsoleHelper.StartProgress("Retrieving estimates links");
var estimatesLinks = partnerOperations.Invoices.Estimates.Links.ByCurrency(selectedCurencyCode).Get();
if (estimatesLinks != null && estimatesLinks.Items != null)
{
this.Context.ConsoleHelper.WriteObject(estimatesLinks, "Estimates links");
foreach (var estimateLink in estimatesLinks.Items)
{
Console.Out.WriteLine("\t--------------------------------------------------------------------------------------------");
Console.Out.WriteLine(" \tBilling Provider: {0}", estimateLink.Title);
Console.Out.WriteLine(" \tDescription: {0}", estimateLink.Description);
Console.Out.WriteLine(" \tPeriod: {0}", estimateLink.Period);
Console.Out.WriteLine(" \tUri: {0}", estimateLink.Link.Uri);
}
}
else
{
Console.Out.WriteLine("\tNo estimate links found.");
}
this.Context.ConsoleHelper.StopProgress();
}