Issuing Refunds

One of the first things we need to allow administrators to do is refund purchases. In a way, refunds are a miniature of everything that caused me to want to write this book, which is to say that their apparent API simplicity covers a tremendous amount of business logic complexity.

Refunds are actually even easier in the Stripe API than purchases, since we don’t need to validate a credit card or other purchase method. In fact, we could choose to do refunds from the Stripe dashboard and just catch a webhook on our side to process the data.

But there are all kinds of issues we need to deal with:

  • Who can authorize a refund?
  • How does somebody authorize a refund?
  • Can we issue a partial refund? If so, does that mean we can allow multiple ...

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.