简体   繁体   中英

How get paymants list with PayPal .NET SDK?

I trying get list of payment transactions with next code:

    static void Main(string[] args)
    {
        var config = ConfigManager.Instance.GetProperties();
        var accessToken = new OAuthTokenCredential(config).GetAccessToken();
        var apiContext = new APIContext(accessToken);

        var payments = Payment.List(apiContext);
    }

But I receive empty list. How I can get payment history info with PayPal .NET SDK?

Resolved by using merchant-sdk-dotnet .

    static void Main(string[] args)
    {
        var config = ConfigManager.Instance.GetProperties();

        var service = new PayPalAPIInterfaceServiceService(config);

        var req = new TransactionSearchReq
        {
            TransactionSearchRequest = new TransactionSearchRequestType("2019-06-20T11:00:00Z")
        };

        var data = service.TransactionSearch(req);

    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM