diff --git a/TinkerSrc/Lib/ShareLib.cs b/TinkerSrc/Lib/ShareLib.cs index 6badcdc..6951af0 100644 --- a/TinkerSrc/Lib/ShareLib.cs +++ b/TinkerSrc/Lib/ShareLib.cs @@ -18,6 +18,8 @@ public static class ShareLib private const string OptionCallbackUrl = "url="; private const string OptionRecipient = "recipient="; + private const string PointerTypePhone = "PHONE_NUMBER"; + private static ApiEnvironmentType _environmentType = ApiEnvironmentType.SANDBOX; public static ApiEnvironmentType DetermineEnvironmentType(string[] args) @@ -179,11 +181,11 @@ public static void PrintUser(int id, string displayName) Console.Out.Write(Environment.NewLine + " User"); Console.Out.Write(@" - ┌────────────────┬─────────────────────────────────────────────────────── - │ ID │ " + id + @" - ├────────────────┼─────────────────────────────────────────────────────── - │ Username │ " + displayName + @" - └────────────────┴─────────────────────────────────────────────────────── + ┌───────────────────┬──────────────────────────────────────────────────── + │ ID │ " + id + @" + ├───────────────────┼──────────────────────────────────────────────────── + │ Username │ " + displayName + @" + └───────────────────┴──────────────────────────────────────────────────── "); } @@ -202,12 +204,12 @@ private static void PrintMonetaryAccountBank(MonetaryAccountBank monetaryAccount var pointerIban = BunqLib.GetPointerIbanFromMonetaryAccountBank(monetaryAccountBank); Console.Out.Write(@" - ┌────────────────┬─────────────────────────────────────────────────────── - │ ID │ " + monetaryAccountBank.Id + @" - ├────────────────┼─────────────────────────────────────────────────────── - │ Description │ " + monetaryAccountBank.Description + @" - ├────────────────┼─────────────────────────────────────────────────────── - │ IBAN │ " + pointerIban.Value); + ┌───────────────────┬──────────────────────────────────────────────────── + │ ID │ " + monetaryAccountBank.Id + @" + ├───────────────────┼──────────────────────────────────────────────────── + │ Description │ " + monetaryAccountBank.Description + @" + ├───────────────────┼──────────────────────────────────────────────────── + │ IBAN │ " + pointerIban.Value); if (monetaryAccountBank.Balance == null) { @@ -216,11 +218,11 @@ private static void PrintMonetaryAccountBank(MonetaryAccountBank monetaryAccount else { Console.Out.Write(@" - ├────────────────┼─────────────────────────────────────────────────────── - │ Balance │ " + monetaryAccountBank.Balance.Currency + " " + monetaryAccountBank.Balance.Value); + ├───────────────────┼──────────────────────────────────────────────────── + │ Balance │ " + monetaryAccountBank.Balance.Currency + " " + monetaryAccountBank.Balance.Value); } Console.Out.Write(@" - └────────────────┴─────────────────────────────────────────────────────── + └───────────────────┴──────────────────────────────────────────────────── "); } @@ -237,15 +239,15 @@ public static void PrintAllPayment(List allPayment) private static void PrintPayment(Payment payment) { Console.Out.Write(@" - ┌────────────────┬─────────────────────────────────────────────────────── - │ ID │ " + payment.Id + @" - ├────────────────┼─────────────────────────────────────────────────────── - │ Description │ " + payment.Description + @" - ├────────────────┼─────────────────────────────────────────────────────── - │ Amount │ " + payment.Amount.Currency + " " + payment.Amount.Value + @" - ├────────────────┼─────────────────────────────────────────────────────── - │ Recipient │ " + payment.CounterpartyAlias.LabelMonetaryAccount.DisplayName + @" - └────────────────┴─────────────────────────────────────────────────────── + ┌───────────────────┬──────────────────────────────────────────────────── + │ ID │ " + payment.Id + @" + ├───────────────────┼──────────────────────────────────────────────────── + │ Description │ " + payment.Description + @" + ├───────────────────┼──────────────────────────────────────────────────── + │ Amount │ " + payment.Amount.Currency + " " + payment.Amount.Value + @" + ├───────────────────┼──────────────────────────────────────────────────── + │ Recipient │ " + payment.CounterpartyAlias.LabelMonetaryAccount.DisplayName + @" + └───────────────────┴──────────────────────────────────────────────────── "); } @@ -262,17 +264,17 @@ public static void PrintAllRequest(List allRequest) public static void PrintRequest(RequestInquiry request) { Console.Out.Write(@" - ┌────────────────┬─────────────────────────────────────────────────────── - │ ID │ " + request.Id + @" - ├────────────────┼─────────────────────────────────────────────────────── - │ Description │ " + request.Description + @" - ├────────────────┼─────────────────────────────────────────────────────── - │ Status │ " + request.Status + @" - ├────────────────┼─────────────────────────────────────────────────────── - │ Amount │ " + request.AmountInquired.Currency + " " + request.AmountInquired.Value + @" - ├────────────────┼─────────────────────────────────────────────────────── - │ Recipient │ " + request.CounterpartyAlias.LabelMonetaryAccount.DisplayName + @" - └────────────────┴─────────────────────────────────────────────────────── + ┌───────────────────┬──────────────────────────────────────────────────── + │ ID │ " + request.Id + @" + ├───────────────────┼──────────────────────────────────────────────────── + │ Description │ " + request.Description + @" + ├───────────────────┼──────────────────────────────────────────────────── + │ Status │ " + request.Status + @" + ├───────────────────┼──────────────────────────────────────────────────── + │ Amount │ " + request.AmountInquired.Currency + " " + request.AmountInquired.Value + @" + ├───────────────────┼──────────────────────────────────────────────────── + │ Recipient │ " + request.CounterpartyAlias.LabelMonetaryAccount.DisplayName + @" + └───────────────────┴──────────────────────────────────────────────────── "); } @@ -293,17 +295,17 @@ private static void PrintCard(Card card, List allMonetaryAc var monetaryAccountDescription = monetaryAccountBank.Description ?? "account description"; Console.Out.Write(@" - ┌────────────────┬─────────────────────────────────────────────────────── - │ ID │ " + card.Id + @" - ├────────────────┼─────────────────────────────────────────────────────── - │ Type │ " + card.Type + @" - ├────────────────┼─────────────────────────────────────────────────────── - │ Name on Card │ " + card.NameOnCard + @" - ├────────────────┼─────────────────────────────────────────────────────── - │ Description │ " + cardDescription + @" - ├────────────────┼─────────────────────────────────────────────────────── - │ Linked Account │ " + monetaryAccountDescription + " " + card.LabelMonetaryAccountCurrent.LabelMonetaryAccount.Iban + @" - └────────────────┴───────────────────────────────────────────────────────"); + ┌───────────────────┬──────────────────────────────────────────────────── + │ ID │ " + card.Id + @" + ├───────────────────┼──────────────────────────────────────────────────── + │ Type │ " + card.Type + @" + ├───────────────────┼──────────────────────────────────────────────────── + │ Name on Card │ " + card.NameOnCard + @" + ├───────────────────┼──────────────────────────────────────────────────── + │ Description │ " + cardDescription + @" + ├───────────────────┼──────────────────────────────────────────────────── + │ Linked Account │ " + monetaryAccountDescription + " " + card.LabelMonetaryAccountCurrent.LabelMonetaryAccount.Iban + @" + └───────────────────┴────────────────────────────────────────────────────"); } public static void PrintAllUserAlias(IEnumerable allUserAlias) @@ -313,15 +315,23 @@ public static void PrintAllUserAlias(IEnumerable allUserAlias) foreach (var alias in allUserAlias) { Console.Out.Write(@" - ┌────────────────┬─────────────────────────────────────────────────────── - │ Value │ " + alias.Value + @" - ├────────────────┼─────────────────────────────────────────────────────── - │ Type │ " + alias.Type + @" - ├────────────────┼─────────────────────────────────────────────────────── - │ Login code │ 000000 - └────────────────┴───────────────────────────────────────────────────────" + ┌───────────────────┬──────────────────────────────────────────────────── + │ Value │ " + alias.Value + @" + ├───────────────────┼──────────────────────────────────────────────────── + │ Type │ " + alias.Type + ); + if (alias.Type.Equals(PointerTypePhone)) { + Console.Out.Write(@" + ├───────────────────┼──────────────────────────────────────────────────── + │ Confirmation code │ 123456" + ); + } + Console.Out.Write(@" + ├───────────────────┼──────────────────────────────────────────────────── + │ Login code │ 000000 + └───────────────────┴────────────────────────────────────────────────────" ); } } } -} \ No newline at end of file +}