Laravel Omnipay与Omnipay / Paypal

编程入门 行业动态 更新时间:2024-10-21 19:06:01
Laravel Omnipay与Omnipay / Paypal - 未找到类(Laravel Omnipay with Omnipay/Paypal - Class not found)

我正在尝试将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.

更多推荐

本文发布于:2023-08-05 06:06:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1428827.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Laravel   Omnipay   Paypal

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!