我正在尝试将 Omnipay Paypal 包与我的 Laravel 4.1 应用程序集成。我已经安装了 laravel-omnipay package ,按照 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');
时出现错误
Class '\Omnipay\Paypal\ExpressGateway' not found"
有什么我忘记了吗? :我
最佳答案
我不熟悉 ignited/laravel-omnipay
具体来说,所以这可能是也可能不是问题,但你可以尝试修复这一行的大写:
'driver' => 'PayPal_Express',
(注意 PayPal 有两个大写 P)。
通常类名在 PHP 中不区分大小写,但是如果您使用区分大小写的文件系统,那么 composer 自动加载器将无法找到正确的类。
关于php - 使用 Omnipay/Paypal 的 Laravel Omnipay - 找不到类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22051817/