Web Hosting Vodahost    

Home Take The Royal Tour! Order Now Features Prices
Go Back   Web Hosting > Soholaunch & Various Shopping Carts We offer > Various Shopping Carts > PayPal Shopping Cart Creator

Notices

PayPal Shopping Cart Creator This section is dedicated to setting up your PayPal shopping cart in the BlueVoda Website Builder for single item purchases, multi-item shopping cart purchases, subscription creations and donations.

Reply
 
Thread Tools
  #1  
Old 05-12-2009, 04:32 AM
Private First Class
 
Join Date: May 2009
Posts: 6
Default Paypal request and response - Web Site Pro Integration

To execute a simple NVP Operation to paypal such as:
Code:
https://www.sandbox.paypal.com/webscr
&cmd=_express-checkout&token=tokenValue
&AMT=amount
&CURRENCYCODE=currencyID
&RETURNURL=return_url
&CANCELURL=cancel_url
Should I initiate an AJAX request? It is stated in REF doc below that:
Code:
Executing NVP API Operations
You execute an PayPal NVP API operation by submitting an HTTP POST request to a PayPal
API server.
For instance:
Code:
http://www.w3schools.com/ajax/ajax_xmlhttprequest.asp
            
            <html>
                <body>
                <script type="text/javascript">
                function SubmitOrderToPaypal()
                {
                    var xmlhttp;
                    var strUrl;

                    strCmd = "https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=tokenValue&AMT=amount
&CURRENCYCODE=currencyID&RETURNURL=return_url&CANCELURL=cancel_url";

                    if (window.XMLHttpRequest)
                      {
                      // code for IE7+, Firefox, Chrome, Opera, Safari
                      xmlhttp=new XMLHttpRequest();
                      }
                    else if (window.ActiveXObject)
                      {
                      // code for IE6, IE5
                      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
                      }
                    else
                      {
                      alert("Your browser does not support XMLHTTP!");
                      }
                    xmlhttp.onreadystatechange=function()
                    {
                    if(xmlhttp.readyState==4)
                      {
                      document.myForm.time.value=xmlhttp.responseText;
                      }
                    }
                    xmlhttp.open("POST",strURL,true);
                    xmlhttp.onreadystatechange=handleResponse;
                    xmlhttp.send(null);
                }

            function handleResponse()
            {
            if (xmlhttp.readyState==4)
              {
               // TODO: How to parse Paypal response? Is this how response from Paypal is communicated? 
document.getElementById("txtPaypalResponse").innerHTML=xmlhttp.responseText;
              }
            }
                </script>

                <form name="myForm">
<input type="image" name="submit" onclick="SubmitOrderToPaypal();" border="0"
src="https://www.paypal.com/en_US/i/btn/btn_buynow_**.gif"
alt="PayPal - The safer, easier way to pay online">
                </form>
                </body>
            </html>
And now, how can I retrieve response from PayPal?

Many thanks

REF:
Web Site Pro Integration Guide
https://cms.paypal.com/cms_content/U...ationGuide.pdf
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old 05-12-2009, 04:50 AM
Private First Class
 
Join Date: May 2009
Posts: 6
Default Re: Paypal request and response - Web Site Pro Integration

Seems like Paypal response is also in form of POST/NVP formatted query string:
Code:
Interpret the Response
PayPal processes your request and posts back a reponse in NVP format. Add code to your web
application to do the following tasks:
1. Receive the HTTP post response, and extract the NVP string.
2. URL-decode the parameter values as described in “URL-Encoding” on page 14.
3. Take appropriate action for successful and failed reponses.
So my javascript function above "handleResponse" should basically parse response query string? How did they do it without AJAX?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old 05-12-2009, 04:52 AM
Private First Class
 
Join Date: May 2009
Posts: 6
Default Re: Paypal request and response - Web Site Pro Integration

Paypal doc here: https://cms.paypal.com/us/cgi-bin/?c..._documentation
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old 05-12-2009, 05:17 AM
Karen Mac's Avatar
General & Forum Moderator
 
Join Date: Apr 2006
Location: X marks the spot
Posts: 8,474
Send a message via MSN to Karen Mac
Default Re: Paypal request and response - Web Site Pro Integration

What are you trying to integrate to? This isnt a button code that you just generate.. this is for incorporation to a database driven cart system.

Karen
__________________
KMAC Enterprise
Missouri Free Classified Ads
Charming Noveltees~Sports Logos Charms

I've learned that artificial intelligence is no match for natural stupidity!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old 05-12-2009, 05:29 AM
Private First Class
 
Join Date: May 2009
Posts: 6
Default Re: Paypal request and response - Web Site Pro Integration

thanks, and yes my app/shopping cart is database driven but i don't see how this has to do with above code fragment.

