Payum / PayumServer

Payment processing microservice. Written in Symfony4
https://payum.forma-pro.com/
MIT License
114 stars 34 forks source link

Fix Fatal error: Call to a member function createConfig() on a non-object in ../Payum/PayumServer/vendor/payum/payum/src/Payum/Core/Bridge/Symfony/Form/Type/GatewayConfigType.php on line 64 #34

Closed Headd2k closed 8 years ago

Headd2k commented 9 years ago

i installed the payum server and the payum server ui on my windows machine today. after trying to setup a new payment gateway via the ui, i recieved the following error on the server side:

Fatal error: Call to a member function createConfig() on a non-object in ../Payum/PayumServer/vendor/payum/payum/src/Payum/Core/Bridge/Symfony/Form/Type/GatewayConfigType.php on line 64

after that, i tried to add the payment via the cli command provided in the docs, but got the same error.

then i noticed, that the travis ci build currently fails because of the same error.

after some debugging i found out, that there was some kind of refactoring in "src\Payum\Server\ServiceProvider.php"

when setting up the gateway factories (line 133) it adds the factories like this:

$factories['authorize_net_aim'] = 'payum.authorize_net_aim.gateway_factory';

but imho it should be added like this:

$factories['authorize_net_aim'] = $app['payum.authorize_net_aim.gateway_factory'];

ps: this is my very first issue on github. please be patient with me. :)

makasim commented 9 years ago

actually the first variant is supposed to work to. If you pass a service id the registry has to try to look for the service in the container. It is done at this line https://github.com/Payum/PayumSilexProvider/blob/master/src/Payum/Silex/PimpleAwareRegistry.php#L27

Does this change fixed the issue?

Headd2k commented 9 years ago

first of all: thanks for your quick reply! i really appreciate that.

i have the payum server installed via composer as mentioned in the readme:

composer create-project payum/payum-server --stability=dev

i double checked the command. it installs the payum server in the "payum-server" directory including all dependencies. your comment hints to the payum silex provider. this package is also installed via composer, but the file you're referring to is missing. it seems that the composer command above does not install the latest revision

 Installing payum/payum-server (dev-master 4c30788ffbdb1e6d51c0b3159a939a22956521
bb)
  - Installing payum/payum-server (dev-master master)
    Cloning master

Created project in D:\payum_temp2\payum-server
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.jso
n. You may be getting outdated dependencies. Run update to update them.
  - Installing doctrine/lexer (v1.0.1)
    Loading from cache
(...)
 - Installing payum/payum (dev-master c70973b)
   Cloning c70973b6cfdee3586b625dc9063aad7bfda58860

 - Installing payum/payum-silex-provider (dev-master 3c84726)
   Cloning 3c8472677bf406caa8f316229c074d2340369a0f

checking the message about the composer.lock file, is turned out, that there seems to be the "error" as the composer.lock refers to an older revision of the payum-silex-provider.

makasim commented 8 years ago

the latest master has to work