Insights

Wrapping up your eCommerce business with a solid and secure payment infrastructure

An overview over Stripe and how is a great solution to secure an eCommerce payment component.

in IT Strategy, Software development By Ricardo Ferreira, Software Engineer

Online businesses struggle with several elements, namely, processing payments, invoices or even the control of revenue per customer. These components are cumbersome to develop and a critical part for the success of any eCommerce business, how can this be optimised securely and reliably? Let us introduce to you to Stripe.

Stripe is an online payment and processing solution for any internet business, allowing to deal with payments core infrastructure seamlessly. This solution has progressed to the best choice of payments over the internet for developers.

But why, Stripe?

The nightmare of 3 months of full payment integration solutions is over. This business-oriented allows to set up multiple types of products with different payment mechanisms, including payment reversal management. The ability to answer to any eCommerce businesses needs is crucial to the success of Stripe, enabling the option to sell over the internet in 25 countries. Flexibility is vital, and most of the work is already done through Stripe Dashboard, which is quite simple and straight forward, allowing a business owner to focus on the implementation of the website and usability features.

Some key points on Stripe

  • Access to numerous options to set up and evaluate business growth.
  • Set up a safe environment for your customers to manage their payments or subscriptions by setting up a Customer Portal, with the same look and feel of the business image.

Note: as a reference, all the examples in this article are from Stripe API.

Showcase

Online businesses typically use the subscription method as their business model. How could one give customers access to manage their subscriptions and check payments?

The following can resume this process in 3 simple steps.

1. Beginning – Do the Stripe QuickStart

QuickStart will guide you in 3 phases:

  • Obtaining the API Keys

Stripe API authenticates your API requests using your account's API keys. If you do not include your key when making an API request or use one that is incorrect or outdated, Stripe returns an error.

Treat your API key as any other password, a secret. Grant access only to those who need it to configure the platform or app and maintain the payment infrastructure. Ensure it is kept out of any version control system you may be using. As a suggestion, protect the control key using a password manager or secrets management service.

  • Installing Stripe CLI

Provide official libraries for different programming languages and mobile platforms.

  • Make a test API request

Test your code to make sure you can communicate with Stripe API. Dashboard from STRIPE will register all actions, so I would suggest to check it there also.

2. Halfway – Register your costumers

Customer registration is vital when talking about subscriptions. Stripe needs to be aware of who is getting a subscription, so it will briefly be given here a hint on two cases scenarios:

Upcoming business

  • Create your customer in Stripe after verifying his email.

Migrating business

  • We would recommend implementing after authentication of your customer and email confirmation.

Bonus - First check if his already created before creating the same client reference again.

3. Final step – Customer Portal

A Checkout Session represents your customer's session as they pay for one-time purchases or subscriptions through Checkout. Stripe recommends creating a new Session each time your customer attempts a payment. Once payment is successful, the Checkout Session will contain a reference to the customer, and either the successful PaymentIntent or an active Subscription.

To redirect the customer to the assigned Portal, we need one requirement, to be logged in, after that point, you can get his ID by using Stripe API and create them a URL session.

Conclusion

Stripe is a robust and established payment infrastructure, with numerous features that will save you a lot of time and development time. The out-of-the-shelf integration with multiple currencies, financial entities, different countries, allows any business to have a reliable payment solution with a well-covered API that will guide and support any business, no matter the service area.

In case you need any clarification on how-to, or how Nearshore IT as Hexis can support in implementing this solution, let us know.

Get in touch