AuthorizeNet / sample-code-php

This repository contains working code samples which demonstrate php integration with the Authorize.Net API
MIT License
176 stars 197 forks source link

Can I get customerPaymentProfileList by sorting customerId ? #66

Closed JoeHEZHAO closed 7 years ago

JoeHEZHAO commented 7 years ago

I have known that ,for now, I can only get customerPaymentProfileList by sorting the cardExpireDate. But I need to get all paymentProfileIDs for a certain customer, only using customerID.

Have contributors add more searchType such as customer_Id ?

Or is there another way to do it ?

Thanks He Zhao

ashtru commented 7 years ago

If you want all payment profiles for a given "merchantCustomerID", there is no such search option. But the GetCustomerProfile gives you all payment profiles for a customerProfileID. You just need to maintain the mapping from merchantCustomerId to customerProfileID for new customers.

Please, reply in case you have further queries.

JoeHEZHAO commented 7 years ago

Thanks for answering my questions.

I know GetCustomerProfile. Do you know how to get customerPaymentProfileId from the response of GetCustomerProfile ? I see though the api and found out there are three get methods: getPaymentProfiles(), getSubscriptionIds(), getProfile().

But unfortunately, only getProfile() return me back an object and customerPaymentProfileId are private in that object, which means I can not get access to.

I believe if I can get those paymentIDs, problem would solve.

Best he zhao

gnongsie commented 7 years ago

I believe GetCustomerProfileResponse.getProfile() returns an array of customer payment profile IDs which can be accessed as an array. To get the customerPaymentProfileId from an element of this array, you can use the method getCustomerPaymentProfileId().

gnongsie commented 7 years ago

Hi @JoeHEZHAO, was this information sufficient to answer your question? Kindly let us know if you are still facing issues regarding this.

-Gabriel

adavidw commented 7 years ago

Since there's no further response, I'll close this issue. Please reopen if there are any further questions.