Link to home
Start Free TrialLog in
Avatar of karlblackburn
karlblackburnFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Paypal Express Checkout Using .Net and VB

Hi,

I am trying to integrate the code for Paypal Express Checkout, just for people with paypal accounts as we also have our own credit card payment mehtod. The integratror here - https://www.paypal-labs.com/integrationwizard/ecpaypal/main.php

Unfortunatly this takes a lot to be desired with spelling errors, undefined variables etc.

I believe the code attached is correct for the first step calling NVPAPICaller() but when it goes to the sandbox testing area it only shows the Paypal default address and not the one I have defined.

Any help would be apprecaitted.

Kind Regards
Karl
 
Dim test As New NVPAPICaller()

        Dim retMsg As String = ""
        Dim token As String = ""

        Session("payment_amt") = 21.99
        Session("Payment_Amount") = 21.99

        If Session("payment_amt") IsNot Nothing Then
            Dim amt As String = Session("payment_amt").ToString()

            'Optional Shipping Address entered on the merchant site 
            Dim shipToName As String = "test 1" '"<SHIPTONAME>"
            Dim shiptoStreet As String = "test 1" '"<SHIPTOSTREET>"
            Dim shiptoStreet2 As String = "test 1" '"<SHIPTOSTREET2>"
            Dim shipToCity As String = "test 1" '"<SHIPTOCITY>"
            Dim shipToState As String = "test 1" '"<SHIPTOSTATE>"
            Dim shipToZip As String = "test 1" '"<SHIPTOCITY>"
            Dim shipToCountryCode As String = "test 1" '"<SHIPTOCOUNTRYCODE>"

            Dim ret As Boolean = test.MarkExpressCheckout(amt, shipToName, shipToStreet, shipToStreet2, shipToCity, shipToState, shipToZip, shipToCountryCode, token, retMsg)
            If ret Then
                Session("token") = token
                Response.Redirect(retMsg)
            Else
                Response.Redirect("APIError.aspx?" & retMsg)
            End If
        Else
            Response.Redirect("APIError.aspx?ErrorCode=AmtMissing")
        End If

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Amandeep Singh Bhullar
Amandeep Singh Bhullar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial