PayPal IPN & LC

Pierre Sahores sc at sahores-conseil.com
Tue May 1 15:02:33 EDT 2012


Jacque,

Did you try what occurs in modifying your code in the following way :

> on startup
>  if $REQUEST_METHOD = "POST" then -- this is the only kind PayPal sends
>    start using stack "liburl"
>    read from stdin until empty
>    put it into tOrderData
>    if tOrderData is in url ("file:paypalLog.txt" ) then
>        put "ok" -- or what ever Paypal would expect to get back from your script
>        exit startup -- duplicate notification
>    end if
>    put "cmd=_notify-validate&" before tOrderData -- required response
>    put "https://www.sandbox.paypal.com/cgi-bin/webscr" into tPPAddr
>    post tOrderData to tPPAddr
>    put it into tResponse -- "VERIFIED" or "INVALID"
>    processData tOrderData -- do whatever with the data here
>  end if
> end startup

The Paypal API should wait for a receipt confirmation response from your script before it quits.

Best,

Le 1 mai 2012 à 18:04, J. Landman Gay a écrit :

> on startup
>  if $REQUEST_METHOD = "POST" then -- this is the only kind PayPal sends
>    start using stack "liburl"
>    read from stdin until empty
>    put it into tOrderData
>    if tOrderData is in url ("file:paypalLog.txt" ) then exit startup -- duplicate notification
>    put "cmd=_notify-validate&" before tOrderData -- required response
>    put "https://www.sandbox.paypal.com/cgi-bin/webscr" into tPPAddr
>    post tOrderData to tPPAddr
>    put it into tResponse -- "VERIFIED" or "INVALID"
>    processData tOrderData -- do whatever with the data here
>  end if
> end startup

--
Pierre Sahores
mobile : 06 03 95 77 70
www.sahores-conseil.com





More information about the use-livecode mailing list