Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DateTime startDate = new DateTime(2018, 1, 1);
- DateTime endDate = new DateTime(2019, 12, 31);
- TransactionSearchReq req = new TransactionSearchReq();
- req.TransactionSearchRequest = new TransactionSearchRequestType();
- req.TransactionSearchRequest.StartDate = startDate;
- req.TransactionSearchRequest.EndDate = endDate;
- req.TransactionSearchRequest.Version = "74.0";
- PayPalAPIInterfaceClient client = new PayPalAPIInterfaceClient();
- string username = "";
- string password = "";
- string signature = "";
- UserIdPasswordType userIdPasswordType = new UserIdPasswordType()
- {
- Username = username,
- Password = password,
- Signature = signature
- };
- CustomSecurityHeaderType header = new CustomSecurityHeaderType();
- header.Credentials = userIdPasswordType;
- var result = await client.TransactionSearchAsync(header, req);
- return Ok(result.TransactionSearchResponse1.PaymentTransactions.Where(i => double.Parse(i.GrossAmount.Value) > 0 && i.Type == "Payment" || i.Type == "Donation").Select(i => new {
- GrossAmount = i.GrossAmount.Value,
- NetAmount = i.NetAmount.Value,
- FeeAmount = i.FeeAmount.Value,
- Date = i.Timestamp
- }));
Add Comment
Please, Sign In to add comment