I am not only new to this community, but new to coding an API. I need to create an API for a project and there are too many variables with regards to API types, Languages etc for me to know where to start. Perhaps if I may present some details about the project, you will be able to offer some advice. Please!.
I have built a woocommerce site (for free) for a prisons in Thailand where users can send letters and some money online to their loved ones in prison. The user registers, buys a voucher (linked to a prisoner), gets an order number, goes to any 7 Eleven - Counter Service - to pay. CS (Counter Service) sends an XML request from 7 Eleven to an API with a unique Tx ID and the user's order number. The content of the XML request makes a MySQL database queries (generated from the woocommerce order) to check transaction details using the order number as reference. The API returns an XML response with the amount payable. CS sends another XML message (that references the original XML request via an ID value) that confirms the transaction and the payment received, and the database needs to be updated for the order to reflect that it has been paid.
Below is some specs as well as sample XML request response.
- XML Format to request and response data - TX_ID is the key to transmit data between Counter Service System and Provider. - Name of Method or Function to be called into web service and Publish shall be having a signature is “public String service(String xmlInput)” - Method named as "service", the input and return parameter is a String. In the case of .NET, name of the String data type can be declared differently.