4
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by Jassi sharma
0

There are several ways you can use Paypal on your site, it all depends on whether you want to use their shopping cart and session management or your own and whether you want your users to be redirected to paypal or stay within your site (except for the final payment). Head over to the developer section at Paypal, sign up (if you haven't already) and check out the developer tools

0

Look at using the PayPal IPN. It let's you send variables to the service and if the transaction is successful you can define a method (or page) to access.

First, you need to enable the IPN in your PayPal account:
'My Profile -> My Selling Tools -> Getting paid and managing my risk -> Instant payment notifications -> Update
'Choose IPN Settings -> Type in notification url and tick Receive IPN messages (Enabled)

Then, on your Pay button, use something like:

Dim PaypalAccount As String = "your_payPal_account"



Dim URL As String = "https://www.paypal.com/cgi-bin/webscr?business=" & PaypalAccount & "&cmd=_cart&upload=1&item_name_1=" & the_description_here & "&amount_1=" & the_dollar_value_here & "&quantity_1=1&currency_code=USD&on0=&invoice=" & unique_invoice_number & "&return=http://" & Request.ServerVariables("HTTP_HOST") & "/confirmed.aspx&cancel_return=http://" & Request.ServerVariables("HTTP_HOST") & "/declined.aspx&notify_url=http://" & Request.ServerVariables("HTTP_HOST") & "/some_page_here.aspx"

Response.Redirect(URL)

In the some_page_here.aspx, you can get the the return values from PayPal and finish the transaction (eg: write the confirmed values to your database.) The user will not see this page, they will get returned either to the approved or declined page.

Some of the values that get returned are: Request("invoice") Request("txn_type") Request("txn_id")
Read up on PayPal what these values are and what other values get returned.

Remember, the invoice value is important as it will be the original invoice number that you sent.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.