public StripeClient(string apiKey, string apiVersion, string apiEndpoint)
{
ApiVersion = "v1";
ApiEndpoint = "https://api.stripe.com/";
ApiKey = apiKey;
// silverlight friendly way to get current version
var assembly = Assembly.GetExecutingAssembly();
AssemblyName assemblyName = new AssemblyName(assembly.FullName);
var version = assemblyName.Version;
_client = new RestClient();
_client.UserAgent = "stripe-dotnet/" + version;
_client.Authenticator = new StripeAuthenticator(apiKey);
_client.BaseUrl = new Uri(String.Format("{0}{1}", string.IsNullOrWhiteSpace(apiEndpoint) ? ApiEndpoint : apiEndpoint, ApiVersion));
if (apiVersion.HasValue())
_client.AddDefaultParameter("Stripe-Version", apiVersion, ParameterType.HttpHeader);
}