Re: Trying to Paypal balance show up in textbox VB.NET

This post is from the topic: Trying to Paypal balance show up in textbox VB.NET




68193 vbepicness
Posted: 2011-09-02 18:03:34

To be clear, what I am trying to acheive is:
Have my Paypal current balance show up in a textbox on VB.NET using the PayPal API
Not a VB.Net Webbrowser

I have followed the guide on this page
<!-- m --><a class="postlink" href="http://www.blog-dotnet.com/post/Usin...tarted%29.aspx">http://www.blog-dotnet.com/post/Usin...tarted%29.aspx</a><!-- m -->

But I keep getting the error
Object reference not set to an instance of an object.

when I execute this code in VB.NET:
Imports PayPalAPITest.com.paypal.www

Public Class Form1

Private Sub btnGetBalance_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGetBalance.Click
Dim credentials As New UserIdPasswordType
credentials.Username = &quot;*********_api1.live.co.uk&quot;
credentials.Password = &quot;****************&quot;
credentials.Signature = &quot;****************.****************-****************&quot;
credentials.Subject = &quot;****************@********.co.uk&quot;

Dim customSecurityHeader As New CustomSecurityHeaderType
customSecurityHeader.Credentials = credentials

Dim ServiceInterface As New PayPalAPISoapBinding
ServiceInterface.Url = &quot;https://api-3t.paypal.com/2.0/&quot;
ServiceInterface.RequesterCredentials = customSecurityHeader

Dim request As New GetBalanceRequestType
request.Version = &quot;59.0&quot;

Dim req As New GetBalanceReq
req.GetBalanceRequest = request

Dim response As GetBalanceResponseType
response = ServiceInterface.GetBalance(req)

Me.txtBalance.Text = response.Balance.Value
End Sub
End Class



Has anyone managed to get this to work??
If so, please lend a hand


JOIN DEVPPL

It looks like you are new here. If you want to get involved, click on Join below!




MENU
Advertising