I am getting the following exception when trying to run sample PHP charge-credit-card.php code.
Not sure what's going on. What this error is about?
Here is the screenshot of error.
https://www.screencast.com/t/cTU6gglqQS
Here is the code which I am using.
Solved! Go to Solution.
07-26-2017 10:07 AM
It appears that newer versions of Doctrine Annotations are using a void return type that wasn't introduced until PHP 7.1, thus causing that error.
Our SDK has dependencies that in turn are using doctrine as a dependency. One of dependencies should have instructions in the composer.json to not install this newer version of doctrine on php < 7.1. I don't know if the dependency we use doesn't have that in its composer.json, or if something failed when composer was installing on your machine. Either way, you ended up with PHP 7.0 and Doctrine/Annotations 1.5.0, and that's not going to work.
You can probably fix this either by upgrading PHP to 7.1, or downgrading doctrine/annotations to a 1.4.x version.
We could prevent this in the future by explictly declaring doctrine/annotations as a dependency in our own composer.json and locking to the preferred version, but we'd rather focus our efforts on getting rid of all dependencies.
08-03-2017 11:00 AM
Hello @khurramshahzad
When you added the Authorize.Net PHP SDK to your project, did you run a composer update?
Richard
07-26-2017 06:44 PM - edited 07-26-2017 06:44 PM
07-27-2017 09:10 AM
Could you run
composer show
in your project and post the output here?
07-31-2017 10:40 AM
08-01-2017 03:15 PM
Thanks. And what's your PHP version?
08-01-2017 04:03 PM
I am running PHP 7.0.12
08-02-2017 02:53 PM
It appears that newer versions of Doctrine Annotations are using a void return type that wasn't introduced until PHP 7.1, thus causing that error.
Our SDK has dependencies that in turn are using doctrine as a dependency. One of dependencies should have instructions in the composer.json to not install this newer version of doctrine on php < 7.1. I don't know if the dependency we use doesn't have that in its composer.json, or if something failed when composer was installing on your machine. Either way, you ended up with PHP 7.0 and Doctrine/Annotations 1.5.0, and that's not going to work.
You can probably fix this either by upgrading PHP to 7.1, or downgrading doctrine/annotations to a 1.4.x version.
We could prevent this in the future by explictly declaring doctrine/annotations as a dependency in our own composer.json and locking to the preferred version, but we'd rather focus our efforts on getting rid of all dependencies.
08-03-2017 11:00 AM
Upgrading my PHP worked.
Thank you so much Aaron.
08-07-2017 04:27 PM