Giter VIP home page Giter VIP logo

miva-provision's Introduction

Miva PHP Provision Tools

These are a set of libraries and wrappers for dealing with Miva Merchant Enterprise Provisioning.

Right now, only enterprise customers of Miva Merchant have access to use their provisioning API. This may or may not change in the future.

XML & SOAP Client

This wrapper makes it super simple to programatically send your Miva Merchant Provisioning XML File to your Miva Merchant Installation.

Usage Example:

use Miva\Provisioning\Client;
use Miva\Provisioning\Request;

$client = new Client('https://www.mystorefront.com/mm5/', 'MYTOKENHERE');

$request = new Request();

$request->setContent('<Provision> ... </Provision>);

$response = $client->doRequest($request);

Provision XML Builder

This library allows you to programatically construct a valid Miva Merchant Provision XML File.

Usage Example:

use Miva\Provisioning\Builder\Builder;
use Miva\Provisioning\Builder\Fragment\StoreCreate;
use Miva\Provisioning\Builder\Fragment\ProductAdd;

$storeCode = 'STORE_CODE';

$builder = new Builder($storeCode);

$storeCreate = new StoreCreate();

$builder->addFragmentToDomain($storeCreate);
// alternately:
// $builder->addFragment($storeCreate);

$productAdd = new ProductAdd();

$productAdd->setCode('some_code')
  ->setName('Product Name')
  ->setPrice(20.00)
  ->setCode(10.00)
  ->setWeight(1.00)
  ->setDescription('Product Description')
  ->setTaxable(true)
  ->setActive(true);

$builder->addFragmentToStore($productAdd, $storeCode)
// alternately:
// $builder->addFragment($productAdd, $storeCode);

$xml = $builder->toXml(); //completed XML Document

// you can then send it with the client

$client = new Client('https://www.mystorefront.com/mm5/', 'MYTOKENHERE');

$request = new Request($xml);

$response = $client->doRequest($request);

echo $response->getContent(); 

Installation

You can pull the source and use your own/existing class loader, or you can simply use composer.

Via Composer

    "require": {
        "ghassani/miva-provision" : "dev-master"
    }

Via PHAR Package

Eventually

Misc

This is still a work in progress

Enjoy! If you would like to contribute, feel free to send in pull requests.

miva-provision's People

Contributors

ghassani 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.