cancel
Showing results for 
Search instead for 
Did you mean: 

Problem to create profile and getting message "credit card number is required"

We don't know the reason for failure in creating payment profiles. If creating Payment profile fails then it also fails at the time of transaction and throws the exception "credit card number is required".  This problem is only for our one client, because we have implemented same code for many clients. Please suggest.

 

Code for creating profile:

 

 

AnetApi.Schema.createCustomerProfileRequest request = new AnetApi.Schema.createCustomerProfileRequest();

PopulateMerchantAuthentication((AnetApi.Schema.ANetApiRequest)request);

 

AnetApi.Schema.customerProfileType[] m_new_cust = new AnetApi.Schema.customerProfileType[1];


m_new_cust[0] = new AnetApi.Schema.customerProfileType();
m_new_cust[0].email = dsProfile.Tables[0].Rows[0]["Email_id1"].ToString();

        

request.profile = m_new_cust[0];

request.validationMode = validationModeEnum.liveMode;

System.Xml.XmlDocument response_xml = null;
bool bResult = XmlAPIUtilities.PostRequest(request, out response_xml);
object response = null;
AnetApi.Schema.createCustomerProfileResponse api_response = null;

if (bResult) bResult = XmlAPIUtilities.ProcessXmlResponse(response_xml, out response);

if (!(response is AnetApi.Schema.createCustomerProfileResponse))
{
       return out_id;
}
if (bResult) api_response = (AnetApi.Schema.createCustomerProfileResponse)response;

out_id = Convert.ToInt64(api_response.customerProfileId);

1 REPLY 1

The problem is likely not in the section of code you pasted, but rather in the interface that actually collects the number. Maybe you're referencing the wrong field? Have you tried printing out the number just before it gets submitted to Authorize.net to make sure it's actually there?

TJPride
Expert