public PayPalReturn GetTransactionDetails(string transactionID) { //PayPal Return Structure PayPalReturn rv = new PayPalReturn(); rv.IsSucess = false; //Requests //TransactionID = "6XT85330WL909250J" GetTransactionDetailsReq request = new GetTransactionDetailsReq(); request.GetTransactionDetailsRequest = new GetTransactionDetailsRequestType(); request.GetTransactionDetailsRequest.TransactionID = transactionID; request.GetTransactionDetailsRequest.Version = "51.0"; //Headers CustomSecurityHeaderType headers = new CustomSecurityHeaderType(); headers.Credentials = new UserIdPasswordType(); headers.Credentials.Username = ConfigurationManager.AppSettings["PayPalAPIUsername"]; headers.Credentials.Password = ConfigurationManager.AppSettings["PayPalAPIPassword"]; headers.Credentials.Signature = ConfigurationManager.AppSettings["PayPalAPISignature"]; //Client PayPalAPISoapBinding client = new PayPalAPISoapBinding(); client.RequesterCredentials = headers; client.Timeout = 15000; GetTransactionDetailsResponseType response = client.GetTransactionDetails(request); if (response.Ack == AckCodeType.Success || response.Ack == AckCodeType.SuccessWithWarning) { rv.IsSucess = true; rv.TransactionID = response.PaymentTransactionDetails.PaymentInfo.TransactionID; rv.ObjectValue = response.PaymentTransactionDetails; } else { rv.ErrorMessage = response.Errors[0].LongMessage; } return rv; }
/// <remarks/> public void GetTransactionDetailsAsync(GetTransactionDetailsReq GetTransactionDetailsReq, object userState) { if ((this.GetTransactionDetailsOperationCompleted == null)) { this.GetTransactionDetailsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetTransactionDetailsOperationCompleted); } this.InvokeAsync("GetTransactionDetails", new object[] { GetTransactionDetailsReq}, this.GetTransactionDetailsOperationCompleted, userState); }
/// <remarks/> public void GetTransactionDetailsAsync(GetTransactionDetailsReq GetTransactionDetailsReq) { this.GetTransactionDetailsAsync(GetTransactionDetailsReq, null); }