Skip to content

Magento REST Api wrapper to use with Amp PHP framework.

Notifications You must be signed in to change notification settings

webgriffe/amp-magento

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AMP Magento Library

Build Status

Magento REST Api wrapper to use with Amp PHP framework.

Installation

Require this package using Composer:

composer require webgriffe/amp-magento

## Usage

ApiClient is the main class of this library: it contains methods that wrap Magento REST API.

<?php

use Amp\Artax\DefaultClient;
use Webgriffe\AmpMagento\ApiClient;

require_once __DIR__.'/vendor/autoload.php';

$client = new ApiClient(
    new DefaultClient(),
    [
        'baseUrl' => 'http://magento.base.url',
        'username' => 'magento-username',
        'password' => 'magento-password'
    ]
);

$order = \Amp\Promise\wait($client->getOrder(1));
var_dump($order);

In Memory Magento

The folder InMemoryMagento contains a fake Magento server and client to be used for automated testing. Unit tests in tests/ApiClientTest.php show how to use InMemoryMagento.

Contributing

To contribute simply fork this repository, do your changes and then propose a pull requests. You should run coding standards check and tests as well:

vendor/bin/phpcs --standard=PSR2 src
vendor/bin/phpunit

License

This library is under the MIT license. See the complete license in the LICENSE file.

Credits

Developed by Webgriffe®

About

Magento REST Api wrapper to use with Amp PHP framework.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages