Search code examples
phppayment-gatewaypaymentauthorize.netauthorize.net-cim

How to get customer profile using CIM in Authorize.Net?


I am working of CIM (Customer information manager) and i have created customer profile using CIM function. But i want to get customer profile using customer id instead of customer profile id.

 $cim = new AuthnetCIM('***MASKED***', '***MASKED***', AuthnetCIM::USE_DEVELOPMENT_SERVER);
 $cim->setParameter('email', '[email protected]');
 $cim->setParameter('description', 'Profile for Joe Smith'); // Optional
 $cim->setParameter('merchantCustomerId', '7789812');

 //create profile function 
 $ss=$cim->createCustomerProfile();

 //and get profile by..
 $profile_id = $cim->getProfileID();

Solution

  • You can't. You can only get the profile using the profile ID. This means you'll want to store that ID in your database and associate it with the customer's record so whenever you need to get their profile you know what their Profile ID is.