我正在尝试将Omnipay Paypal软件包与我的Laravel 4.1应用程序集成。 我按照Omnipay的建议安装了laravel-omnipay软件包 ,并按照如何设置它的说明进行操作。
我已经将laravel-omnipay包添加到了laravel的app.php文件中的providers数组和aliases数组中。 配置文件也已创建。
我的composer.json有以下要求:
"ignited/laravel-omnipay": "1.*", "omnipay/paypal": "~2.0"而ignited / laravel-omnipay的配置文件如下所示:
<?php return array( // The default gateway to use 'default' => 'paypal', // Add in each gateway here 'gateways' => array( 'paypal' => array( 'driver' => 'Paypal_Express', 'options' => array( 'solutionType' => '', 'landingPage' => '', 'headerImageUrl' => '' ) ) ) );但是当我打电话给$gateway = Omnipay::gateway('paypal'); 我收到了错误
未找到“\ Omnipay \ Paypal \ ExpressGateway”类
有什么我忘记了吗? :一世
I'm trying to integrate the Omnipay Paypal package with my Laravel 4.1 application. I've installed the laravel-omnipay package, as suggested by Omnipay, and followed the instructions on how to set it up.
I've added the laravel-omnipay package to both the providers array and the aliases array in the app.php file of Laravel. The config file has also been created.
My composer.json has the following requirements:
"ignited/laravel-omnipay": "1.*", "omnipay/paypal": "~2.0"and the config file of ignited/laravel-omnipay looks like this:
<?php return array( // The default gateway to use 'default' => 'paypal', // Add in each gateway here 'gateways' => array( 'paypal' => array( 'driver' => 'Paypal_Express', 'options' => array( 'solutionType' => '', 'landingPage' => '', 'headerImageUrl' => '' ) ) ) );But when I call $gateway = Omnipay::gateway('paypal'); I'm getting the error
Class '\Omnipay\Paypal\ExpressGateway' not found"
Is there something I'm forgetting? :I
最满意答案
我并不熟悉ignited/laravel-omnipay ,所以这可能是也可能不是问题,但你可能会尝试在这一行上修复大小写:
'driver' => 'PayPal_Express',(请注意,PayPal有两个大写P')。
通常,类名在PHP中不区分大小写,但如果您使用区分大小写的文件系统,则composer autoloader将无法找到正确的类。
I'm not familiar with ignited/laravel-omnipay specifically, so this may or may not be the problem, but you might try fixing the capitalisation on this line:
'driver' => 'PayPal_Express',(note that PayPal has two capital P's).
Generally class names are not case sensitive in PHP, but if you are using a case-sensitive filesystem, then the composer autoloader will not be able to find the right class.
更多推荐
发布评论