Defining a transfer entity

On the left-hand side navigation pane, we see the Core | Browser menu. This is where we can see all the data on our Parse platform. There are already some built-in classes, but we are going to define a new class to help do the money transfer.

Click on Create a class in the Core | Browser menu. A dialog box, as shown in the following screenshot, will appear. We will use it to name our new class, Transfer. This will be our main entity responsible for mobile payment and, of course, money transfer:

Figure 8.4: A dialog for defining a new class in Parse

Then we need to set up some new columns for this entity. We define the following columns:

  • fromThe mobile number to pay money.
  • toThe mobile number to receive money.
  • amount: The amount of money to pay.
  • sent: A flag needs to be set to true when we want to start to process the transaction. If this field is null or false, the WebHook (see next) will just receive data and do nothing.
  • processedA flag will be automatically set to true if the transaction is finished processing.

How can we use this class? Using the dashboard, as shown in the following screenshot, we set mobile numbers for the  from, to, and amount columns. Then, when we are ready, just set the sent column to true.

If the processing goes wrong, the sent flag will be reset to null automatically by the WebHook:

Figure 8.5: Browsing the Transfer class using the dashboard
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset