Solved

Paypal Express Checkout Using .Net and VB

Posted on 2011-02-27
1
1,268 Views
Last Modified: 2012-05-11
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

0
Comment
Question by:karlblackburn
1 Comment
 
LVL 19

Accepted Solution

by:
Amandeep Singh Bhullar earned 500 total points
Comment Utility
Check out the article
http://www.codeproject.com/KB/aspnet/paypal_c_aspnet.aspx

Hope this will help you
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This video discusses moving either the default database or any database to a new volume.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now