I need to know if a payment profile exists for a customer, and create one if it does not. I do not know ahead of time if the customer profile exists.
Documentation on Duplicate Profile Verification states that a CIM customer profile is unique based on these fields:
merchantCustomerId
description
email
Unfortunately, it doesn't appear that the getCustomerProfileRequest API call accepts a description parameter, so if we somehow ended up with multiple profiles for the same merchantCustomerId & email (with a different description), a call to getCustomerProfileRequest returns "Multiple records found. Please refine search options." This leaves me unable to find the proper customerProfileId.
I can call createCustomerProfileRequest with the assumption that no profile exists, but if the customer profile already exists it will give me the profileId in an error message. While I could extract this profileId and use it to add a new payment profile, I just used the nonce in the call to createCustomerProfileRequest, so it is no longer valid and I no longer have the payment information.
- Is there a way to call getCustomerProfileRequest using the description to ensure I get a result?
- If not, would a best practice be to call createCustomerProfileRequest without the opaqueData nonce, saving it for the subsequent call to createCustomerPaymentProfileRequest?
Any insight is appreciated. Thank you!
02-15-2019 01:53 PM