设置 Braintree 以使用 Laravel 管理付款
我正在尝试设置 Braintree 来管理 Laravel 中的付款,但我遇到了很大的困难。 我尝试通过在 Laravel 中的 AppServiceProvider 中设置网关来遵循在线教程。
问题是我仍然遇到未定义类型 Braintree\Gateway 的错误,尽管我已经安装了 SDK:
composer require braintree/braintree_php
这是我的代码:
$this->app->singleton(Gateway::class, function($app){
return new Gateway(
[
'enviroment' => 'sandbox',
'merchantId'=> 'fcbw9x3mcdzygrq8',
'publicKey' => 'bgzxhtjd5zfhh7fn',
'privateKey' => 'f55752441b22915c8c10b437a3e4376d'
]
);
});
我什至使用以下命令导入它:
use Braintree\Gateway;
我做错了什么?
I am trying to set up Braintree to manage payments in Laravel, and I am having a really hard time.
I tried to follow a tutorial online by setting the gateway in AppServiceProvider in Laravel.
The problem is that I continue to have an error with undefined type Braintree\Gateway although i already installed the SDK with:
composer require braintree/braintree_php
This is my code:
$this->app->singleton(Gateway::class, function($app){
return new Gateway(
[
'enviroment' => 'sandbox',
'merchantId'=> 'fcbw9x3mcdzygrq8',
'publicKey' => 'bgzxhtjd5zfhh7fn',
'privateKey' => 'f55752441b22915c8c10b437a3e4376d'
]
);
});
I even imported it with:
use Braintree\Gateway;
What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论