0

I'm trying to use the PHP-SDK and I just can't get it to work. I'm not familiar with the use and namespace statements in PHP and I'm trying to understand it.

{
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "payone/php-sdk",
                "version": "1.0.0",
                "dist": {
                    "url": "http://github.com/PAYONE/PHP-SDK/archive/master.zip",
                    "type": "zip"
                },
                "autoload": {
                    "psr-0": { "Payone_": "php/" }
                }
            }
        }
    ],
    "require": {
        "payone/php-sdk": "1.0.*"
    }
}

As far as I understand this tries to load the Autoload.php in my payone/php-sdk/php folder with the class prefix Payone_. This seems fine to me but I can't use $builder = new Payone_Builder(); in my controller now. What am I doing wrong?

Simon H
  • 2,495
  • 4
  • 30
  • 38
Evo_x
  • 2,997
  • 5
  • 24
  • 40

2 Answers2

2

You need to add the use statement to your controller.

use Payone_Builder;
rpg600
  • 2,800
  • 18
  • 24
0

as per 2015/03 new zip url

{
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "payone/php-sdk",
                "version": "1.0.0",
                "dist": {
                    "url": "http://www.payone.de/uploads/media/php-sdk.zip",
                    "type": "zip"
                },
                "autoload": {
                    "psr-0": {"Payone_": "php/"}
                }
            }
        }
    ]
}
Daniel Espendiller
  • 1,242
  • 10
  • 8