2017 © Pedro Peláez
 

library invoice-client

image

marfakt/invoice-client

  • Sunday, June 3, 2018
  • by mardraze
  • Repository
  • 2 Watchers
  • 0 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 11 % Grown

The README.md

Klient API do fakturowania

Zarejestruj się na http://marfakt.pl aby uzyskać api_token, (*1)

Instalacja

php -r "readfile('https://getcomposer.org/installer');" | php
php composer.phar require "marfakt/invoice-client" "@stable"
echo "<?php require __DIR__ . '/vendor/autoload.php';" > test.php

Został utworzony plik test.php w którym możemy testować klienta., (*2)

Wystawianie faktur

$client = new \Marfakt\InvoiceClient('api_token');
$response = $client->addInvoice(array(
    'MiejsceWystawienia' => 'Olsztyn',
    'Odbiorca' => array(
        'Nazwa' => 'Jan Kowalski',
        'Ulica' => '',
        'NumerDomu' => '',
        'NumerLokalu' => '',
        'KodPocztowy' => '',
        'Miejscowosc' => '',
        'Wojewodztwo' => '',
        'Kraj' => '',
        'NIP' => '',
        'REGON' => '',
        'PESEL' => '',
        'VIES' => '',
        'VATUE' => '',
        'NumerRachunkuBankowego' => '',
        'Telefon1' => '',
        'Telefon2' => '',
        'Fax' => '',
        'Email' => '',
    ),
    'PozycjaDokumentu' => array(
        array(
            'Nazwa' => 'Test product',
            'JednostkaMiary' => 'szt',
            'Ilosc' => 1,
            'CenaNetto' => 23.34,
            'StawkaVAT' => 23,
        )
    )
));

W zmiennej $response mamy id oraz hash potrzebny do utworzenia publicznego linku do pliku PDF z fakturą., (*3)

Generowanie PDF

Generowanie publicznego linku., (*4)

$url = \Marfakt\InvoiceClient::pdfUrl($id, $hash);

Pobieranie listy faktur

Faktury z obecnego miesiąca., (*5)

$resp = $client->getInvoices(date('Y'), date('m'));

The Versions

03/06 2018

dev-master

9999999-dev

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.9

 

31/10 2015

1.0.1

1.0.1.0

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.9

 

26/10 2015

1.0.0

1.0.0.0

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.9