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

syntax error, unexpected 'use' (T_USE) #71

Closed WebWars closed 7 years ago

WebWars commented 7 years ago

I am using sample code from here https://developer.authorize.net/api/reference/index.html#payment-transactions-authorize-a-credit-card. I am using https://github.com/AuthorizeNet/sdk-php/releases and require 'path/to/anet_php_sdk/autoload.php'; since I am not using composer. and I get syntax error, unexpected 'use' (T_USE). on these two lines use net\authorize\api\contract\v1 as AnetAPI; use net\authorize\api\controller as AnetController;

ashtru commented 7 years ago

Composer is required for generating the vendor folder. After which, you are free to use the custom autoloader. One way can be to run the composer update in another system, and copy the vendor folder from there into your code environment. Please respond if this can work for you.

adavidw commented 7 years ago

Since there hasn't been an update, I'm going to close this issue. If you have more information to provide related to this issue, feel free to reopen it.

idextrus commented 4 years ago

WebWars, did you resolve this? I am running into the same issue and am looking for a resolution. Thanks!

WebWars commented 4 years ago

WebWars, did you resolve this? I am running into the same issue and am looking for a resolution. Thanks!

I don't even remember! I probably transfered the site locally on xamp and installed composer and then reuplaoded back on the server. I hope this helps

idextrus commented 4 years ago

and the you loaded the SDK via: require 'vendor/autoload.php';?

WebWars commented 4 years ago

Probably yes!