Project description

Woocommerce is a popular ecommerce plugin for WordPress with almost 4 million+ active installations. There are quite a few payment gateways available for online payments. SweetPay is also one of them providing the users facility of online payment. This gateway’s development was a little different from other gateways as this supports only few currencies and countries.

Project Type

WooCommerce Payment Gateway Plugin

Project Time

20 Working Days

casestudy-client

Client

Sweet Pay

Problems

  • Currency Checks
  • Country Checks
  • Payment Process
  • Payment Response callback

Issue: The plugin only supports five currencies at the moment. So, we had to compare the selected currency in woocommerce with the list of supported currencies. The client also wanted us to disable the plugin options if currencies would not match and display an error.
Solution: Firstly, we fetched the currency enable in woocommerce and compared that with the supported currencies of plugin. If selected currency is available in our list of currencies then setting page of plugin having some fields is displayed otherwise, there will be an error displayed that user’s enabled currency is supported by the plugin and SweetPay extension for Woocommerce will be automatically disabled.

Issue: SweetPay supports some currencies in different regions only. We had to make sure that the selected currency is supported in a particular country. For example Euro is supported in Germany but not in Chile.
Solution: In order to solve the problem, we asked the user for country and saved this in database. First we validated the country code field. Then we compared this value to our criteria if that currency is supported in selected country.

Issue: For payment process user must go the SweetPay website. We faced multiple problem in order to get the data from woocommerce. We had to get all the metadata of an order i.e order_id, merchantCustomerId, merchantOrderId and transaction details in an array. After that we had to redirect user to SweetPay website with all this information.
Solution: The actual payment process is handled in SweetPay’s website. We had to redirect the user to their website while passing all the information in a token using JSON format. SweetPay’s api returned the data maintaining the user sessions. During this process we also kept the error handling in mind with some important checks of Connection errors.

Issue: After the payment process, it is also necessary to ensure that order meta is updates according to payment results. It can be either successful or not successful.
Solution: We created two callback functions. SweetPay returns data in POST format which was difficult to process in WordPress and WooCommerce. For this we used PHP STREAM, in order to treat the data as a file. If the payment was made successfully then it will automatically update the order details in Woocommerce tab. Otherwise, user will know about the failure of payment. In either case, user will be redirected to a URL having a message of either the payment was successful or not.

Our Project Planning

Client Needs

● We collected and gathered information from the client through several meeting, calls and conversations.
● After that we brainstormed over the provided information.
● We suggested a few things to client.
● After some discussions, everything was finalized and we started the development.

Delegation

● The project was divided into several milestones and every milestone was given a specific deadline.
● We devised teams and delegated the work to each one in accordance with their skill level.
● The created milestones of this project were divided in such a manner that they remained independent of each other, so one milestone can’t get affected by the other.

Project Management

● We approached the project with agile methodology i.e. placing the work in sequence as sprints. Since the project was divided into milestones, the particular tasks assigned to these were also designed in such a way that the team members remained independent over the others.
● At the end of each day, we had a quick scrum of 10 minutes.
● At the end of each week, we had a longer scrum.