public CustomerSummary GetCustomerSummary(string tenantUid, string origin, JwtCustomerDataResponseContent decodedJwt) { var response = (GetCustomerAccountBalanceResponseContent)GetAccountBalance(tenantUid, origin, decodedJwt.CustomerGuid.Value.ToString(), decodedJwt.EncodedToken); if (response.Success) { return(new CustomerSummary { CustomerGuid = decodedJwt.CustomerGuid.Value, CurrencyCode = decodedJwt.CurrencyCode, Balance = new Balance { CurrentBalance = DefaultAllowedValues.DecimalAccuracy(response.Payload.TotalAccountBalance, decodedJwt.CurrencyCode), Bonus = DefaultAllowedValues.DecimalAccuracy(response.Payload.BonusBalance, decodedJwt.CurrencyCode), Withdrawable = DefaultAllowedValues.DecimalAccuracy(response.Payload.WithdrawableBalance, decodedJwt.CurrencyCode), IsLiveBalance = true }, LanguageCode = decodedJwt.LanguageCode, OddsDisplayName = decodedJwt.OddsDisplay, TenantPlatformMapGuid = decodedJwt.TenantPlatformMapGuid, TimeZone = decodedJwt.TimeZone, Username = decodedJwt.Username }); } else { return new CustomerSummary { Username = decodedJwt.Username, CurrencyCode = decodedJwt.CurrencyCode, Balance = new Balance { Bonus = DefaultAllowedValues.DecimalAccuracy(0.00m, decodedJwt.CurrencyCode), CurrentBalance = DefaultAllowedValues.DecimalAccuracy(0.00m, decodedJwt.CurrencyCode), Withdrawable = DefaultAllowedValues.DecimalAccuracy(0.00m, decodedJwt.CurrencyCode), IsLiveBalance = false, BalanceRetrievalFailureMessage = response.Message, Errors = response.Errors }, LanguageCode = decodedJwt.LanguageCode, OddsDisplayName = decodedJwt.OddsDisplay, TimeZone = decodedJwt.TimeZone, TenantPlatformMapGuid = decodedJwt.TenantPlatformMapGuid, CustomerGuid = decodedJwt.CustomerGuid } }; }
public async Task <CustomerSummary> GetCustomerSummaryAsync(string tenantUid, string origin, JwtCustomerDataResponseContent decodedJwt) { var response = (GetCustomerAccountBalanceResponseContent) await GetAccountBalanceAsync(tenantUid, origin, decodedJwt.CustomerGuid.Value.ToString(), decodedJwt.EncodedToken); var payload = response.Payload; return(new CustomerSummary { CustomerGuid = decodedJwt.CustomerGuid.Value, CurrencyCode = decodedJwt.CurrencyCode, Balance = new Balance { CurrentBalance = payload != null?DefaultAllowedValues.DecimalAccuracy(payload.TotalAccountBalance, decodedJwt.CurrencyCode) : DefaultAllowedValues.DecimalAccuracy(0.00m, decodedJwt.CurrencyCode), Bonus = payload != null?DefaultAllowedValues.DecimalAccuracy(payload.BonusBalance, decodedJwt.CurrencyCode) : DefaultAllowedValues.DecimalAccuracy(0.00m, decodedJwt.CurrencyCode), Withdrawable = payload != null?DefaultAllowedValues.DecimalAccuracy(payload.WithdrawableBalance, decodedJwt.CurrencyCode) : DefaultAllowedValues.DecimalAccuracy(0.00m, decodedJwt.CurrencyCode), IsLiveBalance = response.Success }, LanguageCode = decodedJwt.LanguageCode, OddsDisplayName = decodedJwt.OddsDisplay, TenantPlatformMapGuid = decodedJwt.TenantPlatformMapGuid, TimeZone = decodedJwt.TimeZone, Username = decodedJwt.Username }); }