Advertisement
Guest User

Untitled

a guest
Jan 26th, 2016
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. Imports System
  2. Imports com.paypal.sdk.services
  3. Imports com.paypal.sdk.profiles
  4. Imports com.paypal.sdk.util
  5.  
  6. Namespace GenerateCodeNVP
  7. Public Class GetTransactionDetails
  8. Public Sub New()
  9. End Sub
  10.  
  11. Public Function GetTransactionDetailsCode(ByVal transactionID As String) As String
  12. Dim caller As New NVPCallerServices()
  13. Dim profile As IAPIProfile = ProfileFactory.createSignatureAPIProfile()
  14.  
  15. profile.APIUsername = "xxx"
  16. profile.APIPassword = "xxx"
  17. profile.APISignature = "xxx"
  18. profile.Environment = "sandbox"
  19. caller.APIProfile = profile
  20.  
  21. Dim encoder As New NVPCodec()
  22. encoder("VERSION") = "51.0"
  23. encoder("METHOD") = "GetTransactionDetails"
  24. encoder("TRANSACTIONID") = transactionID
  25.  
  26. Dim pStrrequestforNvp As String = encoder.Encode()
  27. Dim pStresponsenvp As String = caller.[Call](pStrrequestforNvp)
  28. Dim decoder As New NVPCodec()
  29. decoder.Decode(pStresponsenvp)
  30.  
  31. Return decoder("ACK")
  32. End Function
  33. End Class
  34. End Namespace
  35.  
  36. Private Sub cmdGetTransDetail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdGetTransDetail.Click
  37. Dim thereturn As String
  38.  
  39. thereturn =GetTransactionDetailsCode("test51322")
  40. End Sub
  41.  
  42. Error 2 Name 'GetTransactionDetailsCode' is not declared.
  43.  
  44. Dim payPalAPI As New GenerateCodeNVP.GetTransactionDetails
  45. Dim theReturn As String
  46.  
  47. theReturn = payPalAPI.GetTransactionDetailsCode("test51322")
  48.  
  49. Private Sub cmdGetTransDetail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdGetTransDetail.Click
  50. Dim thereturn As String
  51. Dim myTransaction as new GetTransactionDetails
  52.  
  53. thereturn = myTransaction.GetTransactionDetailsCode("test51322")
  54. End Sub
  55.  
  56. Dim instance As New GetTransactionDetails()
  57.  
  58. thereturn = instance.GetTransactionDetailsCode("test51322")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement