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

"getTransactionResponse" not a function in \net\authorize\api\contract\v1\AnetApiResponseType

Open ghost opened this issue 5 years ago • 3 comments

I am following the sample code verbatim, I can make requests which work, however I cannot get the transaction response.

Here is the execution of the request

    $controller = new AnetController\CreateTransactionController($request);
    $response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX);

Note now $response is type \net\authorize\api\contract\v1\AnetApiResponseType because executeWithApiResponse function returns this type

Now after getting the message and verifying its "OK" I try to parse the transaction response:

$tresponse = $response->getTransactionResponse();

Undefined method 'getTransactionResponse'

Looking into the AnetApiResponseType type, there is no function for getTransactionResponse. It would seem that executeWithApiResponse is returning the wrong type.

ghost avatar Dec 01 '20 18:12 ghost

Facing the same issue, any solution?

mainakDev avatar Jul 09 '21 21:07 mainakDev

Facing the same issue, any solution?

arifktk32 avatar Oct 21 '22 07:10 arifktk32

@arifktk32 the solution is to not use this library. I used Stripe instead.

ghost avatar Oct 21 '22 14:10 ghost