Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I send PayPal info automatically without launching PayPal window?

Status
Not open for further replies.

mb224

Programmer
Oct 15, 2004
55
US
I've created my own order pipeline and I can send the total amount to PayPal for payment .... but I also have my customer's credit card information already ....

Supposing my customer is not a PayPal subscriber .. how can I just pass the Credit card info to PayPal for processing ... without having to launch the PayPal window ...for the customer to re-enter their credit card information again!

Or am I forced to ALWAYS launch the PayPal window ... to use PayPal as my payment processor?
 
Not exactly sure what you're looking for, but the HttpWebRequest is the class you can use to send Requests and receive Responses from within your code, without redirecting your app there. You can configure a form post in this class and then check the response for whatever you expect back from PayPal.
 
Usually PayPal integration as a payment processor can handle your shopping cart for you ... or the total amount of your order .... by providing a their URL ( ) to submit your info to. ....
While on the PayPal page ... the user can then enter their credit card info .. or PayPal login if they are a PayPal customer .... I believe PayPal is working on a ASP.Net API for developers to use ... but I believe others have managed on their own to communicate with PayPal directly .....

Anyway since I already have the credit card info that my customer re-enters on the PayPal page .. I wanted a way to just pass that info to PayPal and get the response as to whether he credit card passed ... without necessarily bringing up the PayPal page. Actually I do not even want ot need to let my customer know that PayPal is the processing third-party. I have already done this with Verisign ..since they provided .NET API's for direct communication. I need to use PayPal instead ... so I am looking for a way to do the same. Typically someone in the PayPal community will know .. (IPN ..instant payment notification ..perhaps)

thanks

..here is a sample code that I discovered when a customer clicks on the purchase button .. and ot brings up the PayPal window ....

Private Sub PurchaseBtn_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles cmdPurchase.Click
::
If Page.IsValid Then
' build secure PayPal URL
Dim sBaseURL As String = IIf(Request.ApplicationPath = "/", "", _
Request.ApplicationPath) & "/PayPalIPN"
Dim strPayPalURL As String = ""
' strProcessorId is your PayPal account name.
strPayPalURL = " & HTTPPOSTEncode(strProcessorUserId)
' strProductName is the name of the product you want displayed to the user on the payment screen.
strPayPalURL =+ "&item_name=" & HTTPPOSTEncode(strProductName)
' An item number for your product.
strPayPalURL =+ "&item_number=" & HTTPPOSTEncode(strItemNumber)
' Quantity that the user is purchasing.
strPayPalURL =+ "&quantity=1"
' Custom can be any value you want, here we are passing the user account for the site.
strPayPalURL =+ "&custom=" & HTTPPOSTEncode(Context.User.Identity.Name)
' The price of the product.
strPayPalURL =+"&amount=" & HTTPPOSTEncode(strPrice)
' Optional currency type for the transaction.
strPayPalURL =+ "¤cy_code=" & HTTPPOSTEncode(lblTotalCurrency.Text)
' Where do you want the customer to go once they pay for the item?
strPayPalURL =+ "&return=" & HTTPPOSTEncode(" & GetDomainName(Request))
' This is for redirecting to a cancel page if the customer decides to cancel the purchase.
strPayPalURL =+ "&cancel_return=" & HTTPPOSTEncode(" & GetDomainName(Request))
' this is where you want PayPal to send the IPN to.
' You can also use the default one configured via the
' PayPal site, but this allows you to specify a dynamic URL for accepting the IPN.
strPayPalURL =+ "¬ify_url=" & HTTPPOSTEncode(sBaseURL & "/PaymentNotify.aspx")
strPayPalURL =+ "&undefined_quantity=&no_note=1&no_shipping=1"
' redirect to PayPal
Response.Redirect(strPayPalURL)
End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top