[Lift] Re: HTTP Client?

2008-10-01 Thread jon
Is there a way to set the authToken in the instance rather than globally? On Sep 23, 12:29 pm, Tim Perrett <[EMAIL PROTECTED]> wrote: > Hey guys, > > Ok, i've abstracted it all out into a class which you call a little > like this: > >     var paypal: PayPal = new PayPal("sandbox") >     paypal.tr

[Lift] Re: HTTP Client?

2008-10-01 Thread Tim Perrett
Yea i'll probably make it the constructor - seems a bit more logical. My plan is to implement IPN, then roll up the IPN and PDT stuff into a maven module and release it Cheers Tim On Oct 1, 5:45 pm, jon <[EMAIL PROTECTED]> wrote: > Is there a way to set the authToken in the instance rather than

[Lift] Re: HTTP Client?

2008-09-29 Thread David Pollak
On Mon, Sep 29, 2008 at 4:07 PM, Tim Perrett <[EMAIL PROTECTED]> wrote: > > > > Do you mean PayPal's servers make an HTTP request on your server? > > > > Or do you mean that the user's browser is redirected from PayPal's site > to > > your site? > > Of course - PayPal makes a post to our server wi

[Lift] Re: HTTP Client?

2008-09-29 Thread Tim Perrett
> Okay... my mistake.  Yes, you have to set this up in Boot with a DispatchPf > to handle the incoming request. Thats what I thought - this is why I was asking about ajax_request :-) Do my previous ramblings make any more sense now? Cheers Tim --~--~-~--~~~---~--~-

[Lift] Re: HTTP Client?

2008-09-29 Thread Tim Perrett
> Do you mean PayPal's servers make an HTTP request on your server? > > Or do you mean that the user's browser is redirected from PayPal's site to > your site? Of course - PayPal makes a post to our server with all the transaction information. This is the PayPal IPN system :) Cheers Tim --~--~

[Lift] Re: HTTP Client?

2008-09-29 Thread David Pollak
On Mon, Sep 29, 2008 at 3:52 PM, Tim Perrett <[EMAIL PROTECTED]> wrote: > > > Hmmm... I may be misunderstanding what you're saying... but... > > > > In the PayPal landing, I'd update the user's state (e.g., credit their > > account), add something to S.notices and then redirect the browser to > ei

[Lift] Re: HTTP Client?

2008-09-29 Thread Tim Perrett
> Hmmm... I may be misunderstanding what you're saying... but... > > In the PayPal landing, I'd update the user's state (e.g., credit their > account), add something to S.notices and then redirect the browser to either > "/" or some other page.  So, no HTML required on the landing page.  Also, > t

[Lift] Re: HTTP Client?

2008-09-29 Thread David Pollak
On Mon, Sep 29, 2008 at 11:02 AM, Tim Perrett <[EMAIL PROTECTED]> wrote: > > > > You don't have to put this in LiftRules. You can just assign the > call-back > > URL to a session-specific handler. The URL will be session-specific, > will > > appear just before the hand-off to PayPal and disappea

[Lift] Re: HTTP Client?

2008-09-29 Thread Tim Perrett
> You don't have to put this in LiftRules.  You can just assign the call-back > URL to a session-specific handler.  The URL will be session-specific, will > appear just before the hand-off to PayPal and disappear just after the > PayPal call-back completes.  It can be something fixed (like > "/pa

[Lift] Re: HTTP Client?

2008-09-29 Thread David Pollak
On Fri, Sep 26, 2008 at 2:34 AM, Tim Perrett <[EMAIL PROTECTED]> wrote: > > Great feedback - thanks guys! > > I'll re-jig the PDT stuff to make it more like your suggestions. > > Regarding the IPN pay pal stuff - I was having a think about this and > thought that it would be good to do something a

[Lift] Re: HTTP Client?

2008-09-29 Thread Tim Perrett
Hey David, What do you think of my suggestion about creating something similar to ajax_request? I havent put any time into this yet as I wasnt sure if it was a good idea or not. Cheers, Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed

[Lift] Re: HTTP Client?

2008-09-29 Thread David Pollak
On Fri, Sep 26, 2008 at 3:50 PM, Marc Boschma <[EMAIL PROTECTED]<[EMAIL PROTECTED]> > wrote: > > Given Lift's focus on security I envisioned that the POST URL would > contain a random element, to reduce the threat of fake PayPal > interactions. It is a small risk, but then it is the small risks th

[Lift] Re: HTTP Client?

2008-09-26 Thread Marc Boschma
Given Lift's focus on security I envisioned that the POST URL would contain a random element, to reduce the threat of fake PayPal interactions. It is a small risk, but then it is the small risks that usually allow a hacker in, eventually. David said there was support for per session dispatc

[Lift] Re: HTTP Client?

2008-09-26 Thread Tim Perrett
Great feedback - thanks guys! I'll re-jig the PDT stuff to make it more like your suggestions. Regarding the IPN pay pal stuff - I was having a think about this and thought that it would be good to do something along the same lines of ajax_requst. For instance, when you configure IPN you have t

[Lift] Re: HTTP Client?

