All Projects → netinternet → parasut-v4

netinternet / parasut-v4

Licence: other
Parasut Php Api V4

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to parasut-v4

php-typography
A PHP library for improving your web typography.
Stars: ✭ 63 (+26%)
Mutual labels:  composer-package
Laravel-Crud-Generator
A Simple Laravel Library that allows to create crud operation with a single command
Stars: ✭ 20 (-60%)
Mutual labels:  composer-package
picoFeed
PHP library to parse and write RSS/Atom feeds
Stars: ✭ 30 (-40%)
Mutual labels:  composer-package
telegram-bot-sdk
🤖 Telegram Bot API PHP SDK. Create Telegram Bots with PHP Easily! [WIP - DO NOT USE IN PRODUCTION YET]
Stars: ✭ 64 (+28%)
Mutual labels:  composer-package
docker-symfony
🐳 Environment for a Symfony application using Docker.
Stars: ✭ 42 (-16%)
Mutual labels:  composer-package
php-base-project
A Composer ready package to start a new PHP 7 project
Stars: ✭ 17 (-66%)
Mutual labels:  composer-package
easydock
Dockerize your PHP apps ;)
Stars: ✭ 52 (+4%)
Mutual labels:  composer-package
phpcsfixer-preset
Use the same php-cs-fixer configuration across all of your projects, with presets for common project layouts (Laravel, Composer packages, etc.).
Stars: ✭ 22 (-56%)
Mutual labels:  composer-package
php-currency-api
Standardized wrapper for popular currency rate APIs. Currently supports FixerIO, CurrencyLayer, Open Exchange Rates and Exchange Rates API.
Stars: ✭ 17 (-66%)
Mutual labels:  composer-package
laravel-binlog
Add mysql binlog event listening for Laravel ( 为Laravel框架添加Mysql Binlog事件监听 )
Stars: ✭ 19 (-62%)
Mutual labels:  composer-package
psh
PSH - PHP shell helper
Stars: ✭ 60 (+20%)
Mutual labels:  composer-package
parasut
An easy-to-use parasut.com API with PHP.
Stars: ✭ 22 (-56%)
Mutual labels:  parasut
aws-upload
🌈 A delicious CLI tool for uploading files to ec2
Stars: ✭ 39 (-22%)
Mutual labels:  composer-package
socrates
PHP package to Validate and Extract information from National Identification Numbers.
Stars: ✭ 46 (-8%)
Mutual labels:  composer-package
wp-phpunit
WordPress core PHPUnit library. [READ ONLY] Versions for new WordPress releases are built daily.
Stars: ✭ 65 (+30%)
Mutual labels:  composer-package
laravel-sentiment-analysis
A Laravel wrapper to perform sentiment analysis over an English sentence
Stars: ✭ 41 (-18%)
Mutual labels:  composer-package
qqmap-region
腾讯位置服务中国标准行政区划数据 SDK
Stars: ✭ 22 (-56%)
Mutual labels:  composer-package
scheduler
Task Scheduler for Laravel applications. UI from scratch
Stars: ✭ 18 (-64%)
Mutual labels:  composer-package
docker-magento2
🐳 Environment for a Magento2 application using Docker.
Stars: ✭ 52 (+4%)
Mutual labels:  composer-package
seas-logger
An effective,fast,stable log package for PHP.
Stars: ✭ 46 (-8%)
Mutual labels:  composer-package

Parasut PHP Client

Parasut Api V4 with PHP

Install

composer require netinternet/parasut-v4

Usage

<?php
use Parasut;

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

$client = new Client([
    "client_id" => "xxxxxxx",
	"username" => "xxxxxx",
	"password" => "xxxxxxxx",
	"grant_type" => "password",
	"redirect_uri" => "urn:ietf:wg:oauth:2.0:oob",
    'company_id' => "xxxxx"
]);

// automatically get access token and save src/token.ini
  • Create a new Customer Account
$customer = array (
    'data' =>
        array (
            'type' => 'contacts',
            'attributes' => array (
                    'email' => 'email-address',
                    'name' => 'username', // REQUIRED
                    'short_name' => 'xxxx',
                    'contact_type' => 'person', // or company
                    'district' => 'Pamukkale',
                    'city' => 'Denizli',
                    'address' => 'xxxxxxx',
                    'phone' => '+90xxxxxxxxxx',
                    'account_type' => 'customer', // REQUIRED
                    'tax_number' => 'xxxxxxxx ', // TC no for person
                    'tax_office' => 'Pamukkale'
            ),
            "relationships" => array (  // not required
                "category" => array (
                    "data" => array (
                        "id" => "xxx",
                        "type" => "item_categories"
                    )
                )
            )
        ),
);
$client->call(Parasut\Account::class)->create($customer);
// or
$account = new Parasut\Account($client);
$account->create($customer);
  • Create Invoice
$invoice = array (
    'data' => array (
       'type' => 'sales_invoices', // Required
       'attributes' => array (
           'item_type' => 'invoice', // Required
           'description' => 'Description',
           'issue_date' => '2018-03-19', // Required
           'due_date' => '2018-03-19',
           'invoice_series' => 'test',
           'invoice_id' => 1,
           'currency' => 'TRL'
       ),
       'relationships' => array (
           'details' => array (
               'data' =>array (
                   0 => array (
                       'type' => 'sales_invoice_details',
                       'attributes' => array (
                           'quantity' => 1,
                           'unit_price' => 29.90,
                           'vat_rate' => 18,
                           'description' => 'Hosting'
                       ),
                       "relationships" => array (
                           "product" => array (
                               "data" => array (
                                   "id" => "xxxxx", 
                                   "type" => "products"
                               )
                           )
                       )
                   ),
                   1 => array (
                       'type' => 'sales_invoice_details',
                       'attributes' => array (
                           'quantity' => 1,
                           'unit_price' => 19.90,
                           'vat_rate' => 18,
                           'discount_type' => 'percentage',
                           'discount_value' => 10,
                           'description' => 'Domain'
                       ),
                       "relationships" => array (
                           "product" => array (
                               "data" => array (
                                   "id" => "xxxxxx",
                                   "type" => "products"
                               )
                           )
                       )
                   ),
               ),
           ),
           'contact' => array (
               'data' => array (
                   'id' => 'xxxx',
                   'type' => 'contacts'
               )
           )
       ),
    )
);
$client->call(Parasut\Invoice::class)->create($invoice);
  • Add Payment
$payArr = array(
    "data" => array(
        "type" => "payments",
        "attributes" => array(
            "description" => "xxxx x x  xxxx x x ",
            "account_id" => "xxx", // bank account id on Parasut
            "date" => "2018-03-19",
            "amount" => 56.42,
            "exchange_rate" => 1.0
        )
    )
);
$id = xxx; // Invoice id
$client->call(Parasut\Invoice::class)->pay($id, $payArr);
  • Create E Archive Invoice
$invArr = array (
    "data" => array(
        "type" => "e_archives",
        "relationships" => array (
            "sales_invoice" => array (
                "data" => array (
                    "id" => xxxx, // Invoice Id
                    "type" => "sales_invoices"
                )
            )
        )
    )
);
$client->call(Parasut\Invoice::class)->create_e_archive($invArr);
  • Create Product
$productArr = array(
    'data' => array (
        'type' => 'products',
        'attributes' => array (
            'name' => 'xxxx xx x x x x xx '
        )
    )
);
$client->call(Parasut\Product::class)->create($productArr);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].