Integrate Mindbody API

Posted in API, Web Tagged , , , ,

Problem 

Synchronize a web-application built for saving meditation and yoga related classes information of customers with MindBody API. The customers will signup into MindBody and their data should be captured from there and updated into the web-application database. The customers should be able to book appointments from the web-application which should be updated into the MindBody database.

Solution Provided

The credentials for Mind-body developer API were obtained. The source name, password, siteId, were all supplied to the SOAP request call . Then a query was fired on the MindBody database as a part of the request to fetch all the customers profile information present in MindBody. The data was retrieved in CSV format. Then a validation was implemented to check if the emails of the customers were present in the web-application database. If no then these records were created in the web-application database. The MindBody client id was inserted too. If the record of the customer was found then the record was updated with the MindBody client id received from the API.

A cron job was setup to sync the database daily with Mindbody looking for new customers. The client id from Mind Body was used for mapping between the application and the API.

The customers had access to an appointment form where they could select the location, and the appointment date for booking. Then a request was made to the MindBody server passing the location, date, staff id, client id to add the new appointment in the MindBody database. The status of the API was tracked to track the success / failure of the request.

The application helped the client streamline his business in terms of managing all the user related activities and sessions for yoga and meditation.

 

Integrate BeanStream Payment Gateway

Posted in API, Payment Gateway, Web Tagged , , , , ,

Problem

Integrate BeanStream payment gateway in a web-application built using the wordpress framework. The Application is for a small hotel and there is a dedicated page from where the users who are interested in booking rooms can specify their booking date, room type and confirm the booking by paying the amount for the same.

Solution Provided

An order form was created on the hotel booking page, it had all the fields added for taking the users information. The merchant id was obtained from the merchant login. It was integrated as hidden field in the payment form. The payment related fields like credit card number, name, address, expiry date, city, province, country were all integrated on the same page.

The information entered was validated for correctness and then the user information was posted on the BeanStream server payment URL via a PHP Curl Request.

This ensured that the user was not redirected away from the parent website. The Curl response was captured and the payment completion status was obtained from it. If the transaction was Approved then the user was redirected to the payment completion page , else to the cancel/failure page.

The payment notification URL was defined in the payment gateway merchant login and data sent on that URL was used to update the database with the booking information of the user.

The entire code was first built as an independent prototype and after it was tested with test and live payment transactions, it was modified to integrate into existing word-press platform. The tests were repeated after integration in word-press.