In the past, I implemented an automatic notification and digital product delivery system with Paypal Payment Processing System. The concept is, when a person buys products from your web-sites, he gets his products automatically as email attachments after you have confirmed the transaction. The most important part is – collecting payment data and buyer information from Paypal to ensure that the transaction is legitimate and the payment really went through. You can use either Paypal IPN or Paypal PDT to collect these data and email products on successful verification. Either will/should work. For me, PDT worked alright. Check the following web-pages/documents. Also, from PDT section, check the sample examples. For me the sample example with ASP/VBSCript worked alright.
- Paypal Order Management Guide
- IPN Code Sample
- From the first link, also check PDT code sample
In the past, I have worked with MiraServ, and Moneris payment processing systems. You can find short-notes and video tutorials in this web-site on them. Just search through our web-sites.
A relevant code in ASP is provided below. The code collects the payer’s information just after someone has paid. The code also checks, if the payment was successful, if so prints some details about the transaction and the payer
The flow of actions (in terms of code and operations)
- Create a paypal button, provide return url for successful payment and canceled payment.
- In your successful payment page, write down the following code
- Your paypal account needs to be configured properly to make the following code work – consult the documents as listed above
- You need to use the authentication code from your paypal account to/in the following code
- The follwing code section
authToken = "ytrtyrtr45654hgfhgfjhfsfdsfdsfds;ljlk" 'auth code for your paypal account txToken = Request.Querystring("tx") 'as sent from paypal query = "cmd=_notify-synch&tx=" & txToken & "&at=" & authToken set objectHttp = Server.CreateObject("Microsoft.XMLHTTP") objectHttp.open "POST", "http://www.paypal.com/cgi-bin/webscr", false objectHttp.setRequestHeader "Content-type", "application/x-www-form-urlencoded" objectHttp.Send query
submits to the paypal to grab transaction details. (remember, after payment the control is required to come to this page, then based on authentication code and tx-id, the code grabs detail transaction information)
< % Dim query Dim objectHttp Dim strQuerystring Dim i, result Dim firstName, lastName, itemName, curGross, mcCurrency, email Dim authToken, txToken Dim strParts, intParts, aParts Dim strResults, strKey, strValue authToken = "ytrtyrtr45654hgfhgfjhfsfdsfdsfds;ljlk" 'auth code for your paypal account txToken = Request.Querystring("tx") 'as sent from paypal query = "cmd=_notify-synch&tx=" & txToken & "&at=" & authToken set objectHttp = Server.CreateObject("Microsoft.XMLHTTP") objectHttp.open "POST", "http://www.paypal.com/cgi-bin/webscr", false objectHttp.setRequestHeader "Content-type", "application/x-www-form-urlencoded" objectHttp.Send query strQuerystring = objectHttp.responseText If Mid(strQuerystring,1,7) = "SUCCESS" Then strQuerystring = Mid(strQuerystring,9) strParts = Split(strQuerystring, vbLf) intParts = UBound(strParts) - 1 ReDim strResults(intParts, 1) For i = 0 To intParts aParts = Split(strParts(i), "=") strKey = aParts(0) strValue = aParts(1) strResults(i, 0) = strKey strResults(i, 1) = strValue Select Case strKey Case "first_name" firstName = strValue Case "last_name" lastName = strValue Case "item_name" itemName = strValue Case "mc_gross" curGross = strValue Case "mc_currency" mcCurrency = strValue Case "payer_email" email = strValue email = Replace(email, "%40", "@") End Select Next email = Replace(email, "%40", "@") Response.Write("
We have received your order") Response.Write("Details ") Response.Write("
Home Page |
From: http://sitestree.com/?p=5281
Categories:19
Tags:
Post Data:2006-10-25 18:41:19
Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
(Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a>
In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
<a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>