Use Case: Buying Courses on Educative

Experience the Square Node.js SDK in a simple use case of e-learning.

Since we have an understanding of the Square SDK, let's experience it in a simple use case of e-learning.

Assume that you're looking for a new job opportunity and want to equip yourself with some trendy skill set. You find out that you should learn system design and React development. You explore the internet, and land on Educative, where you find the courses of your choice. You'll need to follow the steps below to buy those courses:

  1. Create an order

  2. Generate an invoice

  3. Make a payment

Let's try to simulate these steps using the Square SDK.

Step 1: Create an order

To create an order, we need to mention the details of the items. As discussed earlier, we'll be experiencing the workflow of buying two courses. Therefore, we mentioned their details in lines 13–18 and lines 21–26, respectively, in the code below.

Get hands-on with 1400+ tech skills courses.