I'm using "Pro Integration" as supposed to "Standard Integration" - I *think* [Am I right?] it allows Direct Payment - i.e. accept credit card without leaving my site.

Now, with Pro Integration {whether "Direct Payment API" or "Express"} you'd need to send request to Paypal and receive response from Paypal. I suppose you're NOT going to navigate away from your site [Am I right?], which is why AJAX comes in. Send a request via POST, then AJAX handler will invoke "handleResponse" (then parse response query string to stripped out Paypal Name-value pairs response code). Now, this should be same whether your cart items are hard coded on your webpage or dynamically rendered as driven by database.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old 05-12-2009, 05:53 PM
Karen Mac's Avatar
General & Forum Moderator
 
Join Date: Apr 2006
Location: X marks the spot
Posts: 8,474
Send a message via MSN to Karen Mac
Default Re: Paypal request and response - Web Site Pro Integration

So.. what are you using for your site? This will determine how you set up the AJAX handler. If you are using blue voda then you will have to have this CUSTOM done and use a data base driven system for the cart to sum totals, hold those totals and checkout on your site and transmit the information to paypal. This can be done on a form for EACH and every product.. but again.. you will need special programming for this.

You will also need ssl and dedicated ip.
Karen
__________________
KMAC Enterprise
Missouri Free Classified Ads
Charming Noveltees~Sports Logos Charms

I've learned that artificial intelligence is no match for natural stupidity!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old 05-12-2009, 06:07 PM
Private First Class
 
Join Date: May 2009
Posts: 6
Default Re: Paypal request and response - Web Site Pro Integration

Thanks and sorryi just got started with paypal

after reading for a day I think I know how to do standard integration/request/IPN and encrypted website payments now... i would have hoped paypal doc be more straight forward in certain places.

Couple of examples which don't compile (bad ref to capicom dll or needing a header buffer.h from OpenSSL). And "Encrypt button code" in their doc was so misleading because it really is form hidden param which you're encrypting in Website Payment Encryption, not button code. And doc don't get me started fast it was overall a time consuming experience forsomething simple. Particularly their code samples is a waste of time glad i found samples (documented too) elsewhere so I don't need to re-engineer the wheel.

and why you say you need fix IP? Can I use dynamic ip with mapped domain?

Anyway thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old 05-12-2009, 06:16 PM
Karen Mac's Avatar
General & Forum Moderator
 
Join Date: Apr 2006
Location: X marks the spot
Posts: 8,474
Send a message via MSN to Karen Mac
Default Re: Paypal request and response - Web Site Pro Integration

In order to process credit cards onsite it is a REQUIREMENT. You must have dedicated ip for encryption and ssl. You also must comply with PCI requirements set forth by the credit card industry itself for accepting and recieving payment for your services or products. This requires a background investigation and a credit check! Since you have paypal pro set up.. i suggest you read their information on what is required for maintaining their services for ONSITE payments

Theres much more to it than simply integrating it and jumping on the band wagon

Karen
__________________
KMAC Enterprise
Missouri Free Classified Ads
Charming Noveltees~Sports Logos Charms

I've learned that artificial intelligence is no match for natural stupidity!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old 05-12-2009, 06:22 PM
Private First Class
 
Join Date: May 2009
Posts: 6
Default Re: Paypal request and response - Web Site Pro Integration

great so this is actually compliance issue.

Thanks for tip, I'm now doing Standard Integration as supposed to Direct Payments and have spotless credit record (up to now!)

biz registration will come soon. SSL and perhaps dedicated IP after...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old 05-12-2009, 06:49 PM
Karen Mac's Avatar
General & Forum Moderator
 
Join Date: Apr 2006
Location: X marks the spot
Posts: 8,474
Send a message via MSN to Karen Mac
Default Re: Paypal request and response - Web Site Pro Integration

Quote:
Originally Posted by devvvy View Post
great so this is actually compliance issue.

Thanks for tip, I'm now doing Standard Integration as supposed to Direct Payments and have spotless credit record (up to now!)

biz registration will come soon. SSL and perhaps dedicated IP after...
Well its not just compliance.. you have to protect peoples financial information. You will be taking their credit card information which can be stolen and used elsewhere if you dont encrypt it.. which is why you need the dedicated ip and ssl. If your site gets nailed and your customers credit information is used for purchases elsewhere.. YOU ARE LIABLE.. and you could be subject to criminal prosecution.. thats why there are agreements in place for doing business with credit cards and you SIGN THEM.

Karen
__________________
KMAC Enterprise
Missouri Free Classified Ads
Charming Noveltees~Sports Logos Charms

I've learned that artificial intelligence is no match for natural stupidity!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT +1. The time now is 04:44 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC7
2005-2009 VodaHost Web Hosting Your Perfect Web Host - All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203