title: Using PayPal REST API with Vb.net
body: <p>I have a number of old programs that I wrote in VB6 that use a Webbrowser control to log into PayPal and then fill in various PayPal fields in the browser based on actions taken by the user. PayPal has changed some things recently that make my old programs no longer work, so I'm upgrading.</p>
  
  <p>I've started working in VB.NET (Visual Studio Express 2013) to try to replace my old forms based VB6 programs with VB.NET programs. </p>
  
  <p>I'll be honest, I find the PayPal REST API instructions confusing and I see almost no examples in VB.</p>
  
  <p>For starters, all I want to do is send customers invoices. I want to take the information for the invoices from my forms-based windows program (written in VB6) and submit it to the customer as a PayPal invoice with all the detail.</p>
  
  <p>I have some code - not sure how good it is. Can someone get me started by telling me where it would go in a VB.NET app (Let's say you just started a brand new VB.NET forms-based app and wanted to put the support for the PayPal REST Invoicing API). I've written some programs in VB.net and C#.net, but I'm a bit green when it comes to things like Namespaces and Imports statements. Note - this code is translated from C# and there are some statements that seem to issue errors no matter where I put them (
  
  <p>I tried putting this code in AssemblyInfo.VB (note this is sample code so user ids and passwords are generic and not mine):</p>
  
  <pre><code>Imports System
  Imports System.Reflection
  Imports System.Runtime.InteropServices
  
  Imports System.Data
  Imports System.Configuration
  Imports System.Web
  Imports System.Web.Security
  Imports System.Web.UI
  Imports System.Web.UI.WebControls
  Imports System.Web.UI.WebControls.WebParts
  Imports System.Web.UI.HtmlControls
  Imports System.Collections.Generic
  
  Namespace InvoicingSampleApp
  Public NotInheritable Class Configuration
      Private Sub New()
      End Sub
      ' Creates a configuration map containing signature credentials and other required configuration parameters
      Public Shared Function GetSignatureConfig() As Dictionary(Of String, String)
          Dim configMap As New Dictionary(Of String, String)()
  
          ' Endpoints are varied depending on whether sandbox OR live is chosen for mode
          configMap.Add("mode", "sandbox")
  
          ' Account Credential
          configMap.Add("account1.apiUsername", "jb-us-seller_api1.paypal.com")
          configMap.Add("account1.apiPassword", "WX4WTU3S8MY44S7F")
          configMap.Add("account1.apiSignature", "AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy")
          configMap.Add("account1.applicationId", "APP-80W284485P519543T")
  
          ' Sandbox Email Address
          configMap.Add("sandbox.EmailAddress", "pp.devtools@gmail.com")
  
          Return configMap
      End Function
  
      ' Creates a configuration map containing certificate credentials and other required configuration parameters
      Public Shared Function GetCertificateConfig() As Dictionary(Of String, String)
          Dim configMap As New Dictionary(Of String, String)()
  
          ' Endpoints are varied depending on whether sandbox OR live is chosen for mode
          configMap.Add("mode", "sandbox")
  
          ' Account Credential
          configMap.Add("account2.apiUsername", "certuser_biz_api1.paypal.com")
          configMap.Add("account2.apiPassword", "D6JNKKULHN3G5B8A")
          configMap.Add("account2.apiCertificate", "resource/sdk-cert.p12")
          configMap.Add("account2.privateKeyPassword", "password")
          configMap.Add("account2.applicationId", "APP-80W284485P519543T")
  
  
          ' Sandbox Email Address
          configMap.Add("sandbox.EmailAddress", "pp.devtools@gmail.com")
  
          Return configMap
      End Function
  End Class
  End Namespace
  
  
  
  
  General Information about an assembly is controlled through the following 
  set of attributes. Change these attribute values to modify the information
  associated with an assembly.
  Review the values of the assembly attributes
  &lt;Assembly: AssemblyTitle("PaymentRequest")&gt; 
  &lt;Assembly: AssemblyDescription("")&gt; 
  &lt;Assembly: AssemblyCompany("")&gt; 
  &lt;Assembly: AssemblyProduct("PaymentRequest")&gt; 
  &lt;Assembly: AssemblyCopyright("Copyright ©  2017")&gt; 
  &lt;Assembly: AssemblyTrademark("")&gt; 
  &lt;Assembly: ComVisible(False)&gt;
  The following GUID is for the ID of the typelib if this project is exposed to COM
   &lt;Assembly: Guid("bb86e41e-ee37-4fd5-8e6f-0fa12f364392")&gt; 
  
  ' Version information for an assembly consists of the following four values:
   '
  ''      Major Version
  ''      Minor Version 
  ''      Build Number
  ''      Revision
  ''
  '' You can specify all the values or you can default the Build and Revision 
  Numbers 
  '' by using the '*' as shown below:
  '' &lt;Assembly: AssemblyVersion("1.0.*")&gt; 
  
  &lt;Assembly: AssemblyVersion("1.0.0.0")&gt; 
  &lt;Assembly: AssemblyFileVersion("1.0.0.0")&gt; 
  </code></pre>
  
  <p>I have other code as well and more questions, but I'll stop there to limit the scope of this. Thanks for you help (and patience with my question)</p>