Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 1st, 2009, 05:24 AM
Authorized User
 
Join Date: Sep 2009
Posts: 24
Thanks: 3
Thanked 0 Times in 0 Posts
Default The Beer Shop

from where the value is being passed in querystring id in ordercomleted.aspx.cs
Code:
Order order = Order.GetOrderByID(Convert.ToInt32(this.Request.QueryString["ID"]));
         if (order.StatusID == (int)StatusCode.WaitingForPayment)
         {
            order.StatusID = (int)StatusCode.Confirmed;
            order.Update();
 
Old October 1st, 2009, 08:15 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

This comes from the GetPayPalPaymentUrl() method of Order.cs

This is a LONG Url that has a number of other URLs embedded in its quesrystring, one of which is as follows:

string returnUrl = HttpUtility.UrlEncode(baseUrl + "PayPal/OrderCompleted.aspx?ID=" + this.ID.ToString());

When an order is successfully completed, it uses this URL to redirect the user to OrderCompleted.aspx, with the order number appended to the querystring of that request.
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
The Following User Says Thank You to Lee Dumond For This Useful Post:
ashwinirajp (October 2nd, 2009)
 
Old October 2nd, 2009, 02:41 AM
Authorized User
 
Join Date: Sep 2009
Posts: 24
Thanks: 3
Thanked 0 Times in 0 Posts
Default thanx

thanx for your reply,
now i want to know when notify.aspx will run to get verification.
 
Old October 2nd, 2009, 02:55 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Whenever a customer pays for something, they have to click on a link, the URL of which is generated by the GetPayPalPaymentUrl().

You already learned how this long URL's querystring contains other URLs, one of which is returnUrl (see previous post). Another URL it contains is notifyUrl, which the PayPal service hits whenever a link containing the PaymentUrl is clicked.

The purpose of hitting this URL is to allow the programmer to run code that can check if an order is Verified. The Notify.aspx page does that. (Notice that the UI of this page doesn't show anything. It is only there to run code only.)

The code in Notify.aspx first determines if the order is Verified by the PayPal service by sending a POST request with a cmd=_notify_validate parameter. This causes PayPal to emit a response of 'VERIFIED" if the order is verified. Then the code has to check the response to see if it contains "VERIFIED". (I am assuming this was before the days of JSON, which would make this much easier ;)

Then, the Notify.aspx code changes the order's StatusID to StatusCode.Verified in the database.
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
 
Old October 5th, 2009, 05:56 AM
Authorized User
 
Join Date: Sep 2009
Posts: 24
Thanks: 3
Thanked 0 Times in 0 Posts
Default Not able to get notify verified in development phase

Thanx lee but my qus. is
Is it necessary to be on server for an application to get notification messages(notify.aspx) from paypal, or it can get it without ..?
i am not getting paypal notifications on localhost.
 
Old October 5th, 2009, 12:30 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Yes, in order for PayPal to be able to reach the URL that is specified by the notify_url parameter in the PaymentUrl querystring, that URL must be public-facing.

Localhost won't work here, because PayPal cannot send a request to localhost.
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
The Following User Says Thank You to Lee Dumond For This Useful Post:
ashwinirajp (October 6th, 2009)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 8, shop Beowulf BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 3 September 30th, 2010 03:59 PM
Web Shop TB1962 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 January 26th, 2009 05:24 AM
atlas and web shop gtjr92 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 October 21st, 2006 03:38 AM
Building an E-Shop Varg_88 Beginning PHP 0 March 15th, 2006 05:25 AM
WroxUnited Shop datae33 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 March 4th, 2006 06:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.