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

Magic ANetResponseType::getTransactionResponse method? #76

Closed alexsasharegan closed 7 years ago

alexsasharegan commented 7 years ago

I'm having a hard time following the sample SDK code for parsing responses. All the sample code uses this line after constructing a controller and executing a response:

<?php

$response  = $controller->executeWithApiResponse( 
  \net\authorize\api\constants\ANetEnvironment::SANDBOX
);
$tresponse = $response->getTransactionResponse();

The getTransactionResponse method does not exist in the method. I was expecting to see a __call() method that reflects the method name and accesses the corresponding property, or a class being extended where this method was present, but I didn't find anything.

Is there some php magic here that I'm missing? I would really love to know how this ticks. It's hard to use an SDK with methods that aren't enumerated in the code!

kikmak42 commented 7 years ago

getTransactionResponse() is part of the Authorize.Net PHP SDK. It's defined here in the php sdk.