JD Lambert
JD Lambert

Reputation: 11

PayPal API and VB

I am trying to convert the C# code sample for making your first call to the PayPal API to VB using VS2015.

Specifically, I am trying to convert

var accessToken = new OAuthTokenCredential(config).GetAccessToken(); 

I have tried using

Dim accessToken = New OAuthTokenCredential(config).GetAccessToken()

but I receive the following error:

Overload resolution failed because no accessible NEW can be called without a narrowing conversion. 

Does anyone have insight into this error or does anyone have a vb sample that I can refer to?

Upvotes: 0

Views: 307

Answers (1)

kalex
kalex

Reputation: 11

Try the following:

Dim AccessToken As String = New OAuthTokenCredential(Config).GetAccessToken()

Dim aContext As APIContext = New APIContext(AccessToken)

Upvotes: 1

Related Questions