Hello,
I've got the SDK installed via Composer and here is the path:
/anet_php_sdk/vendor/autoload.php
I'm loading it like this:
require $_SERVER["DOCUMENT_ROOT"].'/anet_php_sdk/vendor/autoload.php';
There are no load errors and I checked by changing "vendor" to "vendors" and it gave an error.
So now I'm trying to set the API credentials as per https://github.com/AuthorizeNet/sdk-php like so:
use net\authorize\api\contract\v1 as AnetAPI;
but when I test the page I get this:
Parse error: syntax error, unexpected 'use' (T_USE) in /path/to/file/file.php on line 209
Any thoughts are greatly appreciated.
Chris
03-23-2020 09:52 AM
All, I have solved this. For anyone else who may encounter this issue, the "use" code cannot be inside a function, it needs to be available globally.
03-23-2020 10:23 AM