新しいPaypalSDKに関しては、有用なサンプルコードはほとんどなく、インターネットには古い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...??
}
}