cancel
Showing results for 
Search instead for 
Did you mean: 

Can't even get the stinkin' charge-credit-card.php to work

Yeah, I'm down to this last error. I've searched and searched and have turned up basically nothing. Here is the error:

 

Fatal error: Class 'Symfony\Component\Yaml\Yaml' not found in /home/content/90/9648490/html/ciro/authorize/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/YamlDriver.php on line 35

 

It's been really challenging to get this thing running (6 - 7,000 dependency files?).  ny help is much appreciated.

124cirodev
Member
4 REPLIES 4

Hello @124cirodev

It's been a while since this was first posted. I would recommend subscribing to this topic so that you'll be alerted via email if anyone from the community is able to respond with any comments. To subscribe, click Topic Options at the top of this thread and then select Subscribe. You'll then receive an email once anyone replies.

Thanks,

Richard

RichardH
Administrator Administrator
Administrator

I've just updated the readme with additional info on the serializer requirements.  We are working on an additional update that will remove the need to use this fork of JMS Serializer.

 

Also checkout https://github.com/AuthorizeNet/sample-code-php 

 

Thanks Brian

Hey 124cirodev,

 

I had problems similar to yours.

 

I download the SDK as a zip file from github, unzipped it, and uploaded the files to my server.

It didn't have the dependencies it needed.

 

I had never used composer and my server didn't have git installed.

I tried running "composer update" but, since I didn't have git, some files failed to clone.

I got several "Now trying to download from dist" messages.

 

Apparently, this didn't work correctly.

After trying to execute the "charge-credit-card.php" file, I got the same Yaml error you got:

 

> Fatal error: Class 'Symfony\Component\Yaml\Yaml' not found in .../vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/YamlDriver.php on line 35

 

 

What finally worked:

 

I installed git on my sever using yum:

> yum install git-all

 

I deleted everything from my directory and created only a "composer.json" file like the one in the readme file.

https://github.com/AuthorizeNet/sdk-php/blob/master/README.md

 

Then I ran "composer update" and everything went smoothly.

The "charge-credit-card.php" file now executes without errors.

It seems that my mistake was downloading the SDK without using composer and/or without git.

 

I agree the process is not intuitive to those unfamiliar with composer or git.

I hope my experience is helpful.

This is a pretty easy fix, apparently the development version of the JMS serializer doesn't include the require to Symphony YAML package.  Only part of the package probably uses it but it appears the authorize SDK uses the YAML package.

 

I added this line to my composer require:
"symfony/yaml": "3.1.*"

 

That should solve it.

 

skyb0sman
Member