Thursday, November 30, 2006

PayPal API ASP 3.0 Example Call

Just playing with the PayPal API in classic ASP, we have it running in .Net already, but the new version is much easier to use. The PayPal API is a great tool for building complex e-commerce applications based on the PayPal platform. The MassPay API call is our favorite. It lets us pay anyone programatically without logging into our PayPal account.

Ok, I thought I'd throw this up there for some people who had some issues with this. It is a fully functioning call for the SOAP PayPal API using the "three token" method of authentication at PayPal. It is a little different than the SSL Cert method. This one is much easier to work with as it relies on a copy n paste signature found in your Paypal API profile.

The XML parsing could be a little more clean. I'm a little weary of using GetElementByName, but I've read it is actually quite efficient. I'm not an XML guru, but it seems to run fairly well.
You will need to change four values in the code below. The username, password, and signature values (as obtained in your PayPal API Profile). The username/password is NOT the one to your PayPal account. Also, change the Transaction Id to one in your account. You can test with the one there, but it will display a call error (nicely).

Download the example here:
PayPal API Classic ASP Example Call

Have fun,
Shannon