2017 © Pedro PelΓ‘ez
 

library checkfront

Wrapper library for using the Checkfront API

image

checkfront/checkfront

Wrapper library for using the Checkfront API

  • Monday, November 27, 2017
  • by gegere
  • Repository
  • 2 Watchers
  • 0 Stars
  • 377 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 15 Forks
  • 0 Open issues
  • 6 Versions
  • 13 % Grown

The README.md

Build Status, (*1)

Checkfront PHP SDK (v1.3)

The Checkfront API 3.0 allows you to build integrations and custom applications that interact with a remote Checkfront account., (*2)

This repository contains the open source PHP SDK and various example scripts. Except as otherwise noted, the Checkfront PHP SDK is licensed under the Apache Licence, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html), (*3)


Features

The Checkfront API SDK (v1.3) provides the following functionality:, (*4)

  • OAuth2 authorization and authentication.
  • OAuth2 token refresh.
  • Token pair authorization.
  • Session handing.
  • Access to Checkfront Objects via GET, POST, PUT and DELETE request.
  • Notifications via API Hook
  • Installation via PHP Composer

Installation & Usage

This repo is setup to extend off of the library created by Checkfront. To update this library, a Composer.json file has been created., (*5)

If you are not using Composer, you should be. It's an excellent way to manage dependencies in your PHP application., (*6)

Quick Start

Let's install Checkfront-PHP-DK via the following few commands:, (*7)

Type composer for more options:, (*8)

$ composer init --require="checkfront/checkfront:1.3" -n 
$ composer install
require 'vendor/autoload.php';

Now the needed code should be available within your project. At the top of your PHP script require the autoloader, if you are using a MVC such as CodeIgnitor or Laravel review their autoload guides., (*9)

API credintials: https://{your-company}.checkfront.com/manage/developer/, (*10)

The repo example files are a good place to start., (*11)

PHP-SDK                     # β†’ Root of Service
└── examples/
   └── cart
       β”œβ”€β”€ Cart.php         # β†’ Main wrapper class, ADD API KEY
       β”œβ”€β”€ create.php       # β†’ Process $_POST request, add to cart session
       β”œβ”€β”€ Form.php         # β†’ Various PHP functions
       β”œβ”€β”€ index.php        # β†’ Default view, list available inventory
       └── README.md        # β†’ File overview & tips

OAuth2 Access

<?php
$Checkfront = new Checkfront(
    array(
        'host' => 'your-company.checkfront.com',
        'consumer_key' => '5010076404ec1809470508',
        'consumer_secret' => 'ba0a5c0c509445024c374fcd264d41e816b02d4e',
        'redirect_uri' => 'oob',
    ));
?>

Token Access

<?php
$Checkfront = new Checkfront(
    array(
        'host' => 'your-company.checkfront.com',
        'auth_type' => 'token',
        'api_key' => '5010076404ec1809470508',
        'api_secret' => 'ba0a5c0c509445024c374fcd264d41e816b02d4e',
    ));
?>

PHP Examples

get('item', array(
            'start_date'=>date('Y-m-d'),
            'end_date'=>date('Y-m-d',strtotime('+3 days'))
        ));

print_r( $items );

// Fetch all bookings
public function query_booking() 
{
    $response = $this->Checkfront->get('booking/index');
    return $response;
}

print_r(query_booking() );
?>

Notifications via Checkfront API

Send reminders to guests as they arrive with details and directions. Send a follow-up thank you message as your guests jet home., (*12)

Overview

Traveling to new areas requires planning for the unexpected and help from trusted travel partners. Have tips and maps sent to your guests a day before they arrive via email or text message., (*13)

There might be a need to send out more targeted emails with your reservations and this can be done. By using the event notification service from Checkfront a notification can be sent to a server with information about the reservation. Using Notification Service a custom template can be used to inform guests., (*14)

An additional example. Let’s say you have 5 properties and they spread around the city. The guest booked a reservation at 123 ABC Street and after booking a rental car they are on their way. They indicated their approximate arrival time. You could have a text message or email informing the guest of arrival instructions as they indicated their check-in time via the booking., (*15)

Usage

Move the following example file notifications-example.php to a place of your choosing and include update the path(s) to the class files needed to process this script., (*16)

Notification Service Breakdown

PHP-SDK                                 # β†’ Root of Service
└── scripts/
   └── notifications
       β”œβ”€β”€ includes
       β”‚   β”œβ”€β”€ db.class.php             # β†’ DB Interface Class 
       β”‚   └── notifications.class.php  # β†’ Parse of incoming data
       β”œβ”€β”€ notifications-example.php    # β†’ Processing Example file
       └── notifications.sql            # β†’ DB Example File

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Make your changes
  4. Run the tests, adding new ones for your own code if necessary (phpunit)
  5. Commit your changes (git commit -am 'Added some feature')
  6. Push to the branch (git push origin my-new-feature)
  7. Create new Pull Request

The Versions

27/11 2017

dev-master

9999999-dev https://github.com/htmlgraphic/PHP-SDK

Wrapper library for using the Checkfront API

  Sources   Download

MIT

The Requires

  • php >=5.3

 

check travel front checkfront bookings

27/11 2017

dev-develop

dev-develop https://github.com/htmlgraphic/PHP-SDK

Wrapper library for using the Checkfront API

  Sources   Download

MIT

The Requires

  • php >=5.3

 

check travel front checkfront bookings

22/12 2015

3.0.1

3.0.1.0 https://github.com/htmlgraphic/PHP-SDK

Wrapper library for using the Checkfront API

  Sources   Download

MIT

The Requires

  • php >=5.3

 

check travel front checkfront bookings

28/01 2015

3.0.0

3.0.0.0 https://github.com/htmlgraphic/PHP-SDK

Wrapper library for using the Checkfront API

  Sources   Download

MIT

The Requires

  • php >=5.3

 

check travel front checkfront bookings

17/04 2014

dev-feature/travis-ci

dev-feature/travis-ci https://github.com/gegere/PHP-SDK

  Sources   Download

MIT

The Requires

  • checkfront/php-sdk 3.0.*

 

16/04 2014

dev-feature/composer

dev-feature/composer https://github.com/gegere/PHP-SDK

  Sources   Download

MIT

The Requires

  • checkfront/php-sdk 3.0.*