【发布时间】:2012-09-14 19:26:07
【问题描述】:
关于新的 Paypal SDK,几乎没有有用的示例代码,互联网上充斥着旧 SDK 的示例。我的问题涉及对我通过权限 API 获得令牌和 secretToken 的第三方贝宝帐户发出 API 请求。
在尝试构造 PPAPIService 对象时,可能的服务名称列表在哪里?
即:$this->serviceName = $serviceName; (在构造函数中)这些的字符串语法是什么?
关于makeRequest方法,如何定义$apiMethod变量,$params变量的格式是什么?有哪些不同的参数?
如何获取授权第三方账户的账户余额的简单示例将非常有帮助。 我正在使用 PHP。
来自 PPAPIService.php 文件:
class PPAPIService
{
public $endpoint;
public $serviceName;
private $logger;
public function __construct($serviceName = "")
{
$this->serviceName = $serviceName; //is there ANY documentation about the syntax and types of service names?
$config = PPConfigManager::getInstance();
$this->endpoint = $config->get('service.EndPoint');
$this->logger = new PPLoggingManager(__CLASS__);
}
public function setServiceName($serviceName)
{
$this->serviceName = $serviceName;
}
public function makeRequest($apiMethod, $params, $apiUsername = null, $accessToken = null, $tokenSecret = null)
{
//what are the apiMethod types? syntax? and params? type.. options...??
}
}
【问题讨论】: