私は、PHPアプリケーションで購読支払いを実行するために、Paypal Rest API(請求計画とBilling Agreement API)を使用しています。Paypalが約款IDを受け取ることができません
すべてのAPIが完璧に動作します。契約に2つの日付の間にトランザクションを検索するために使用されているAPIのみが機能しません。
リクエストを確認しました。公式のAPIドキュメントと同じです。 https://developer.paypal.com/docs/api/payments.billing-agreements#billing-agreements_transactions
私はこのようなAPIを呼び出すためにPHPとのcURLを使用しています:
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sandbox.paypal.com/v1/payments/billing-agreements/<Agreement-id>/transaction?start_date=2017-06-15&end_date=2017-06-17");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{}");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$headers = array();
$headers[] = "Content-Type: application/json";
$headers[] = "Authorization: Bearer <My-Access-Token>";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
curl_close ($ch);
echo '<pre>';
print_r($result);
?>
は、必ずこの応答を取得:
{
name: "MALFORMED_REQUEST",
message: "The requested resource was not found",
information_link: "https://developer.paypal.com/webapps/developer/docs/api/#MALFORMED_REQUEST",
debug_id: "4cf777ecda3b"
}
Plzをヘルプを、