cancel
Showing results for 
Search instead for 
Did you mean: 

customer payment profiles in CIM method - PHP

Hi everyone,

 

I have a question about payment profile.

After the customer have a customerProfileId he can write a few payment profile(if he has more than one credit card).

How can i check if the customer payment profile has been created without knowing the payment profile id but i have the billing and credit card information?

 

I am sorry for my english

 

Thanks 

nCode
Member
1 ACCEPTED SOLUTION

Accepted Solutions

Once they're done editing their payment profiles, your page would refresh or forward to a new page or whatever, where there's a pulldown of their profiles, generated by retrieving their profile info and then populating the billing pulldown with the last 4 digits of each card and the shipping profile with the name, city, state (or whatever).

View solution in original post

5 REPLIES 5

You can use getCustomerProfileRequest to retrieve all their info, including the payment profiles. The credit card number will of course be masked, but it's unlikely that the customer will have two credit cards with the same last 4 digits, so it's pretty safe to assume that if there's a match it's the same card, and if there isn't then it isn't.

TJPride
Expert

Hi TJPride,

 

I will be more precise. Lets say customer brought a mobile phone from me, I will create for him 

a customerId(lets say id=1) and payment profile(lets say id=2 for the convenience). after this he suddenly

want to order another mobile phone but with the same billing and credit card information, how can i retrieve the payment profile id(in this case id=2) for later use in creating the transaction id?

 

 

You get back an ID when you create the profile. You would need to store the customer profile ID, and preferably billing profile ID as well if you're using regular CIM and not hosted CIM. But you can access the billing profile ID's using the customer profile ID and getCustomerProfile() if you had to.

 

$request = new AuthorizeNetCIM;
$response = $request->getCustomerProfile($customerProfileId);
print_r($response);    // Will show you the structure of what comes back

 

You are right, I forgot about the response.

 

I have another question, assuming the customer has at least two payment profiles. Now the customer want to buy a product with one of his payment profile, how can I check which one is it? Is it enough to check only the billing info + four last digits of the credit card to determine which payment id to use for this customer?

Once they're done editing their payment profiles, your page would refresh or forward to a new page or whatever, where there's a pulldown of their profiles, generated by retrieving their profile info and then populating the billing pulldown with the last 4 digits of each card and the shipping profile with the name, city, state (or whatever).