Total.js Platform
Total.js Platform

Total.js Platform news and tutorials

Flow v10 | CodeCon.sk 2022 | Case study

Flow v10 | CodeCon.sk 2022 | Case study

An example of how we used Flow v10 during CodeCon.sk 2022 for accepting payments via Stripe from an eshop with some clothes and food.

Components used:

  • Stripe Common / Stripe Checkout session
  • SuperFaktura Connection / SuperFaktura Invoices
  • HTTP Route
  • JSON Schema Validator
  • Middleware Function / Middleware Exec
  • NoSQL
  • QR Code Generator
  • Code
  • etc.

Screenshot 2022-05-30 at 9.03.59.png

As you can see in the image above we used a HTTP Route component with path /api/stripe/checkout/create to recieve an order data which we passed through JSON Schema validator to make sure the data is in correct format. Then we saved the data using NoSQL database and created a Stripe Checkout session and redirected the user to the url provided by Stripe.

Once the user returned from Stripe payment page we verified the payment was successful and created an Invoice using SuperFaktura Invoices which we then sent to the user via email along with QR codes(only for food) generated by QR Generator component.

Although the flow on the image above might look complicated, it is not. There are quite a few components like Debug log which are not necessary to run the app as well as Triggers and some of NoSQL components which were only used for testing purposes.

This usecase also gave as a few ideas about how we can improve some components as well as which components we could create in order to make it easier to create API services like this.


Documentation