Reputation: 11
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
Reputation: 11
Try the following:
Dim AccessToken As String = New OAuthTokenCredential(Config).GetAccessToken()
Dim aContext As APIContext = New APIContext(AccessToken)
Upvotes: 1