cancel
Showing results for 
Search instead for 
Did you mean: 

Serious bug on authorize.net C# api.

Using reflector I see the following code on authorize.net api: 

 public string AddCreditCard(string profileID, string cardNumber, int expirationMonth, int expirationYear, string cardCode, Address billToAddress)
        {
            DateTime time = DateTime.Parse(expirationMonth.ToString() + "-1-" + expirationYear.ToString());
            DateTime time3 = new DateTime(time.Year, time.Month, 1);
            DateTime time2 = time3.AddMonths(1).AddDays(-1.0);
            string str = time2.ToString("yyyy-MM");

 What hapens is that if the api is running on a machine with culture any other than en-us, the string parse game for the dates will fail. This is a very amatour way of processing card data and all developers should be aware of that.

israellot
Member
1 REPLY 1

Good catch. But FYI, you can download the C# SDKs source. There are two different zip. Left is the source. Right is the dll.

They should have just use the consturctor

DateTime Constructor (Int32 year, Int32 month, Int32 day)

RaynorC1emen7
Expert