将 PayWithAmazon 与 symfony 2 一起使用 - 与 Composer 一起安装
using PayWithAmazon with symfony 2 - installed with Composer
我通过 composer 安装了这个包:
composer require amzn/login-and-pay-with-amazon-sdk-php
composer update
我将此添加到我的控制器文件中:
使用 PayWithAmazon\Client;
... 并希望使用此软件包提供的客户端 class。
$amazonClient = new PayWithAmazon\Client($this->amazonCredentials);
框架报错信息:
ClassNotFoundException in CartController.php line 185: Attempted to load
class "Client" from namespace "**Microsite\FrontBundle\Controller\PayWithAmazon**".
Did you forget a "use" statement for e.g.
"Symfony\Bundle\FrameworkBundle\Client",
"Symfony\Component\BrowserKit\Client",
"Symfony\Component\HttpKernel\Client",
"Guzzle\Service\Client" or "Guzzle\Http\Client"?
`
谁能告诉我我做错了什么?
如何将 "Client" class 的名称空间从 Microsite\FrontBundle\Controller\PayWithAmazon
更改为正确的?
(我没有遇到其他包的问题...)
干杯
格雷格
我会建议你关注
use PayWithAmazon\Client as AmazonClient;
...
$amazonClient = new AmazonClient($this->amazonCredentials);
我通过 composer 安装了这个包:
composer require amzn/login-and-pay-with-amazon-sdk-php
composer update
我将此添加到我的控制器文件中: 使用 PayWithAmazon\Client;
... 并希望使用此软件包提供的客户端 class。
$amazonClient = new PayWithAmazon\Client($this->amazonCredentials);
框架报错信息:
ClassNotFoundException in CartController.php line 185: Attempted to load
class "Client" from namespace "**Microsite\FrontBundle\Controller\PayWithAmazon**".
Did you forget a "use" statement for e.g.
"Symfony\Bundle\FrameworkBundle\Client",
"Symfony\Component\BrowserKit\Client",
"Symfony\Component\HttpKernel\Client",
"Guzzle\Service\Client" or "Guzzle\Http\Client"?
`
谁能告诉我我做错了什么?
如何将 "Client" class 的名称空间从 Microsite\FrontBundle\Controller\PayWithAmazon
更改为正确的?
(我没有遇到其他包的问题...)
干杯 格雷格
我会建议你关注
use PayWithAmazon\Client as AmazonClient;
...
$amazonClient = new AmazonClient($this->amazonCredentials);