2017 © Pedro Peláez
 

library gsales-api-client

SOAP Client for consumin gSales API

image

rokde/gsales-api-client

SOAP Client for consumin gSales API

  • Monday, March 14, 2016
  • by rokde
  • Repository
  • 3 Watchers
  • 3 Stars
  • 5,016 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 5 Versions
  • 1 % Grown

The README.md

SOAP API Client for gSales

Latest Stable Version Latest Unstable Version License Total Downloads, (*1)

A generic api client for the billing system gSales

We support API version 2.3 (published on 20th of August 2014)., (*2)


API Documentation, (*3)


Table of contents

  1. Installation
  2. Contexts
    1. Article
    2. Authentication
    3. Comment
    4. Configuration
    5. Contract
    6. Customer
    7. Document
    8. Invoice
    9. Mailspool
    10. Newsletter
    11. Offer
    12. Queue
    13. Refund
    14. User
  3. Using in Frameworks
    1. Using in Laravel 4
    2. Other Frameworks

Installation

Add to your composer.json following lines, (*4)

"require": {
    "rokde/gsales-api-client": "~1.0"
}

Using in Vanilla PHP

$wsdl = 'http://URL-TO-YOUR/api/api.php?wsdl';
$apikey = 'YOUR-API-KEY-HERE';
$client = new \Rokde\Gsales\Api\Client($wsdl, $apikey);
echo $client->customer()->count(); // returns number of customers

That's it., (*5)

Contexts

You have a lot of contexts to group api commands together., (*6)

Article

All article related commands are grouped in the Article context., (*7)

$client->article()->...;

Following methods are available for the article context:, (*8)

  • get($articleId)
  • all()
  • count()
  • create($article)
  • update($article)
  • delete($article)
Create an article
$article = new \Rokde\Gsales\Api\Types\Article\Base();
$article->setTitle('Projectmanagement')
    ->setRetailPrice(120);
$apiClient->article()->create($article);

Authentication

All authentication related commands are grouped in the Authentication context., (*9)

$client->authentication()->...;

Following methods are available for the authentication context:, (*10)

  • passwordLost($customer)
  • changePassword($customer, $newPassword)
  • login($customer, $password)
  • enableLogin($customer)
  • enableLoginById($customer)
  • disableLogin($customer)
  • disableLoginById($customer)

Comment

All comment related commands are grouped in the Comment context., (*11)

$client->comment()->...;

Following methods are available for the comment context:, (*12)

  • get($commentId)
  • all($sub, $recordId)
  • create($comment)
  • delete($comment)

Configuration

All configuration related commands are grouped in the Configuration context., (*13)

$client->configuration()->...;

Following methods are available for the configuration context:, (*14)

  • get($key)

Contract

All contract related commands are grouped in the Contract context., (*15)

$client->contract()->...;

Following methods are available for the contract context:, (*16)

  • get($contractId)
  • all()
  • repayable()
  • processRepayable()
  • processRepayableForCustomer($customer)
  • processRepayableContract($contract)
  • count()
  • enable($contract)
  • disable($contract)
  • createPosition($contract, $position)
  • updatePosition($contract, $position)
  • deletePosition($contract, $position)
  • delete($contract)
  • createForCustomer($customer, $contract)
  • update($contract, $data)
  • updateEndDate($contract, $month, $year)
  • removeEndDate($contract)

Customer

All customer related commands are grouped in the Customer context., (*17)

$client->customer()->...;

Following methods are available for the customer context:, (*18)

  • get($customerId)
  • all()
  • count()
  • repayable()
  • create($customer)
  • update($customer)
  • updateProposal($customer)
  • delete($customer)
Fetch the number of customers
$apiClient->customer()->count();
Fetch all customers
$apiClient->customer()->all()

Document

All document related commands are grouped in the Document context., (*19)

$client->document()->...;

Following methods are available for the document context:, (*20)

  • get($documentId)
  • all()
  • file($documentId)

Invoice

All invoice related commands are grouped in the Invoice context., (*21)

$client->invoice()->...;

Following methods are available for the invoice context:, (*22)

  • get($invoiceId)
  • all()
  • count()
  • paid($invoice)
  • open($invoice)
  • canceled($invoice)
  • createPosition($invoice, $position)
  • updatePosition($invoice, $position)
  • deletePosition($invoice, $position)
  • delete($invoice)
  • createForCustomer($customer)
  • create($invoice)
  • update($invoice)
  • addToMailspool($invoice)
  • pdf($invoice)

Mailspool

All mailspool related commands are grouped in the Mailspool context., (*23)

$client->mailspool()->...;

Following methods are available for the mailspool context:, (*24)

  • send()
  • get($mailSpoolId)
  • all()
  • count()
  • duplicate($mailspool)
  • approve($mailspool)
  • removeApproval($mailspool)
  • create($mailspool)
  • update($mailspool)
  • delete($mailspool)
  • readByRecipient($mailspool)

Newsletter

All newsletter related commands are grouped in the Newsletter context., (*25)

$client->newsletter()->...;

Following methods are available for the newsletter context:, (*26)

  • get($newsletterId)
  • all()
  • count()
  • recipients($newsletter)
  • create($newsletter)
  • update($newsletter)
  • delete($newsletter)
  • addRecipient($newsletter, $recipient)
  • addCustomerAsRecipient($newsletter, $customer)
  • removeRecipient($newsletter, $recipient)
  • spool($newsletter)

Offer

All offer related commands are grouped in the Offer context., (*27)

$client->offer()->...;

Following methods are available for the offer context:, (*28)

  • get($offerId)
  • all()
  • count()
  • accept($offer)
  • declined($offer)
  • open($offer)
  • billed($offer)
  • createPosition($offer, $position)
  • updatePosition($offer, $position)
  • deletePosition($offer, $position)
  • delete($offer)
  • createForCustomer($customer)
  • create($offer)
  • update($offer)
  • addToMailspool($offer)
  • pdf($offer)
  • convertToInvoice($offer, $invoiceApiContext)
  • convertToInvoicePositions($offer, $invoice, $invoiceApiContext)

Queue

All queue related commands are grouped in the Queue context., (*29)

$client->queue()->...;

Following methods are available for the queue context:, (*30)

  • get($queueId)
  • all()
  • count()
  • create($queueEntry)
  • update($queueEntry)
  • delete($queueEntry)
  • auto($queueEntry)
  • manual($queueEntry)
  • noApproval($queueEntry)
  • createInvoice($customer)
  • createInvoices()
Create a queue entry
$queueEntry = new \Rokde\Gsales\Api\Types\Queue\Base();
$queueEntry->setPositionText('Test')
    ->setCustomerId(37)
    ->setPrice(1.23)
    ->setQuantity(1)
    ->setApproval(0)
    ->setUnit('x')
    ->setDiscount(0)
    ->setTax(0.19);
$apiClient->queue()->create($queueEntry);

Refund

All refund related commands are grouped in the Refund context., (*31)

$client->refund()->...;

Following methods are available for the refund context:, (*32)

  • get($refundId)
  • all()
  • count()
  • paid($refund)
  • canceled($refund)
  • open($refund)
  • createPosition($refund, $position)
  • updatePosition($refund, $position)
  • deletePosition($refund, $position)
  • delete($refund)
  • createForCustomer($customer)
  • create($refund)
  • update($refund)
  • addToMailspool($refund)
  • pdf($refund)

User

All user related commands are grouped in the User context., (*33)

$client->user()->...;

Following methods are available for the user context:, (*34)

  • get($userId)
  • all()
  • count()
  • create($user)
  • update($user)
  • delete($user)
  • lock($user)
  • unlock($user)
  • availableRoles()
  • roles($user)
  • addRole($user, $role)
  • removeRole($user, $role)

Using in Frameworks

Using in Laravel 4

After installing the package you have to add the following line to your providers Array in your app.php:, (*35)

'Rokde\Gsales\Api\Supports\Laravel\LaravelGsalesApiClientServiceProvider',

To get your GsalesApiClient configured publish it's configuration:, (*36)

php artisan config:publish rokde/gsales-api-client

Then you can set your wsdl and apikey to the published configuration file., (*37)

The service provider for laravel automatically creates a facade GsalesApiClient for you. So you can use it from the beginning like so:, (*38)

GsalesApiClient::queue()->all(); // get all queue entries

or without facade:, (*39)

$apiClient = App::make('gsales-api-client');
$apiClient->queue()->all();

Other Frameworks

We do not use any other frameworks with this package yet. But please let us know when you need it elsewhere. Or fork it and develop your own. We appreciate pushing back your extension ;), (*40)

The Versions

14/03 2016

dev-master

9999999-dev

SOAP Client for consumin gSales API

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-soap *

 

The Development Requires

by Robert Kummer

api php client soap gsales

14/03 2016

1.0.3

1.0.3.0

SOAP Client for consumin gSales API

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-soap *

 

The Development Requires

by Robert Kummer

api php client soap gsales

19/01 2015

1.0.2

1.0.2.0

SOAP Client for consumin gSales API

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-soap *

 

The Development Requires

by Robert Kummer

api php client soap gsales

13/11 2014

1.0.1

1.0.1.0

SOAP Client for consumin gSales API

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-soap *

 

The Development Requires

by Robert Kummer

api php client soap gsales

13/11 2014

1.0.0

1.0.0.0

SOAP Client for consumin gSales API

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-soap *

 

The Development Requires

by Robert Kummer

api php client soap gsales