Integration and Testing

Authorize.Net API questions and help with your payment integration.

Reply
Member
Posts: 1
Registered: ‎07-08-2014

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.

Posts: 2,765
Topics: 57
Kudos: 270
Blog Posts: 67
Registered: ‎12-05-2011

Re: Getting the duplicate ID from a E00039 error

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

Member
Posts: 6
Registered: ‎07-08-2014

Re: Getting the duplicate ID from a E00039 error

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);
}
}

Regular Contributor
Posts: 55
Registered: ‎04-22-2011

Re: Getting the duplicate ID from a E00039 error

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.

Member
Posts: 6
Registered: ‎07-08-2014

Re: Getting the duplicate ID from a E00039 error

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

Member
Posts: 1
Registered: ‎01-28-2016

Re: Getting the duplicate ID from a E00039 error

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;

}

}