2017 © Pedro Peláez
 

library dfcapi-php

DFC API - PHP

image

dfcplc/dfcapi-php

DFC API - PHP

  • Thursday, March 3, 2016
  • by dfcplc
  • Repository
  • 4 Watchers
  • 0 Stars
  • 101 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

DFCAPI for PHP Build Status

The DFC API is a Restful API which has been built to facilitate the ability to Setup/Ammend/Cancel & View Direct Debits with Debit Finance Collections Plc, (*1)

Install with Composer

If you're using Composer to manage dependencies, you can the DFC API Client Library with it., (*2)

{
  "require" : {
    "dfcplc/dfcapi-php" : "dev-master"
  },
  "autoload": {
    "psr-0": {"Dfcapi": "lib/"}
  }
}

Install source from GitHub

The DFCAPI-PHP Client Library requires PHP v5.3+. Download the PHP library from Github, and require in your script like so:, (*3)

To install the source code:, (*4)

$ git clone git@github.com:dfcplc/dfcapi-php.git 

And include it in your scripts:, (*5)

require_once '/path/to/dfcapi-php/lib/Dfcapi.php';

Checking API Credentials

So you're probably wondering how using Unirest makes creating requests in PHP easier, let's look at a working example:, (*6)

$dfcapi = new Dfcapi();
$response = $dfcapi->CheckApiKey('TEST-TEST-TEST-TEST','a94a8fe5ccb19ba61c4c0873d391e987982fbbd3');

var_dump($response); // API Credential Check Response (true or false)

Extra Details

When calling the API, additional details can be retrieved using the below methods:, (*7)

$dfcapi = new Dfcapi();

$dfcapi->getErrors(); //Array of returned errors from the API Call

$dfcapi->getResponseCode(); //HTTP Response Code (200 = OK)

$dfcapi->getResponseBody(); //HTTP Response Body (Object)

$dfcapi->getResponseBodyRaw(); //HTTP Response Body (Raw)

$dfcapi->getResponseHeaders(); //HTTP Response Headers (Array)

Thanks

Thanks go out to: * thefosk @ mashape.com - Unirest Restful Library, (*8)

The Versions

03/03 2016

dev-master

9999999-dev https://github.com/dfcplc/dfcapi-php

DFC API - PHP

  Sources   Download

MIT

The Requires

 

api direct debit dd dfc

03/03 2016

1.0.2

1.0.2.0 https://github.com/dfcplc/dfcapi-php

DFC API - PHP

  Sources   Download

MIT

The Requires

 

api direct debit dd dfc

22/12 2015

1.0.1

1.0.1.0 https://github.com/dfcplc/dfcapi-php

DFC API - PHP

  Sources   Download

MIT

The Requires

 

api direct debit dd dfc

21/08 2015

1.0

1.0.0.0 https://github.com/dfcplc/dfcapi-php

DFC API - PHP

  Sources   Download

MIT

The Requires

 

api direct debit dd dfc