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

code fails at: new AnetController\CreateTransactionController($request)

Open tstizzle opened this issue 9 years ago • 18 comments

same issue as has been reported by others. root cause is: "Parse error: syntax error, unexpected '[' in /vendor/jms/serializer/src/JMS/Serializer/Handler/DateHandler.php on line 44"

any ideas?

tstizzle avatar Jun 10 '17 18:06 tstizzle

Any more specific information you can provide? If this is already an open issue, can you post on the thread in that issue? If not, can you explain when exactly this happens? Can you provide a sample request that makes this happen? What shows up in the phplog file when this happens?

adavidw avatar Jun 12 '17 16:06 adavidw

I am having this issue as well. I am just running the Step 2 of the Hello World code from this page:

http://developer.authorize.net/hello_world/

All I changed was to add my authentication information. Based on commenting out blocks of code I found that the error occurs during the call to:

$controller = new AnetController\CreateTransactionController($request);

AndrewRees avatar Jul 04 '17 21:07 AndrewRees

Can you provide a sample request that makes this happen? What shows up in the phplog file when this happens?

adavidw avatar Jul 05 '17 02:07 adavidw

Like I said in my post, I am using the first example code from the Authorize.net hello world pages. I looked for the log file but did not see it on the server. Where should it show up?

On July 4, 2017 7:56:33 PM PDT, Aaron Wright [email protected] wrote:

Can you provide a sample request that makes this happen? What shows up in the phplog file when this happens?

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/AuthorizeNet/sdk-php/issues/232#issuecomment-312984748

-- Andrew Rees [email protected] http:\www.calderadev.com

AndrewRees avatar Jul 05 '17 03:07 AndrewRees

There should be a file called phplog in the same directory as the charge-credit-card.php file you created.

Which version of PHP are you using? Which version of the Authorize.Net SDK? (If you just installed it following the "hello world" directions, it would be the most recent, but if it was already installed on your system previously, we'll need to find out the version.)

adavidw avatar Jul 05 '17 03:07 adavidw

It is the latest version of the SDK. I pulled it from github yesterday. I will gather the rest of the information when I get back to the office.

On July 4, 2017 8:13:02 PM PDT, Aaron Wright [email protected] wrote:

there should be a file called phplog in the same directory as the charge-credit-card.php file you created?

Which version of PHP are you using? Which version of the Authorize.Net SDK? (If you just installed it following the "hello world" directions, it would be the most recent, but if it was already installed on your system previously, we'll need to find out the version.)

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/AuthorizeNet/sdk-php/issues/232#issuecomment-312986484

-- Andrew Rees [email protected] http:\www.calderadev.com

AndrewRees avatar Jul 05 '17 03:07 AndrewRees

I am tracking down a PHP version issue with the server company. The control panel reports the PHP version as 5.6, but phpinfo reports it as 5.3.29.

AndrewRees avatar Jul 05 '17 17:07 AndrewRees

Yikes! Do please get that straightened out. That version has a few security vulnerabilities that will never get patched because anything <5.6 is EOL. There's no way to be PCI compliant on any version <5.6

adavidw avatar Jul 05 '17 18:07 adavidw

Expecting the same issue, when trying to use your php-sdk. My php version is 5.6 System crashes at the logger initialisation part. Parse error: syntax error, unexpected ':', expecting ';' or '{' in /var/www/bridgetodata8/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php on line 95

Stack trace: image

anpolimus avatar Oct 23 '17 09:10 anpolimus

Code crashes at the imitialisation of Log object https://github.com/AuthorizeNet/sdk-php/blob/master/lib/net/authorize/util/LogFactory.php#L9

anpolimus avatar Oct 23 '17 09:10 anpolimus

If dig deeper your logger crashes at: https://github.com/AuthorizeNet/sdk-php/blob/master/lib/net/authorize/util/Log.php#L365 It could be general problem with my PHP env, but anyway would be thankfull for any help

anpolimus avatar Oct 23 '17 10:10 anpolimus

Problem was in Doctrine that has been rebuilt in php7 style and is crashing at the php <7. After upgrade to php7.1 this problem is gone

anpolimus avatar Oct 23 '17 17:10 anpolimus

Which Doctrine package had the problem and which version of that package do you have installed? I'm guessing it's a newer version that requires >7, but I'm wondering how it got there. The whole point of a system like composer is to make sure that the right dependencies get installed, and the right versions of each dependency. If the dependencies we require are in turn not specifying the right version of their dependencies, we'll have to override and require doctrine specifically to make sure the right versions get installed.

adavidw avatar Oct 23 '17 20:10 adavidw

this sdk has/had tremendous errors, primarily in its dependencies. as posted on github there is no way it will work. you have to track down all the missing/broken dependencies in composer. that's what finally worked for me. the authorize code was working, but the composer part is so poorly done this repo should be taken down.

tstizzle avatar Oct 23 '17 21:10 tstizzle

Hi @tstizzle, Can you give more info? The number of dependencies required by this repo was greatly reduced in the last release, but those dependencies still have their dependencies that need to be installed. In our testing that works fine, and it works fine for a lot of other people using this SDK. For the few cases where it doesn't work, we'd like to identify what's going on and fix it.

Instead of taking the repo down, we'd like to leave it up since it's a helpful resource for many, many people. We'd like to make it better, of course, but that's a lot harder to do if we take it down.

What do you mean by "as posted on github there is no way it will work"? Do you mean there's something in the readme or in one of the files that's wrong and preventing it from working? If so, please let us know where so we can fix it.

adavidw avatar Oct 23 '17 22:10 adavidw

hi @adavidw, i can't speak to the current version. in looking through the commits, it appears some work has been done. so hopefully the nested dependency issues have been resolved.

so, i have no specific info to provide, beyond dependency hunting as a suggestion to new users. i was commenting as a summary of the experience i encountered when i was required to do an implementation. at that time, i did not feel like there was anyone responsible for the repo attempting to build it. it was so obviously not buildable for a long time. i appreciate that you are working to improve it.

tstizzle avatar Oct 23 '17 22:10 tstizzle

@adavidw I had problems with the Instatinator component of the Doctrine. This component came from composer require "authorizenet/authorizenet"

anpolimus avatar Oct 23 '17 23:10 anpolimus

Closing this issue, as it is fixed in the latest version of the SDK. Also remember to include/require 'vendor/autoload.php' instead of 'autoload.php'

ashtru avatar Jul 16 '18 08:07 ashtru