我正在使用Paypal Rest API(结算计划和结算协议API)在我的PHP应用程序中实现订阅付款。
所有API都能正常运行。只有api不能用于搜索协议的2个日期之间的交易。
我检查了我的请求,它与官方API文档中的相同。 https://developer.paypal.com/docs/api/payments.billing-agreements#billing-agreements_transactions
我正在使用PHP和cURL来调用这样的api:
<?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帮助,