Is there a PayPal API or setting for Tax exemptions

441 Views Asked by At

My company deals a lot of farm parts and many of these people have filled out a tax exemption form for the state where, as long as the product qualifies, they do not have to pay tax. The problem is, in order to be exempt from paying taxes, we have to have their exemption form in our records. My question is, how can I handle this in paypal if possible? I am using the paypal checkout where the client is redirected to PayPal's site for checkout and then returned to my site after the transaction. The client would need to have some sort of option to check a checkbox or something to say they are tax exempt and I would then also have to check the client with our records to make sure we had his paper. If the would like to claim tax exempt they would have to fill out a form and send it to us. Is there any way that paypal deals with this or is this something that would have to be done before they are redirected to PayPal for checkout.

I'm thinking a work-around could be something like, upon clicking on the add to cart button, client is prompted whether they are tax exempt or not. If they say that they are, we would remove the sales tax for that product and they would then proceed with checkout through paypal. After the transaction is made I would check to confirm that we actually have a record for that client, if not, we would notify them via email saying that we do not have a record and that sales tax would be added.

Could someone give me some advice here, I have not been able to find anything related to paypal and tax exemption of this nature and I'm just wondering if their is a way to handle this through paypal or if my work-around will do the trick? Here is code for on add to cart button click

  Dim ppHref As StringBuilder = New StringBuilder()
    ppHref.Append("https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_cart")
    ppHref.Append("&business=" + business)
    ppHref.Append("&item_name=" + itemName)
    ppHref.Append("&item_number=" + itemNumber)
    ppHref.Append("&amount=" + itemAmount)
    ppHref.Append("&currency_code=" + currencyCode)
    ppHref.Append("&add=" + addItem.ToString("#0"))
    Response.Redirect(ppHref.ToString(), True)
    Dim ReturnQaunity As String = itemAmount
    GetRouteUrl("/v1/payments/orders/<Order-Id>")

And here is the code where I am trying to start getting details back from the transaction

  Dim strSandbox As String = "https://www.sandbox.paypal.com/cgi-bin/webscr"
    Dim strLive As String = "https://www.paypal.com/cgi-bin/webscr"
    Dim req As HttpWebRequest = CType(WebRequest.Create(strSandbox), HttpWebRequest)

    'Dim Param() As Byte = Request.BinaryRead(HttpContext.Current.Request.ContentLength)
    'Dim strRequest2 As String = Encoding.ASCII.GetString(Param)
    'strRequest2 = strRequest2 + "&cmd=_notify-validate&"
    'Dim req1 As HttpWebRequest = CType(WebRequest.Create(strSandbox), HttpWebRequest)


    'Set values for the request back
    req.Method = "POST"
    req.ContentType = "application/x-www-form-urlencoded"
    req.ContentLength = strRequest.Length

    'Send the request to PayPal and get the response
    Dim streamOut As StreamWriter = New StreamWriter(req.GetRequestStream(), Encoding.ASCII)
    streamOut.Write(strRequest)
    streamOut.Close()
    Dim streamIn As StreamReader = New StreamReader(req.GetResponse().GetResponseStream())
    Dim strResponse As String = streamIn.ReadToEnd()
    streamIn.Close()

    If Not String.IsNullOrEmpty(strResponse) Then
        Dim results As New Dictionary(Of String, String)
        Dim reader As New StringReader(strResponse)
        Dim line As String = reader.ReadLine()
        If line = "Success" Then
            While True
                Dim aLine As String
                aLine = reader.ReadLine
                If aLine IsNot Nothing Then
                    Dim strArr() As String
                    strArr = aLine.Split("=")
                    results.Add(strArr(0), strArr(1))
                Else
                    Exit While
                End If
            End While

This code works fine for all PDT variables however I am also stuck on how to make the api calls where I can recieve PayerID and all the api variables listed in paypal. Would you be able to help me with that? How to make an API call to paypal in vb.net? or at least what I need in order to make an api call?

0

There are 0 best solutions below