Totally new to server-side programming and I am wondering about best practices regarding gathering information from a service like Stripe Payments, for example.
For some context -- a stripe customer can have multiple payment cards, one of which is considered the default payment card.
Now lets say a client hits my server and wants the default payment card for customer XX. My question is: should I be maintaining my own stripe database info, or should I just forward that request to stripe directly?
On the one hand, storing that information locally means I don't have to rely on a second network request to gather that information -- I can just send back directly what is in my database.
On the other hand, storing that information locally means I've got more code to maintain, and now I've got to worry about keeping it reflective of the true data over at stripe. That problem is solvable, but does the cost of doing so outweigh the negatives of extra API calls??
Any thoughts? I'd love to hear some opinions as this is very new to me :)
thanks!
Everything in your Stripe account is an object, whether you create it with the API or not. Your balance corresponds to a Balance object, you track customers with Customer objects, you store payment details in PaymentMethod objects, and so on. Even low-code and no-code integrations produce these objects.
It is built for its users, engineers Stripe's landing pages & online sandboxes play a key role at this. For each business area (Payment, Business operations, etc.), you can choose from integration guides, sample open source projects or no-code alternatives.
Stripe offers a simple platform for developers to accept online payments. They are a long-time user of MongoDB and have built a powerful and flexible system for enabling transactions on the web.
The Stripe API allows developers to access the functionality of Stripe. Some example API methods include sending invoices, accepting payments, managing subscription billing, and editing and managing account information.
Generally it's a good idea to keep a local copy of the data you get from Stripe API in your own database. Otherwise you will have to make too many calls to Stripe API which will slow down your server requests. In order to keep your local database synchronized with Stripe you should use the webhooks in Stripe.
https://stripe.com/docs/webhooks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With