2017 © Pedro Peláez
 

project api

This package contains the client-side API classes

image

visalogic/api

This package contains the client-side API classes

  • Friday, December 16, 2016
  • by danielgelling
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

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

VisaLogic API Class

1. Introduction

This document holds the documentation for the Application Programming Interface of VisaLogic. This is a document in whom a technical language will be used and for which technical knowledge is required to implement., (*2)

2. Installation

2.1 Via Composer

Our API class is available through composer., (*3)

You can install our dependency using the following command:, (*4)

composer require visalogic/api

In your project you should require composer's autoload.php file:, (*5)

<?php
    require 'vendor/autoload.php';

2.2 Via Github

Our API class is also available on Github., (*6)

When you choose to install from Github you need to require all the files in src/ into your project., (*7)

3 Configuration

All our API classes are namespaces with VisaLogic., (*8)

3.1 Aquire an API key

You can aquire an API key via our backoffice., (*9)

3.2 Setting the API key

You can set the API key by passing it through the constructor:, (*10)

$visalogic = new VisaLogic\Api('your-api-key');

4 Available methods

4.1 Get your orders

You can request your orders by calling the getOrders(); method. This will get your last 15 orders., (*11)

$visalogic->getOrders();

The orders are paginated. To request your next 15 orders you can provide a pagenumber as the first argument., (*12)

$visalogic->getOrders($page = 2);

4.2 Get an order

To request an order and it's details, you can make a call to the getOrder(); method. With as parameter it's id., (*13)

$visalogic->getOrder($id = 1);

4.3 Creating an order

To create an order you can call the createOrder(); method. This will return an new VisaLogic\Resources\Order instance., (*14)

By passing the order details in an array as argument, the properties on the Order instance will be set for you., (*15)

$order = $visalogic->createOrder([
    'email'                   => 'johndoe@example.com',
    'phone_number'            => '31' . '12345678',
    'addressee'               => 'John Doe',
    'addressline'             => 'Examplestreet 1',
    'addressline_1'           => '1234 AB City',
    'country'                 => 'NL',
    'customer_purchase_price' => 25,
    'order_created'           => 'YYYY-MM-DD HH:MM:SS'
    'remote_name'             => 'Order 1' // optional
]);

Then you can add an application to the order by calling the addApplication(); method on the Order object:, (*16)

$order->addApplication([
    'firstnames'           => 'John',
    'lastnames'            => 'Doe',
    'date_of_birth'        => '1990-01-01',
    'place_of_birth'       => 'City',
    'nationality'          => 'NL',
    'document_type'        => 'passport',
    'document_number'      => 'AA1BBBB22',
    'document_issue_date'  => '2010-01-01',
    'document_expire_date' => '2020-01-02',
    'visa_start_date'      => 'YYYY-MM-DD' // This date has to be after yesterday
]);

nationality can be either NL or BE, and document_type can be passport or id_card. For one order the all document_type values and visa_start_date values have to be the same. If this is not the case, please create two seprateo orders., (*17)

4.3 Submit the order

When you finished creating the order, you can send it to us by using the postOrder(); method which accepts the Order object as first parameter:, (*18)

$visalogic->postOrder($order);

4.4 Get visa request status

You can request the status of a visa application by calling the following method, with the application_id:, (*19)

$application_status = $visalogic->getStatus($application_id = 1);

This method will return one of the following strings:, (*20)

  • APPROVED Application has been approved
  • PENDING Application is pending to be processed
  • BUSY Application is being processed by visa supplier
  • RECEIVING Waiting to receive the visa document
  • REJECTED Application has been rejected

4.3 Get the visa document

4.3.1 Download PDF

If the application's status is APPROVED you can request the visa document by calling getVisa();, (*21)

$visalogic->getVisa($application_id = 1);

This method will set headers for a pdf document to be downloaded and returns the visa document., (*22)

The Versions

16/12 2016

dev-master

9999999-dev

This package contains the client-side API classes

  Sources   Download

MIT

The Requires

 

by Daniel Gelling

api visalogic

12/12 2016

v1.0.6

1.0.6.0

This package contains the client-side API classes

  Sources   Download

MIT

The Requires

 

by Daniel Gelling

api visalogic

12/12 2016

v1.0.5

1.0.5.0

This package contains the client-side API classes

  Sources   Download

MIT

The Requires

 

by Daniel Gelling

api visalogic

12/12 2016

v1.0.4

1.0.4.0

This package contains the client-side API classes

  Sources   Download

MIT

The Requires

 

by Daniel Gelling

api visalogic

08/12 2016

v1.0.3

1.0.3.0

This package contains the client-side API classes

  Sources   Download

MIT

The Requires

 

by Daniel Gelling

api visalogic

08/12 2016

v1.0.2

1.0.2.0

This package contains the client-side API classes

  Sources   Download

MIT

The Requires

 

by Daniel Gelling

api visalogic

08/12 2016

v1.0.1

1.0.1.0

This package contains the client-side API classes

  Sources   Download

MIT

The Requires

 

by Daniel Gelling

api visalogic

08/12 2016

v1.0.0

1.0.0.0

This package contains the client-side API classes

  Sources   Download

MIT

The Requires

 

by Daniel Gelling

api visalogic

16/11 2015

v0.0.1

0.0.1.0

This package contains the client-side API classes

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

by Daniel Gelling

api visalogic