getProfile() customer profile is undefined method
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
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 my GetCustomerPaymentProfileRequest is throwing an E00121 Error. I have opened another topic about it, maybe you could help? Thank you for your clarification.