cancel
Showing results for 
Search instead for 
Did you mean: 

Class GetHostedPaymentPageRequest not found

I'm attempting to integrate a hosted payment page using Authorize.Net

 

I have successfully installed the SDK using Composer (including dependencies) and got the Hello World example working.

 

However, when trying to create a hosted payment page using the sample code provided, I get the following error:

 

PHP Fatal error: Class 'net\authorize\api\contract\v1\GetHostedPaymentPageRequest' not found

 

I'm guessing this is some namespace issue, but I can't trace it. Changing the class name key as per this issue on GitHib seems to have no effect.

 

Thanks!

mistertaylor
Member
4 REPLIES 4

Have you tried any other methods? If you get errors on all of those, it must be an SDK installation issue. What version of the SDK is installed?

Aaron
All Star

Thanks Aaron, but rate of attrition for this was too high - from getting Composer to install on Windows Server, to getting it to correctly install the proper version of all the dependencies to trying to fix an error on every line of the "Hello World" example, I've wasted too much time on this (literally days). I've ended up dropping the SDK and writing my own functions.

 

Thanks again.

Would like to revive this, as I'm receiving the same error and it makes no sense why...  Also spent a day on this so far.

 

All other classes seem to work fine.  I have tried the sample get-an-accept-payment-page.php from github as well as the full sample App... pretty frustrating.  

Something to try:

 

If you've installed the SDK first, and are just trying indivdual sample files, you may need to edit the path inside the sample file to point to the right autoload file, the one in the SDK.

 

The way the sample code repo is packaged, we assume you would clone the whole repo, then run

composer update 

from the root level of the repo. That will install a copy of the SDK in a vendor directory inside the sample code repo. Then, you'd run individual samples from the root of the repo with a command like

php PaymentTransactions/get-an-accept-payment-page.php

If you haven't already, you may want to try this sequence of installation of the sample code repo and see if you get any different results.

 

 

If you've just installed the SDK, and then downloaded an individual sample, that should still work fine, but you may need to update the "require" command in the second line of the sample file to make sure it points to the autoload.php that's in the "vendor" folder within the SDK installation.

 

Other than that, any more information you can provide? PHP version? OS? how you installed the SDK? etc?