GithubHelp home page GithubHelp logo

noblestreet / mindbody-php-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from devincrossman/mindbody-php-api

0.0 2.0 0.0 22 KB

PHP wrapper class for interacting with Mindbody's API via soap

License: MIT License

PHP 100.00%

mindbody-php-api's Introduction

mindbody-php-api

PHP wrapper class for interacting with Mindbody's API via soap. Requires PHP >= 5.3 with SOAP extension.

Install with composer or clone the repository. Include src/MB_API.php or include vendor/autoload.php if using composer.

Update the MB_API.php file with your Mindbody API source credentials or include them as a parameter to the MB_API constructor

$mb = new \DevinCrossman\Mindbody\MB_API(array(
	"SourceName"=>'REPLACE_WITH_YOUR_SOURCENAME', 
	"Password"=>'REPLACE_WITH_YOUR_PASSWORD', 
	"SiteIDs"=>array('REPLACE_WITH_YOUR_SITE_ID')
));

// CheckoutShoppingCart

$checkoutShoppingCartRequest = $mb->CheckoutShoppingCart(array(
	'Test'=>'true',
	'ClientID'=>1234,
	'CartItems'=>array(
		'CartItem'=>array(
			'Quantity'=>1,
			'Item' => new SoapVar(
				array('ID'=>'1357'), 
				SOAP_ENC_ARRAY, 
				'Service', 
				'http://clients.mindbodyonline.com/api/0_5'
			),
			'DiscountAmount' => 0
		)
	),
	'Payments' => array(
		'PaymentInfo' => new SoapVar(
			array(
				'CreditCardNumber'=>'4111111111111111', 
				'ExpYear'=>'2015', 
				'ExpMonth'=>'06', 
				'Amount'=>'130', 
				'BillingAddress'=>'123 Happy Ln', 
				'BillingPostalCode'=>'93405'
			), 
			SOAP_ENC_ARRAY, 
			'CreditCardInfo', 
			'http://clients.mindbodyonline.com/api/0_5'
		)
	)
));

// GetServices

$options = array(
	'LocationID'=>1,
	'HideRelatedPrograms'=>true
);
$servicesData = $mb->GetServices($options);

// FunctionData

$options = array(
	'FunctionName'=>'my_function',
	'FunctionParams'=>array(
		array(
			'ParamName'=>'@startDate',
			'ParamValue'=>'2014-05-01',
			'ParamDataType'=>'datetime'
		),
		array(
			'ParamName'=>'@endDate',
			'ParamValue'=>'2014-05-30',
			'ParamDataType'=>'datetime'
		)
	)
);
$data = $mb->FunctionDataXml($options);

See the examples folder for other examples Read MINDBODY's API Documentation for more parameters.

mindbody-php-api's People

Contributors

devincrossman avatar drfraker avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.