cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

CIM createPaymentProfile expiration date invalid

Hi,

Im using asp.net MVC 4 and CIM api to store the details of credit card on authorize.net server. The expiration date to be entered by the user. i have a view from where user can enter the date but when i attempt to store it on authorize.net server i recive an error that a required value is missing. Below is the code that converts the date variable into string i debugged and checked the values are same in the date string.

 

DateTime year = Convert.ToDateTime(form["date"]);
            String.Format("{0:yyyy}",year);
            DateTime month = Convert.ToDateTime(form["date"]);
            String.Format("{0:mm}", month);
            String date = year.ToString("yyyy").Trim() + "-".Trim() + month.ToString("MM").Trim();
            
            CreditCardType new_card = new CreditCardType();
            new_card.cardNumber = form["cardno"];//"4111111111111111";
            new_card.expirationDate = date;// "2016-10"; 

 If i enter the commented string i can store the details but cant do it using the variable

nik_0811
Member
1 REPLY 1

used 

String date = year.ToString("yyyy-MM")

instead of converting and merging mannually. but still dint get the answer why it wasnt working previously.

 

 

 

nik_0811
Member