Click here to Skip to main content
16,011,374 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: line graphs creation in html page Pin
NarVish12-May-09 18:47
NarVish12-May-09 18:47 
GeneralRe: line graphs creation in html page Pin
Ashfield12-May-09 21:32
Ashfield12-May-09 21:32 
QuestionNeed help in code-behind Pin
Senthil S11-May-09 21:25
Senthil S11-May-09 21:25 
AnswerRe: Need help in code-behind Pin
saanj12-May-09 20:50
saanj12-May-09 20:50 
GeneralRe: Need help in code-behind Pin
Senthil S17-May-09 19:45
Senthil S17-May-09 19:45 
GeneralRe: Need help in code-behind Pin
saanj17-May-09 20:34
saanj17-May-09 20:34 
QuestionHow to avoid printing Empty page ? Pin
I Sam Asir Aloysious11-May-09 20:23
I Sam Asir Aloysious11-May-09 20:23 
QuestionPaypal Web Site Pro Integration - Request and Response handling [modified] Pin
devvvy11-May-09 16:35
devvvy11-May-09 16:35 
To execute a simple NVP Operation to paypal such as:
<br />
https://www.sandbox.paypal.com/webscr<br />
&cmd=_express-checkout&token=tokenValue<br />
&AMT=amount<br />
&CURRENCYCODE=currencyID<br />
&RETURNURL=return_url<br />
&CANCELURL=cancel_url<br />

Should I initiate an AJAX request? It is stated in REF doc below that:
<br />
Executing NVP API Operations<br />
You execute an PayPal NVP API operation by submitting an HTTP POST request to a PayPal<br />
API server.<br />
...<br />
Interpret the Response<br />
PayPal processes your request and posts back a reponse in NVP format. Add code to your web<br />
application to do the following tasks:<br />
1. Receive the HTTP post response, and extract the NVP string.<br />
2. URL-decode the parameter values as described in "URL-Encoding" on page 14.<br />
3. Take appropriate action for successful and failed reponses.<br />


For instance:
<br />
REF: http://www.w3schools.com/ajax/ajax_xmlhttprequest.asp<br />
            <br />
            <html><br />
                <body><br />
                <script type="text/javascript"><br />
                function SubmitOrderToPaypal()<br />
                {<br />
                    var xmlhttp;<br />
                    var strUrl;<br />
<br />
                    strCmd = "https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=tokenValue&AMT=amount<br />
&CURRENCYCODE=currencyID&RETURNURL=return_url&CANCELURL=cancel_url";<br />
<br />
                    if (window.XMLHttpRequest)<br />
                      {<br />
                      // code for IE7+, Firefox, Chrome, Opera, Safari<br />
                      xmlhttp=new XMLHttpRequest();<br />
                      }<br />
                    else if (window.ActiveXObject)<br />
                      {<br />
                      // code for IE6, IE5<br />
                      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");<br />
                      }<br />
                    else<br />
                      {<br />
                      alert("Your browser does not support XMLHTTP!");<br />
                      }<br />
                    xmlhttp.onreadystatechange=function()<br />
                    {<br />
                    if(xmlhttp.readyState==4)<br />
                      {<br />
                      document.myForm.time.value=xmlhttp.responseText;<br />
                      }<br />
                    }<br />
                    xmlhttp.open("POST",strURL,true);<br />
                    xmlhttp.onreadystatechange=handleResponse;<br />
                    xmlhttp.send(null);<br />
                }<br />
<br />
            function handleResponse()<br />
            {<br />
            if (xmlhttp.readyState==4)<br />
              {<br />
               // TODO: How to parse Paypal response? Is this how response from Paypal is communicated? From doc it seems like Paypal returns NVP in form of POST/QueryString I just need to use Javascript to extract it. Is that right? How did they do it withut AJAX?<br />
document.getElementById("txtPaypalResponse").innerHTML=xmlhttp.responseText;<br />
              }<br />
            }<br />
                </script><br />
<br />
                <form name="myForm"><br />
<input type="image" name="submit" onclick="SubmitOrderToPaypal();" border="0"<br />
src="https://www.paypal.com/en_US/i/btn/btn_buynow_**.gif"<br />
alt="PayPal - The safer, easier way to pay online"><br />
                </form><br />
                </body><br />
            </html><br />


And now, how can I retrieve response from PayPal?

Many thanks

REF:
Web Site Pro Integration Guide
https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_WPP_IntegrationGuide.pdf

https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/library_documentation[^]

dev

modified on Monday, May 11, 2009 10:53 PM

QuestionUse cases Pin
Sparker11-May-09 2:32
Sparker11-May-09 2:32 
AnswerRe: Use cases Pin
Ashfield11-May-09 21:01
Ashfield11-May-09 21:01 
GeneralRe: Use cases Pin
Sparker18-May-09 0:03
Sparker18-May-09 0:03 
GeneralRe: Use cases Pin
Ashfield18-May-09 1:14
Ashfield18-May-09 1:14 
Questionhow to view orginal address format in textbox (using datereader) Pin
JC.KaNNaN11-May-09 1:37
JC.KaNNaN11-May-09 1:37 
AnswerRe: how to view orginal address format in textbox (using datereader) Pin
Ashfield11-May-09 21:00
Ashfield11-May-09 21:00 
QuestionResizing an image Pin
Brendan Vogt10-May-09 1:25
Brendan Vogt10-May-09 1:25 
AnswerRe: Resizing an image Pin
Ashfield11-May-09 1:20
Ashfield11-May-09 1:20 
QuestionAdding a reference to a javascript file displays a blank webpage Pin
Brendan Vogt9-May-09 22:44
Brendan Vogt9-May-09 22:44 
AnswerRe: Adding a reference to a javascript file displays a blank webpage Pin
Abhishek Sur10-May-09 10:36
professionalAbhishek Sur10-May-09 10:36 
Questionhow do you setup a Http Proxy? [modified] Pin
devvvy9-May-09 16:38
devvvy9-May-09 16:38 
QuestionTable not centering in Firefox Pin
Brendan Vogt9-May-09 3:52
Brendan Vogt9-May-09 3:52 
AnswerRe: Table not centering in Firefox Pin
Brendan Vogt9-May-09 3:56
Brendan Vogt9-May-09 3:56 
QuestionJavascript To Control Page Using JoyStick Pin
Yadav Akash7-May-09 19:41
Yadav Akash7-May-09 19:41 
AnswerRe: Javascript To Control Page Using JoyStick Pin
Abhijit Jana7-May-09 21:24
professionalAbhijit Jana7-May-09 21:24 
GeneralRe: Javascript To Control Page Using JoyStick Pin
Yadav Akash13-May-09 0:49
Yadav Akash13-May-09 0:49 
Questionincrease z index for a button/link in a div Pin
Yogesh Jamkhindikar6-May-09 12:00
Yogesh Jamkhindikar6-May-09 12:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.