One of my sites had been using the PayPal "form" manner of invoking a single item sale, and I finally found a URL method of doing the same by passing the arguments. The scenario is that I have a dropdownlist with the quantity of tickets to be ordered and when an acceptable quantity (other than none) is selected, I make the hyperlink enabled. (This allows me to open the PayPal transaction in a separate window, keeping mine around.) Here's the code:
1 Protected Sub ddlQuantity_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlQuantity.SelectedIndexChanged
2 Dim lvQuantity As Integer = 0
3 Dim lvResp As String = ""
4
5 lvQuantity = ddlQuantity.SelectedValue
6 If lvQuantity > 0 Then
7
8 lvResp = "https://www.paypal.com/cgi-bin/webscr"
9 lvResp &= "?cmd=_xclick"
10 lvResp &= "&business=tickets@TasteOfHawaii.com"
11
12 If lvQuantity = 1 Then
13 lvResp &= "&item_name=One (1) ticket to 2008 Taste of Hawaii / June 1, 2008"
14 Else
15 lvResp &= "&item_name=" & FormatQuantity(lvQuantity) & " tickets to 2008 Taste of Hawaii / June 1, 2008"
16 End If
17
18 Dim lvAmount As Double = lvQuantity * CONST_TICKET_PRICE
19 lvResp &= "&amount=" & CStr(lvAmount)
20 lvResp &= "¤cy_code=USD"
21
22 hypBuyNow.NavigateUrl = lvResp
23
24 hypBuyNow.Enabled = True
25 hypBuyNow.Focus()
26
27 Else
28 lblQtyError.Visible = True
29 ddlQuantity.Focus()
30 End If
31 End Sub
I've been searching the Google site for the equvalent form and only found complicated XML examples. Does anyone know of a Google equivalent for doing the same thing?
mahalos (thanks) in advance for any tips ... :) KevInKauai
P.S. I've seen some posts that speak of encryption but is there really any "exposure" then openly invoking the PayPal page?