コード例 #1
0
        public PaymentTransactionSearchResultType getPayPalTransaction(string pTransactionID)
        {
            TransactionSearchReq request = new TransactionSearchReq();

            request.TransactionSearchRequest                  = new TransactionSearchRequestType();
            request.TransactionSearchRequest.StartDate        = DateTime.UtcNow.AddDays(-360);
            request.TransactionSearchRequest.TransactionClass = PaymentTransactionClassCodeType.All;
            request.TransactionSearchRequest.Version          = "124.0";
            request.TransactionSearchRequest.TransactionID    = pTransactionID;
            var pw     = credentials;
            var client = new PayPalAPIInterfaceClient();

            try
            {
                TransactionSearchResponseType trans = client.TransactionSearch(ref pw, request);
                if (trans.Ack == AckCodeType.Success)
                {
                    if (trans.PaymentTransactions.Count() == 1)
                    {
                        return(trans.PaymentTransactions[0]);
                    }
                }
            }
            catch {}

            return(null);
        }
コード例 #2
0
        public void testPayPal()
        {
            var client = new PayPalAPIInterfaceClient();

            TransactionSearchReq request = new TransactionSearchReq();

            request.TransactionSearchRequest                  = new TransactionSearchRequestType();
            request.TransactionSearchRequest.StartDate        = DateTime.UtcNow.AddDays(-360);
            request.TransactionSearchRequest.TransactionClass = PaymentTransactionClassCodeType.All;
            request.TransactionSearchRequest.Version          = "124.0";
            request.TransactionSearchRequest.TransactionID    = "7XJ58176Y65857210";
            var pw = credentials;
            TransactionSearchResponseType transactionSearchResponseType = client.TransactionSearch(ref pw, request);
        }