Tuesday, November 29, 2011

ftp Based Banking API Integrations

Lots of financial organizations use ftp as the mean of money transferring gateway to reduce remittance cost. Usually they have a ftp server to which their clients have different user credential to get access. At least two different directories remain as default in every user's ftp directory named as "In" and "Out". Some of these money transferring agencies have their own format of text for getting order of financial activity, some of them doesn't have any, but they usually make contact with their client for understanding each other. For executing a money transfer or any other financial activity client should get access to the ftp directory and add a text order file in ftp "In" directory. Companies simultaneously checks every client's ftp "In" directories for checking new orders manually or automatically and if they find any new file, then they starts to execute the order.

Every text order file has a portion where it saves the current status of the execution of the order. For a new order client keep the status as "Pending" or "0:Pending". When the financial organization, to which this order came, receives the order and starts to execute they changes the status as "Processing" or something like that. After the completion of the order, they copy the file and saves it to ftp "Out" directory with status changed to "Successfully transferred" or something like that.

The client also simultaneously checks the ftp "Out" directory for knowing if the order is completed. They check files manually or by their server's CRON job of script which automatically checks the ftp directory. When they find a new text file at "Out" directory, they checks relevant order text files name to check which order is completed. Ordered organization usually keeps the name same to the text "order" file when they completes the specific order and save a completion text file to "Out" folder.

Please See Also:


1. How to create Text File using PHP
2. How to upload a file to ftp directory using PHP

This is the rough procedure of ftp based banking. I will share some codes that is needed to configure a ftp based banking API integration to a client's system next.

Monday, November 28, 2011

Use of Object Oriented Programming Style

Suppose, you have planned to join a big software development team where multiple programmers are working. Object Oriented Programming style is preferable in this project from you. There are very simple difference between structured programming and object oriented programming.

In structured programming style, the software have some functions to call for different purposes multiple times. In object oriented programming style, the software also have some functions those are grouped by some objects to call multiple time for different purposes.

For smaller software with few functions, structured programming is the best for development. It will reduce lines of code and processing time. But for bigger project with multiple programmers and huge number of functions, object oriented programming is must.

Same function name mustn't be exist in a same software if it is developed in structured programming way. Programmers have to make sure that the newer function is added with a completely unique name. Repeat of same function name could make the software completely malfunctioned. But in object oriented style of programming, programmers have to make sure that the added new object name is unique for the software, and he have to make sure that the name of a function in a object is unique at it's parent object only. He can repeat the same name of function in different objects.

Saturday, November 19, 2011

Experience on Banking API Integration

Financial institutes always try to make their system most secured. Banking APIs also need secured environment for development. Just passed a whole month working on some banking API integration work in a system developed in PHP. So, I needed to integrate those APIs using PHP. Most of the banks or money transferring agencies uses webservices for interaction with third parties now-a-days. But, some are still using ftp still now.

When I got involved with that task, I figured out that, this task is about to impossible for me to complete. I never heard about these things "Webservice", "WSDL" or "SOAP". But I was familiar with RPC (Remote Process Call). Thanks to Google, it helped me lot to find articles about these technologies. I started reading from SOAP & WSDL and then studied about available PHP/webservice development tools. That was the first time I used CURL for sending http request over Internet. Slowly assembled required codes for sending a SOAP request and handling the response. Then started work for the assignment. My client wanted to use the service from another International Financial Organization using webservices. Usually admins of webservice server provides the documentation about the standard http request structure and the requirements. It's easier to work with well-documented systems. That organization required predefined ip address from where the SOAP request comes and a SSL certificate which is provided by the admin. They provided me a .p12 SSL, but PHP cannot handle this format of certificate. PHP supports only .pem format of SSL certificate. I had to convert the .p12 SSL into key.pem and cert.pem with a pass key for key.pem. Then added them with the PHP CURL request codes. But, still it was too time consuming to write xml texts for the request. That time I started to use nuSOAP library which made everything easier to do. It generates xml as the requesting webservice function needs.

nuSOAP library is the best tools for handling SOAP/WSDL development using PHP. SOAP/WSDL helps different systems to interact each other.