Changing a notify string

This commit is contained in:
Rick Falkvinge
2015-10-11 16:45:47 +02:00
parent 067a0121a2
commit 96dae35044
3 changed files with 10 additions and 5 deletions
+7 -2
View File
@@ -533,17 +533,22 @@ namespace Swarmops.Logic.Financial
primaryStrings[NotificationString.CurrencyCode] = organization.Currency.Code;
primaryStrings[NotificationString.OrganizationName] = organization.Name;
NotificationCustomStrings secondaryStrings = new NotificationCustomStrings();
Int64 satoshisAvailable = HotBitcoinAddresses.ForOrganization (organization).BalanceSatoshisTotal;
secondaryStrings["AmountMissingMicrocoinsFloat"] =
((satoshisAvailable - satoshisTotal)/100.0).ToString ("N2");
if (organization.Currency.IsBitcoin)
{
secondaryStrings["AmountNeededFloat"] = (satoshisTotal/100.0).ToString ("N2");
secondaryStrings["AmountWalletFloat"] = (HotBitcoinAddresses.ForOrganization(organization).BalanceSatoshisTotal/100.0).ToString ("N2");
secondaryStrings["AmountWalletFloat"] = (satoshisAvailable/100.0).ToString ("N2");
}
else
{
secondaryStrings["AmountNeededFloat"] =
(new Money (satoshisTotal, Currency.Bitcoin).ToCurrency (organization.Currency).Cents/100.0).ToString ("N2");
secondaryStrings["AmountWalletFloat"] =
(new Money (HotBitcoinAddresses.ForOrganization (organization).BalanceSatoshisTotal, Currency.Bitcoin).ToCurrency (organization.Currency).Cents/100.0).ToString ("N2");
(new Money (satoshisAvailable, Currency.Bitcoin).ToCurrency (organization.Currency).Cents/100.0).ToString ("N2");
// convert to org native currency
}
@@ -81,9 +81,9 @@ namespace Swarmops.Logic.Resources {
/// <summary>
/// Looks up a localized string similar to Swarmops is trying to make payments of [CurrencyCode] [AmountNeededFloat], but only [CurrencyCode] [AmountWalletFloat] is available in the bitcoin hotwallet. Swarmops is unable to make further payments at this time.
///
///Please top up the hotwallet immediately to at least the needed amount.
///Please top up the hotwallet IMMEDIATELY to at least the needed amount - an additional [AmountMissingMicrocoinsFloat] microbitcoin (&quot;bits&quot;) is required to resume financial hotwallet operations.
///
///Swarmops will keep trying and will keep sending these notifications as long as it has not succeeded..
///Swarmops will keep trying and will keep sending these notifications as long as it has not succeed [rest of string was truncated]&quot;;.
/// </summary>
internal static string Bitcoin_Shortage_Critical_Body {
get {
@@ -158,7 +158,7 @@ If you did not set this payout address (it may be worth double checking the addr
<data name="Bitcoin_Shortage_Critical_Body" xml:space="preserve">
<value>Swarmops is trying to make payments of [CurrencyCode] [AmountNeededFloat], but only [CurrencyCode] [AmountWalletFloat] is available in the bitcoin hotwallet. Swarmops is unable to make further payments at this time.
Please top up the hotwallet immediately to at least the needed amount.
Please top up the hotwallet IMMEDIATELY to at least the needed amount - an additional [AmountMissingMicrocoinsFloat] microbitcoin ("bits") is required to resume financial hotwallet operations.
Swarmops will keep trying and will keep sending these notifications as long as it has not succeeded.</value>
</data>