我想通过 api 下载 PayPal 活动。(即只收到一个月付款的报告)。
我们将 WooCommerce 与 PayPal ExpressCheckout 一起使用。它似乎使用了 NVP api。(我尝试使用 REST API 并没有得到任何结果)。
我已经下载了 Merchant-sdk-dotnet 示例 ( https://github.com/paypal/merchant-sdk-dotnet ),但在运行它们时遇到了问题。我试图提取我需要的几部分并在控制台应用程序中实现它们(见下文)。(VS2012 C#)
我正在使用上面 aspx 示例中的沙盒凭据(但也尝试了我们的实时/真实凭据)。
下面的代码总是导致 AckCodeType.FAILURE (并且没有事务)。
...
using PayPal.PayPalAPIInterfaceService;
using PayPal.PayPalAPIInterfaceService.Model;
namespace PayPalToDBMerch
{
class Program
{
static void Main(string[] args)
{
TransactionSearchRequestType request = new TransactionSearchRequestType();
TransactionSearchReq wrapper = new TransactionSearchReq();
wrapper.TransactionSearchRequest = request;
Dictionary<string, string> configurationMap = Configuration.GetAcctAndConfig();
PayPalAPIInterfaceServiceService service = new PayPalAPIInterfaceServiceService(configurationMap);
TransactionSearchResponseType transactionDetails = service.TransactionSearch(wrapper);
if (transactionDetails.Ack == AckCodeType.FAILURE)
{
Console.WriteLine("This is always the result."); //
}
else
{
Console.WriteLine("I never get here.");
}
}
}
感谢您的帮助。