Skip to content

Commit e57220c

Browse files
authored
Merge pull request #143 from mwarzybok-sumoheavy/feature/SP-742
Version String - C#
2 parents a398aad + 6bccef8 commit e57220c

File tree

6 files changed

+22
-18
lines changed

6 files changed

+22
-18
lines changed

BitPay/AccessTokens.cs

+9-6
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,17 @@ public void AddToken(string facade, string token)
6969

7070
public virtual string GetAccessToken(string key)
7171
{
72-
if (!_data.ContainsKey(key))
73-
throw new TokenNotFoundException(key);
72+
if (_data.TryGetValue(key, out string? value))
73+
{
74+
if (value == null)
75+
{
76+
throw new TokenNotFoundException(key);
77+
}
7478

75-
var token = _data[key];
76-
if (token == null)
77-
throw new TokenNotFoundException(key);
79+
return value;
80+
}
7881

79-
return token;
82+
throw new TokenNotFoundException(key);
8083
}
8184

8285
/// <summary>

BitPay/BitPay.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
<PropertyGroup>
44
<!-- version numbers will be updated by build -->
5-
<AssemblyVersion>5.0.2.0</AssemblyVersion>
6-
<FileVersion>5.0.2</FileVersion>
7-
<VersionPrefix>5.0.2</VersionPrefix>
8-
<Version>5.0.2</Version>
5+
<AssemblyVersion>5.0.3.0</AssemblyVersion>
6+
<FileVersion>5.0.3</FileVersion>
7+
<VersionPrefix>5.0.3</VersionPrefix>
8+
<Version>5.0.3</Version>
99
<Authors>Antonio Buedo</Authors>
1010
<Company>BitPay Inc.</Company>
1111
<Owners>BitPay, Inc.</Owners>

BitPay/Config.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public static class Config
88
public const string TestUrl = "https://test.bitpay.com/";
99
public const string ProdUrl = "https://bitpay.com/";
1010
public const string BitPayApiVersion = "2.0.0";
11-
public const string BitPayPluginInfo = "BitPay_DotNet_Client_v5.0.0-beta1";
11+
public const string BitPayPluginInfo = "BitPay_DotNet_Client_v5.0.3";
1212
public const string BitPayApiFrame = "std";
1313
public const string BitPayApiFrameVersion = "1.0.0";
1414
}

BitPay/Models/Invoice/SupportedTransactionCurrencies.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ public SupportedTransactionCurrencies(Dictionary<string, SupportedTransactionCur
1717

1818
public SupportedTransactionCurrency? GetSupportedCurrency(string currency)
1919
{
20-
return !SupportedCurrencies.ContainsKey(currency) ? null : SupportedCurrencies[currency];
20+
if (SupportedCurrencies.TryGetValue(currency, out SupportedTransactionCurrency? value))
21+
{
22+
return value;
23+
}
24+
25+
return null;
2126
}
2227

2328
[Obsolete("Deprecated, use GetSupportedCurrency(\"BTC\") or directly SupportedCurrencies[\"BTC\"]")]

BitPay/Models/Payout/Payout.cs

+1-6
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,7 @@ public bool ShouldSerializeEffectiveDate()
258258
{
259259
return EffectiveDate != null;
260260
}
261-
262-
public bool ShouldSerializeIgnoreEmails()
263-
{
264-
return IgnoreEmails != null;
265-
}
266-
261+
267262
public bool ShouldSerializeGroupId()
268263
{
269264
return false;

BitPayUnitTest/ClientTest.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// All rights reserved.
33

44
using System.Net;
5+
using System.Net.Http;
56

67
using BitPay;
78
using BitPay.Clients;

0 commit comments

Comments
 (0)