Pergunta

If this question is too broad for Q&A format, I'd appreciate a pointer on where to ask it.

Suppose that you're using Stripe (or some similar service) to manage the payments for a service of some sort. Stripe has built-in support for recurring payments, a payment gateway.

What I'm struggling to understand is how much of that logic is mirrored over to the application?

For example:

  • Where is the subscription/payment data stored? Is it mirrored in some local DB or just wrapped from Stripe API?
  • How does one handle various states of a subscription that can't be fulfilled (card declined, card missing, card fraudulent)? Suppose that Stripe only handles payments and not subscriptions, how does one invalidate a subscription if a payment fails?

In other words, should User.first.subscription return something that's stored in the application or essentially just make a call to Stripe every single time? If that's the case, should my application not even have a Subscription model as it's essentially just piped in from Stripe?

My gut is telling me in this case Stripe should handle the entirety of the payment and subscription logic and the service application itself should only wrap Stripe, is this fair to say?

Foi útil?

Solução

The Death of Stripe

Read all about it, in the now future present day. Strip closes its doors and the numerous online stores suddenly stop working.

Back to the real present day.

Is that future the correct one to be aiming at?

Chances are your application might also like to integrate with paypal, or Stripe the replacement. As much as these services can provide sweet feature™ you probably want to offer the same kind of subscription/receipting/transaction management across payment services that don't.

Your particular situation may be different. Perhaps you have a Gold plated and bankable requirement to only ever use the one payment system (being a subsidiary company might be such a case), in which case you could probably get away with just using the service directly. You will run the risk of that service being down, etc... but as that is your only provider anyway, its not like the risk wasn't already there.

On the otherhand it usually a good idea to keep your own payment audit trail, and records. Particularly if you have to disagree with that provider over whether or not a payment was made. It might also be helpful for providing that information even when the payment service is down.

Licenciado em: CC-BY-SA com atribuição
scroll top