• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

8. The PayPal Web Services API > 92. Handle Transaction Errors within the API W...

Handle Transaction Errors within the API Wrapper

Write one function to handle all transaction errors and simplify your API code.

If you were to take a close look at the objects created by your web reference in Visual Studio .NET (double-click the PayPal API web reference in your project and navigate to the web reference classes), you’d notice that the ResponseType classes ( RefundTransactionResponseType, TransactionSearchResponseType, and GetTransactionDetailsResponseType) extend the same AbstractResponseType class. This unified error-handling approach provides you the same response object, regardless of which transactional class was called. This means you can write one error-checking routine that displays the correct message if an error occurs in any of these API transactions.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint