Creating an IAP service module
In this recipe, we will create a service module to be used by the service provider. This module will accept the IAP request from the customer and return the service result in the response.
Getting ready
We will create the iap_isbn_service
module. This service module will handle customer IAP requests. Customers will send book info requests with ISBN numbers. The service module will capture the credit from the customer account and return information such as the name, author, and cover image.
For ease of understanding, we will develop a service module by splitting it into two recipes. In this recipe, we will create a basic module that creates a table for the book's information. Upon customer request, the service provider will return the book information by searching in this table. In the next recipe, we will add the second part of the service module; in that module, we will add the code to capture the credits and return the book info.