cancel
Showing results for 
Search instead for 
Did you mean: 

CIM: Duplicate Payment Profile

In migrating legacy card data over to CIM, I'm running into issues with CIM not creating a payment profile because it says it's a duplicate.

 

Is there a way to determine for sure which profile ID that it's a duplicate of? Assuming I'm going to have to merge legacy records on my end (which I'd rather not do), I don't want to just go off the fact that they have the same last four digits or something...

 

And is there any technical reason why we'd want to avoid creating new customer profiles for each card to go under for the legacy data, to get around this? So instead of one customer profile with, say, three payment profiles assigned to it, have three customer profiles, each with one payment profile?

 

We're not using customer profiles for anything beyond just needing them for the payment profile. Everything is handled through the internal applications, so no notifications, receipts, or anything would be going through authorize.net

kevinfairchild
Contributor
1 ACCEPTED SOLUTION

Accepted Solutions

The issue is within the same customer profile.

 

For our needs, I'm going to route others seem to have gone, and just assigning each card its own Customer Profile and Payment Profile.

 

Unlike with typical eCommerce solutions, we sometimes need to merge users together. And that isn't something supported by Authorize.Net, anyhow.

 

So we'll just handle the duplicate prevention on the front-end as best we can. If a duplicate card does get into the system, though, it's certainly not the end of the world.

View solution in original post

7 REPLIES 7

When you get CIM error E00039 (duplicate profile), it will also return the profile ID it's a match on, as part of the text response. I just look for that and parse it. My advice is to create a profile you know is in there already, then do a var dump (print_r() if using PHP) of the response and figure out how to deal with it from there. Shouldn't be very difficult.

TJPride
Expert

TJ, which text response are you referring to?

 

Out of the response.messages, I just get "A duplicate customer payment profile already exists", which isn't too helpful.

 

I also check the output of response.validationDirectResponse and am not seeing the ID within it (the one I know it should be a duplicate of).

 

I slightly tweaked the data on this for privacy, but here's what I'm getting from the DirectResponse:

 

"1,1,1,This transaction has been approved.,02187C,Y,4495431429,none,Test transaction for ValidateCustomerPaymentProfile.,0.00,CC,auth_only,none,JOHN,SMITH,,12345 W. SOMEWHERE ST.,TAMPA,FL,33629,US,,,email@example.com,none,none,none,none,none,none,none,none,0.00,0.00,0.00,FALSE,none,12DD14FE69BF922919E7FA6C27DD3725,S,,,,,,,,,,,,XXXX6824,Visa,,,,,,,,,,,,,,,,"

Don't know what you're doing, but here is a modified version of what I was using. Note that it's configured to use a developer account in live mode, which should give similar responses to a production account in live mode.

 

// Path to the SDK
require_once($_SERVER['DOCUMENT_ROOT'] . '/library/anet_php_sdk/AuthorizeNet.php'); // Create customer profile $customerProfile = new AuthorizeNetCustomer; $customerProfile->merchantCustomerId = $data['idn']; $customerProfile->email = $data['email']; $customerProfile->description = "{$data['c_first']} {$data['c_last']} in {$data['c_city']}, {$data['c_state']}"; // Add shipping address. if (!$data['ship_to_same']) { $address = new AuthorizeNetAddress; $address->firstName = $data['s_first']; $address->lastName = $data['s_last']; $address->address = $data['s_address']; $address->city = $data['s_city']; $address->state = $data['s_state']; $address->zip = $data['s_zip']; $address->country = 'USA'; $customerProfile->shipToList[] = $address; } // Process request $request = new AuthorizeNetCIM( $GLOBALS['_authorize_test_id'], $GLOBALS['_authorize_test_key']); $request->setSandbox(true); $response = $request->createCustomerProfile($customerProfile);
// Print out response if (!$response->isOk()) print_r($response);

 

Wait.... you're adding a Customer Profile or a Payment Profile...?  Perhaps it returns the duplicate ID for customer profiles but not payment profiles?  No clue.

 

In any case, I'm using the stuff based off the .NET SDK examples using the Authorize.Net webservice calls for CIM....

 

So it's building a new customer payment profile type, passing in the card number, formatted expiration date, and billing address and then calling:

 

Dim response As AuthDotNetCustomerProfileWS.CreateCustomerPaymentProfileResponseType = Service.CreateCustomerPaymentProfile(MerchantAuthentication, profile_id, new_payment_profile, AuthDotNetCustomerProfileWS.ValidationModeEnum.liveMode)

 

If it works, response.customerPaymentProfileId gets assigned a non-zero number.

 

If it doesn't all I have to go off of are the contents of response.messages() and response.validationDirectResponse

TJ,

 

According to the SOAP docs, the only two output of CreateCustomerPaymentProfileResult are:

 

• customerPaymentProfileId Value: Payment gateway assigned ID associated with the customer payment profile

Notes: This output is present only for successful requests.

 

• validationDirectResponse Value: Contains detailed information about the result of the transaction.
Notes: This output is present only if the ValidationMode input parameter is passed with a value of testMode or liveMode.

 

And that all comes back as a CreateCustomerPaymentProfileResponseType, which gives me access to the above two parameters as well as messages(), which gives the generic error text/code, and the resultCode.

Oh, hmm. I got mixed up and thought you were talking about regular profiles. On payment profiles, I don't know. You could go the hard route and cycle through all the profiles looking for a match on the last 4 digits of the card, or you could just skip it every time you get that error and move on. Are you getting that error on payment profile dupes between customer profiles, or inside the same customer profile?

The issue is within the same customer profile.

 

For our needs, I'm going to route others seem to have gone, and just assigning each card its own Customer Profile and Payment Profile.

 

Unlike with typical eCommerce solutions, we sometimes need to merge users together. And that isn't something supported by Authorize.Net, anyhow.

 

So we'll just handle the duplicate prevention on the front-end as best we can. If a duplicate card does get into the system, though, it's certainly not the end of the world.