O'Reilly logo

Take My Money by Noel Rappin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Server-Side Failure

We’ve got our token and we’ve sent our form to the server for the actual credit card charge. Now we have to deal with a wide array of things that can go wrong in the server request.

We’re going to see some code suggestions for handling various kinds of problems that might come up, but it’s important to realize that error handling is not a one-size-fits-all kind of proposition. The general principles are going to likely need some adaptation to the specific business logic of your application.

Very broadly, our purchase process has three steps:

  • The pre-purchase checklist. We must make sure we have all the data we need, and that the data is valid and in the necessary format.

  • The actual API call, which we need to make sure is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required