PayPal express checkouts

Today I had the “joy” of trying to integrate with PayPal Express Checkouts. The work is actually pretty straightforward and easy – it’s the documentation that’s a problem. PayPal has what must be 1000s of different places for documentation and tons of different API’s (SOAP, REST, NVP, smoke signals, morse code, etc). All the documentation is terrible, and their sandbox site is terrible as well. Overall, it’s been an incredibly unpleasant experience.

Express Checkouts is the style of paying with PayPal (and there are tons of different types) where there’s a “Checkout with PayPal” button on your cart. Users click that, end up on PayPal, pick their payment method and shipping address and are then redirected back to your site to finish up the order. PayPal actually has a pretty decent image showing how this works on their site:

 

What they don’t have on their site is a single concise place where you can see everything you need to make those API calls. The closest page is the one that contains that image: https://developer.paypal.com/webapps/developer/docs/classic/express-checkout/ht_ec-singleItemPayment-curl-etc/

That page actually has almost everything you need. It doesn’t really ever call this out, but the examples on there use the NVP (or name-value pair) API. Not SOAP, not REST, not anything else – NVP.

The first puzzle piece that you’ll hit is that each of the calls require three pieces of authentication: USER, PWD and SIGNATURE. Note that the page listed above doesn’t mention what those are or how to get them, just that you need them. I Googled around and eventually found their OAUTH endpoint, but that’s not the type of auth you need for the NVP interface. These pieces of authentication info come from your profile on the main PayPal site. You’ll need a business account to make this work. I use a sandbox account (www.sandbox.paypal.com) to do all this work.

**One word of warning** – in keeping with the attitude of “make integrating with us as painful as possible,” not all of the links within the sandbox site point to the sandbox. If you’re not careful, you’ll end up clicking something that will take you to the live site. Keep checking your URL as you navigate around to make sure you stay within the sandbox.

Once you’re logged in as with a business account, you can find the USER, PWD and SIGNATURE pieces by clicking My Account -> Profile -> My Selling Tools -> API Access (actually, it’s the update link on the same line) and then View API Signature. I think the first time you try to get this it’s not View API Signature, but create or something similar. On that page is the magical information you need to make the calls.

From here the rest of the work is fairly straightforward. Using that original link above you can see the minimal amount of parameters needed to call each of the methods.

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>