2008-09-24 Thread Kris Nuttycombe
This reminds me -- in Lift, I've frequently seen the pattern of utilizing a companion object's apply() methods as factories. Perhaps it's just me, but this seems a little less intuitive than having an explicitly named constructor method that is in some way descriptive of the state in which the rel

[Lift] Re: HTTP Client?

2008-09-24 Thread David Pollak
Kris Nuttycombe wrote: > If you're going to take that approach, why not just make the > constructor or factory method ensure that the object is in a valid > state to begin with? When I write immutable objects, they usually > don't have any setters for that very reason. It doesn't make sense to >

[Lift] Re: HTTP Client?

2008-09-24 Thread Viktor Klang
Also, when writing immutable objects, constructors suck since they do not encourage object sharing... On Wed, Sep 24, 2008 at 4:36 PM, Kris Nuttycombe <[EMAIL PROTECTED]>wrote: > > If you're going to take that approach, why not just make the > constructor or factory method ensure that the object

[Lift] Re: HTTP Client?

2008-09-24 Thread Kris Nuttycombe
If you're going to take that approach, why not just make the constructor or factory method ensure that the object is in a valid state to begin with? When I write immutable objects, they usually don't have any setters for that very reason. It doesn't make sense to me that one would construct a PayP

[Lift] Re: HTTP Client?

2008-09-23 Thread David Pollak
Tim, I like the work, but I tend not to like mutable data structures (stuff with properties that one sets.) I'd structure things such that the PayPal object's "setters" return a new, immutable instance of the PayPal object, so you're code would look like: val pp: PayPal = new PayPal("sandbox

[Lift] Re: HTTP Client?

2008-09-23 Thread Tim Perrett
Thanks Derek :-) I have commited any code for ages, so its about time I did! My plan is this - once I get this roll out of the site im doing now (which just needs PDT) done, I'll add the IPN functions to it. From the docs, it looks pretty straight forward. You can configure a whole bunch of opti

[Lift] Re: HTTP Client?

2008-09-23 Thread Derek Chen-Becker
Tim, you rock :) On Tue, Sep 23, 2008 at 10:29 AM, Tim Perrett <[EMAIL PROTECTED]> wrote: > > Hey guys, > > Ok, i've abstracted it all out into a class which you call a little > like this: > >var paypal: PayPal = new PayPal("sandbox") >paypal.transactionToken = S.param("tx").openOr("") >

[Lift] Re: HTTP Client?

2008-09-23 Thread Tim Perrett
Hey guys, Ok, i've abstracted it all out into a class which you call a little like this: var paypal: PayPal = new PayPal("sandbox") paypal.transactionToken = S.param("tx").openOr("") paypal.execute("pdt") And as your authentication token is global to your account, you can specify it

[Lift] Re: HTTP Client?

2008-09-23 Thread David Pollak
Tim Perrett wrote: > >> Lift has a little know feature that makes this kind of thing super simple >> and secure. >> >> S.addHighLevelSessionDispatcher(name: String, dispatch: >> LiftRules.DispatchPf) allows you to, on a session-by-session basis, specify >> what to do with a given URL. This al

[Lift] Re: HTTP Client?

2008-09-23 Thread Tim Perrett
> Lift has a little know feature that makes this kind of thing super simple > and secure. > > S.addHighLevelSessionDispatcher(name: String, dispatch: > LiftRules.DispatchPf) allows you to, on a session-by-session basis, specify > what to do with a given URL.  This allows you to have a PayPal land

[Lift] Re: HTTP Client?

2008-09-23 Thread David Pollak
On Tue, Sep 23, 2008 at 5:13 AM, Tim Perrett <[EMAIL PROTECTED]> wrote: > > > > On Sep 23, 12:36 pm, David Pollak <[EMAIL PROTECTED]> wrote: > > I'd love to have a PayPal module in Lift. Are you able to contribute > > this part of your code into the Lift codebase? > > That was my plan! :-D > > Ri

[Lift] Re: HTTP Client?

2008-09-23 Thread Tim Perrett
On Sep 23, 12:36 pm, David Pollak <[EMAIL PROTECTED]> wrote: > I'd love to have a PayPal module in Lift.  Are you able to contribute > this part of your code into the Lift codebase? That was my plan! :-D Right now im thinking of using bind to post back to the lift app, then post it on to paypa

[Lift] Re: HTTP Client?

2008-09-23 Thread David Pollak
I'd love to have a PayPal module in Lift. Are you able to contribute this part of your code into the Lift codebase? Tim Perrett wrote: > Hey guys, > > Just a quick one - im putting together a little donation page on a > lift app im building and its using paypal for the donation / buynow > proce

[Lift] Re: HTTP Client?

2008-09-23 Thread Viktor Klang
Can't you use HTTPConnection? http://java.sun.com/j2se/1.4.2/docs/api/java/net/HttpURLConnection.html Cheers! -Viktor On Tue, Sep 23, 2008 at 12:17 PM, Tim Perrett <[EMAIL PROTECTED]> wrote: > > Hey guys, > > Just a quick one - im putting together a little donation page on a > lift app im bui