Accepting PayPal Transactions

As we build our PayPal transaction manager, we’re trying to solve two somewhat separate problems. The immediate problem, of course, is setting up our application to handle PayPal transactions. The larger problem is how to gracefully handle changes to our requirements that break the assumptions the code is already making. In this case, the code we’ve created so far in this book assumes that all payments use Stripe and take Stripe tokens. As we go forward, we need to be aware that the way we add PayPal into our code base could have important consequences for how easy or difficult it is to make future changes to our business logic.

To accept PayPal for payments, several points in our code need to be adjusted:

  • Our shopping ...

Get Take My Money now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.