I have to admit I am still quite new to Paypal APIs. When I started to learn how to implement a payment integration solution using paypal, I felt like the paypal website and its developer websites are quite overwhelming and didn't know where to start. So many payment types, so many documents, guides, samples...
However, In the end, I figured out the express checkout API is most suitable for the solution. The official information/guild of Paypal Express Checkout can be found here.
So basically two options are available for calling the express checkout API as with the other payment methods: name value pair (NVP) and SOAP web services. Using a provided SDK to make these API calls are not necessary as long as you understand the protocol to make the call (e.g., supplying the right parameters and etc). However, an SDK usually can help reduce the coding work.
However, In the end, I figured out the express checkout API is most suitable for the solution. The official information/guild of Paypal Express Checkout can be found here.
So basically two options are available for calling the express checkout API as with the other payment methods: name value pair (NVP) and SOAP web services. Using a provided SDK to make these API calls are not necessary as long as you understand the protocol to make the call (e.g., supplying the right parameters and etc). However, an SDK usually can help reduce the coding work.
PayPal API SDK
The paypal website provides samples for the making the express checkout call. However, it seems the samples are still using an old version of PayPal API SDK at the time of writing this post (I am talking about Java version of the SDK) while new SDK is already out.So let's talk about the new Paypal API Java SDK. The new SDK boasts that it does not require any third party libraries, which is good. However, as some one pointed out, the SDK uses very verbose method names, thus not very developer friendly.
Apart from verbose method names, there are a few things i found not very comfortable with (but can be worked around):
Preconfigured Subject in properties file
Paypal allows one paypal account to grant permission to another paypal account to perform some payment operations via API calls. The subject field is used to record the paypal account who gave the permission for such operations. When developing a general payment solution, it is always desirable to have this field set to different accounts for different customers. However, in the new Paypal SDK, this field is configured in the properties file and it is hard to change after the SDK is initialized.The work around I found is as follows:
Mandatory AppId field in properties file
The AppId is not required for express checkout API, however, if left blank, an exception will be thrown. It has been confirmed as a bug. The workaround is simple: use the provided AppId in the SDK sample code.
Digital Goods
Express Checkout is quite good way for implementing digital good selling/buying. The following are tips for implementing digital goods payment system:First, selling digital goods should be enabled in the seller's Paypal account. The seller's Paypal account should be a business account, to my knowledge.
Second, since digital goods does not require physical address delivery, the payment process can be simplified. For example, people can just see a "buy" button instead of a "continue" button on the Paypal site. This can be achieved by appending "useraction=commit" to the redirected Paypal URL. as the following
https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=TOKEN&useraction=commit
However, when the user clicks the buy button and Paypal redirects back to the website, the website still need to make GetExpressCheckout and DoExpressCheckout API calls to finish the actual transaction, as this stackflow question mentioned.
No comments:
Post a Comment