cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the duplicate ID from a E00039 error

When we are calling CreateCustomerPaymentProfile and CreateCustomerShippingAddress we occasionally get an ‘E00039’ for a duplicate record.

 

When this occurs the customerPaymentProfileId and customerAddressId are set to 0 in the response.  Is there any way to get the record ids with the duplicate information? 

 

This would make the workflow much easier if there was a way to get that information. Thanks in advance for the help.

todd123
Member
5 REPLIES 5

Hello @todd123 

 

We actually have this request on our enhancement list, but I don't have any specific time line for delivery. 

I'd recommend subscribing to this topic so that you'll be alerted via email if there are updates. To subscribe, click Topic Options at the top of this thread and then select Subscribe. You'll then receive an email once anyone replies to your post.

Thanks,

Richard

RichardH
Administrator Administrator
Administrator

In C#, I do this:

 

catch (InvalidOperationException ex)
{
Match findCustomerId = Regex.Match(ex.Message, @"\b\d+\b");
if (findCustomerId.Success)
{
// return the existing customer
outCustomer = GetCustomer(findCustomerId.Value);
}
}

dgw2jr
Member

I should point out that folks have been asking for this since 2009, so I wouldn't recommend waiting on Authorize.Net to change its behavior anytime soon.

 

http://community.developer.authorize.net/t5/Integration-and-Testing/CIM-createCustomerPaymentProfile...

 

We worked around it by looping through the profile and attempting to find the duplicate based on CC last 4, first name, last name, address, and zip. Another option is to just create a new "customer" profile for each transaction.

npiasecki
Regular Contributor

I submitted a pull request on github after implementing my own method and it was accepted. So hopefully they will release it soon.

This has been fixed now. 

Here is a sample code how to tackle duplicate and get that information from response,

if (response != null && response.messages.message[0].code == "E00039") //E00039 - Duplicate payment profile
{
var msg = "Error: " + response.messages.message[0].code + " " +
response.messages.message[0].text;
LogHelper.Error(msg);
if (customerPaymentProfile.PaymentProfileId == null &&
customerPaymentProfile.CustomerProfileId == null)
{
//Too bad, ideally this won't happen, this is just a safety check. Log and throw error...
}
else
{
//Original Payment profile details received
customerPaymentProfile.PaymentProfileId = response.customerPaymentProfileId; //Original
customerPaymentProfile.CustomerProfileId = response.customerProfileId;

}

}

 

dhanuka123
Member