Code Monkey home page Code Monkey logo

yuki-php-wrapper's Introduction

yuki-wrapper

PHP Wrapper for the Yuki SOAP Webservice

Currently available

  • Common Functions
  • Sales (Invoicing)
  • PettyCash (Import CSV files)

Installation with Composer

curl -s http://getcomposer.org/installer | php
php composer.phar require "bertmaurau/yuki-php-wrapper"

Usage

try {
    $yuki = (new \Yuki())
            -> setAccessKey(getenv('API_TOKEN'))
            -> setAdministrationID(getenv('ADMINISTRATION_ID'))
            -> authenticate();
} catch (\Exception $ex) {
    echo $ex -> getMessage();
    exit;
}

// Do stuffs here

Methods

Common

  • Administrations

    Required: Session ID
    Throws: InvalidSessionIDException
    Returns: List of active administration models

    $yuki -> administrations();
    
  • GetAdministrationIDByName

    Required: Session ID 1 Administration Name
    Throws: InvalidAdministrationNameException
    Returns: The ID of the administration

    $yuki -> getAdministrationIDByName($administrationName);
    
  • Authenticate

    Required: Access Key
    Throws: InvalidAccessKeyException

    $yuki -> authenticate();
    
  • AuthenticateByUserName (deprecated)

    Required: UserName & Password
    Throws: InvalidCredentialsException

    $yuki -> authenticateByUserName($userName, $password);
    
  • Domains

    Required: Session ID
    Throws: InvalidSessionIDException
    Returns: List of active domain models

    $yuki -> domains();
    
  • GetCurrentDomain

    Required: Session ID
    Throws: InvalidSessionIDException
    Returns: Returns current domain model

    $yuki -> getCurrentDomain();
    
  • SetCurrentDomain

    Required: Domain ID
    Throws: InvalidSessionIDException

    $yuki -> setCurrentDomain($domainId);
    

Sales

  • ProcessSalesInvoices

    Required: array of Invoices
    Throws: Exception & InvalidSessionIDException & InvalidAdministrationIDException & InvalidSalesInvoiceException

    $yuki -> processSalesInvoices($salesInvoices);
    

PettyCash

  • ImportStatementCSV

    Required: Statement Text
    Throws: Exception & InvalidSessionIDException & InvalidAdministrationIDException & InvalidStatementTextException

    $yuki -> importStatementCSV($statementText);
    
  • ImportStatementLine

    Required: StatementLine
    Throws: Exception & InvalidStatementLineException

    $yuki -> importStatementLine(Model\StatementLine $statementLine);
    
  • ImportStatementLineProject

    Required: StatementLineProject
    Throws: Exception & InvalidStatementLineException

    $yuki -> importStatementLineProject(Model\StatementLineProject $statementLineProject);
    

Getters & Setters

  • getSessionID()
  • setSessionID()
  • getAdministrationID()
  • setAdministrationID()
  • getAccessKey()
  • setAccessKey()

Exceptions

The next Exceptions can be thrown:

  • InvalidAccessKeyException: When there is no Access Key set.
  • InvalidAdministrationIDException: When there is no Administration ID set.
  • InvalidAdministrationNameException: When there is no Administration Name provided to get the ID.
  • InvalidCredentialsException: When there is no UserName or Password given (Deprecated).
  • InvalidDomainIDException: When there is no Domain ID set.
  • InvalidSessionIDException: When there is no Session ID set (Gets set after Authentication).
  • InvalidStatementTextException: When there is no Statement Text provided for import.
  • InvalidStatementLineException: When there is no Statement Line provided for import.
  • InvalidValueTypeException: When given value doesn't match the required type.
  • ModelNotFoundException: When the requested model was not found.
  • NoAuthenticationResultException: When the Authenticate didn't return the expected results
  • NonAllowedEnumValueException: When given value isn't within the allowed enum list values

yuki-php-wrapper's People

Contributors

bertmaurau avatar jverdeyen avatar sandergo90 avatar

Watchers

 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.