Skip to content

Commit ed13dea

Browse files
committed
merged Checkfront Checkfront#9 README Update
1 parent 9b50a27 commit ed13dea

File tree

1 file changed

+48
-39
lines changed

1 file changed

+48
-39
lines changed

README.md

Lines changed: 48 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,76 @@
1-
[![Build Status](https://travis-ci.org/htmlgraphic/PHP-SDK.svg?branch=feature/travis-ci)](https://travis-ci.org/htmlgraphic/PHP-SDK)
1+
Checkfront PHP SDK (v3.0)
2+
==========================
23

3-
# Checkfront PHP SDK (v3.0)
4+
The [Checkfront Booking API](http://www.checkfront.com/developers/api/) allows you
5+
to build integrations and custom applications that interact with a remote Checkfront account.
46

5-
The [Checkfront API](http://api.checkfront.com/en/latest/) allows you
6-
to build integrations and custom applications that interact with the Checkfront service.
7+
This repository contains the open source PHP SDK that allows you to utilize the
8+
above on your website. Except as otherwise noted, the Checkfront PHP SDK
9+
is licensed under the Apache Licence, Version 2.0
10+
(http://www.apache.org/licenses/LICENSE-2.0.html)
711

8-
##Features
12+
Updates
13+
-------
14+
15+
* The 'Cart' example has been given a few quick fixes for v3 API support, using token pair auth.
16+
* The CheckfrontAPI library now supports connecting to the v3 API, as well as features like token pair authentication
17+
* New/updated examples are in the works.
18+
* See our v3 API documentation for more information.
19+
20+
21+
Features
22+
--------
923

1024
The Checkfront API SDK provides the following functionality:
1125

12-
* OAuth 2.0 authorization and authentication.
13-
* OAuth 2.0 token refresh.
26+
* OAuth2 authorization and authentication.
27+
* OAuth2 token refresh.
1428
* Token pair authorization.
1529
* Session handing.
1630
* Access to Checkfront Objects via GET, POST, PUT and DELETE request.
1731

32+
Usage
33+
-----
1834

19-
## Installation
20-
21-
This repo is setup to extend off of the library created by Checkfront. To easily add or **update** this library, a Composer.json file has been created.
22-
23-
If you are not using [Composer](http://getcomposer.org), you should be. It's an excellent way to manage dependencies in your PHP application. Offically Checkfront does not have a registered Composer library, no problem it can be setup via the following code:
24-
25-
Setup composer with the needed code:
26-
27-
```
28-
$ composer init --require="checkfront/checkfront:3.0.*" -n
29-
$ composer install
30-
```
31-
Now the needed code should be available within your project.
32-
35+
The examples are a good place to start. The minimal you'll need to
36+
have is:
3337

34-
Next, at the top of your PHP script require the autoloader:
38+
##### OAuth2 Access
3539

36-
```bash
37-
require 'vendor/autoload.php';
40+
```php
41+
<?
42+
$Checkfront = new Checkfront(
43+
array(
44+
'host'=>'your-company.checkfront.com',
45+
'consumer_key' => '5010076404ec1809470508',
46+
'consumer_secret' => 'ba0a5c0c509445024c374fcd264d41e816b02d4e',
47+
'redirect_uri'=>'oob',
48+
)
49+
);
50+
?>
3851
```
3952

40-
41-
## Usage
42-
43-
The examples are a good place to start, there are several in the `examples` folder. The minimal you'll need to have is:
53+
##### Token Access
4454

4555
```php
46-
<?php
56+
<?
4757
$Checkfront = new Checkfront(
4858
array(
4959
'host'=>'your-company.checkfront.com',
50-
'auth_type' => 'token',
51-
'consumer_key' => 'CHANGE_ME',
52-
'consumer_secret' => 'CHANGE_ME',
53-
'account_id' => 'off',
60+
'auth_type' => 'token',
61+
'api_key' => '5010076404ec1809470508',
62+
'api_secret' => 'ba0a5c0c509445024c374fcd264d41e816b02d4e',
5463
)
5564
);
5665
?>
5766
```
5867

5968
```php
60-
<?php
61-
// fetch all bookings
62-
public function query_booking($booking_id) {
63-
$response = $this->Checkfront->get('booking/index');
64-
return $response;
65-
}
69+
<?
70+
/* Get items rates and availbility*/
71+
$Checkfront->get('item',array(
72+
'start_date'=>date('Y-m-d'),
73+
'end_date'=>date('Y-m-d',strtotime('+3 days'))
74+
));
6675
?>
6776
```

0 commit comments

Comments
 (0)