-
Notifications
You must be signed in to change notification settings - Fork 572
/
Copy pathStripeConfiguration.cs
executable file
·44 lines (36 loc) · 1.15 KB
/
StripeConfiguration.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Net.Http;
using System.Reflection;
using Stripe.Infrastructure;
namespace Stripe
{
public static class StripeConfiguration
{
public static string StripeApiVersion = "2017-12-14";
public static string StripeNetVersion { get; }
/// <summary>
/// This option allows you to provide your own HttpMessageHandler. Useful with Android/iPhone.
/// </summary>
public static HttpMessageHandler HttpMessageHandler { get; set; }
public static TimeSpan? HttpTimeSpan { get; set; }
private static string _apiKey;
static StripeConfiguration()
{
StripeNetVersion = new AssemblyName(typeof(Requestor).GetTypeInfo().Assembly.FullName).Version.ToString(3);
}
internal static string GetApiKey()
{
if (string.IsNullOrEmpty(_apiKey))
{
#if NET45
_apiKey = System.Configuration.ConfigurationManager.AppSettings["StripeApiKey"];
#endif
}
return _apiKey;
}
public static void SetApiKey(string newApiKey)
{
_apiKey = newApiKey;
}
}
}