paypal API in VB.net

Posted by StealthRT on Stack Overflow See other posts from Stack Overflow or by StealthRT
Published on 2010-05-07T18:49:53Z Indexed on 2010/05/07 19:08 UTC
Read the original article Hit count: 788

Filed under:
|

Hey all, i have converted some C# PayPal API Code over to VB.net. I have added that code to a class within my project but i can not seem to access it:

Imports System
Imports com.paypal.sdk.services
Imports com.paypal.sdk.profiles
Imports com.paypal.sdk.util

Namespace GenerateCodeNVP
Public Class GetTransactionDetails
    Public Sub New()
    End Sub

    Public Function GetTransactionDetailsCode(ByVal transactionID As String) As String
        Dim caller As New NVPCallerServices()
        Dim profile As IAPIProfile = ProfileFactory.createSignatureAPIProfile()

        profile.APIUsername = "xxx"
        profile.APIPassword = "xxx"
        profile.APISignature = "xxx"
        profile.Environment = "sandbox"
        caller.APIProfile = profile

        Dim encoder As New NVPCodec()
        encoder("VERSION") = "51.0"
        encoder("METHOD") = "GetTransactionDetails"
        encoder("TRANSACTIONID") = transactionID

        Dim pStrrequestforNvp As String = encoder.Encode()
        Dim pStresponsenvp As String = caller.[Call](pStrrequestforNvp)
        Dim decoder As New NVPCodec()
        decoder.Decode(pStresponsenvp)

        Return decoder("ACK")
    End Function
End Class
End Namespace

I am using this to access that class:

Private Sub cmdGetTransDetail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdGetTransDetail.Click
    Dim thereturn As String

    thereturn =GetTransactionDetailsCode("test51322")
End Sub

But it keeps telling me:

Error 2 Name 'GetTransactionDetailsCode' is not declared.

I'm new at calling classes in VB.net so any help would be great! :o)

David

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about visual-studio-2008