sdk-php icon indicating copy to clipboard operation
sdk-php copied to clipboard

getProfile() customer profile is undefined method

Open BenGeocth opened this issue 9 years ago • 2 comments

I am setting up a way for customers to save their payment information with Authorize.

Saving it was easy, but retrieving it was not: I cannot get the information. Here is a piece of code:

$c = new AnetController\GetCustomerPaymentProfileController($request);
		$response = $c -> executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX);
$profile = $response -> getProfile();

This returns the error: Fatal error: Call to undefined method net\authorize\api\contract\v1\GetCustomerPaymentProfileResponse::getProfile() in C:\xampp\htdocs\phplod\bids\profile.php on line 72 (line 72 is the line that says getProfile()

Thanks for any help, -Alan

BenGeocth avatar Dec 06 '16 17:12 BenGeocth

To get the details of customer payment profile, you need to use getPaymentProfile() instead of getProfile() on the GetCustomerPaymentProfile response object.

Please refer to the get customer payment profile sample code.

On the other hand, if you want all the details of a customer profile, you can make a call to GetCustomerProfile API as shown in this sample code.

akankaria avatar Dec 07 '16 06:12 akankaria

@akankaria my GetCustomerPaymentProfileRequest is throwing an E00121 Error. I have opened another topic about it, maybe you could help? Thank you for your clarification.

BenGeocth avatar Dec 08 '16 01:12 BenGeocth