Git Product home page Git Product logo

archi-delivery's Introduction

Library for working with API ArchiDelivery

ArchiDelivery

Installation

composer require stee1cat/archi-delivery:dev-master

Usage

use ArchiDelivery\Delivery;
use ArchiDelivery\Client;
use ArchiDelivery\Client\Address;
use ArchiDelivery\Order;
use ArchiDelivery\Order\Item;
use ArchiDelivery\Order\Item\Modificator;

$delivery = new Delivery();
$delivery->setIp('192.168.0.1');

$client = new Client($delivery, array(
  'fullName' => 'Проверкин Тест Тестович',
  'phone' => '+79555555555',
));

$address = new Address();
$address->setStreet('Street')
    ->setHome('Home')
    ->setFrontDoor(1)
    ->setLevel(5)
    ->setRoom(20);

$order = $delivery->createOrder();
$order->setClient($client)
    ->setAddress($address)
    ->setOrderType(1)
    ->setPaymentType(1)
    ->setComment('comment')
    ->setFlatwareCount(2)
    ->setChangeFrom(1000);

$item = new Item();
$item->setId(1234)
    ->setQuantity(1);

$modificator = new Modificator();
$modificator->setId(12)
    ->setReference(123)
    ->setQuantity(1)
    ->setKind(Modificator::KIND_NOMENCLATURE)
    ->setType(Modificator::TYPE_ADD);

$item->addModificator($modificator);

$result = $order->addItem($item)
    ->send();

Find customers using a telephone number:


use ArchiDelivery\Delivery;
use ArchiDelivery\Client;

$delivery = new Delivery();
$delivery->setIp('192.168.0.1');

$client = new Client($delivery);
$clients = $client->findByPhone('79555555555');
foreach ($clients as $record) {
    echo $record->getFullName(), '<br>';
}

archi-delivery's People

Contributors

stee1cat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

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