Laravel Go Cardless
, (*1)
A Laravel 5.5 Wrapper for the Go Cardless PHP Client Library. This package provides simple elegant access to the Go Cardless PHP Client API from across the Laravel Application., (*2)
The included helper method makes accessing the underlying methods as easy as:, (*3)
gocardless()->customers()->list(), (*4)
Installation Laravel 5.5 +
Simply require the package through composer and let the Laravel Package Auto Discovery do the rest., (*5)
composer require ollywarren/laravel-go-cardless, (*6)
Publish the vendor configuration:, (*7)
php artisan vendor:publish (Select the relevant package from the list), (*8)
Set two environment variables in your Apps .env file:, (*9)
GOCARDLESS_ENV="sandbox" OR "live"
GOCARDLESS_TOKEN="<YOUR API TOKEN>"
Installation Laravel 5.4
Use composer to add it to your project dependencies:, (*10)
composer require ollywarren/laravel-go-cardless, (*11)
Then inside your config/app.php, (*12)
Add the package service provider to the providers array:, (*13)
Ollywarren\LaravelGoCardless\GoCardlessServiceProvider::class,, (*14)
Finally for good measure dump the composer autoloader to make sure we've pulled in the helper method:, (*15)
composer dump-autoloader, (*16)
Publish the vendor configuration:, (*17)
php artisan vendor:publish, (*18)
Set two environment variables in your Apps .env file:, (*19)
GOCARDLESS_ENV="sandbox" OR "live"
GOCARDLESS_TOKEN="<YOUR API TOKEN>"
Usage Instructions
This package exposes the underlaying Go Cardless PHP Client Library usign the gocardless() helper method.
Any of the methods described in the API Documentation will be accessible., (*20)
For example:, (*21)
Get a List of Customers
gocardless()->customers()->list();, (*22)
Create a New Customer
gocardless()->customers()->create([
'params' => [
"given_name" => "Jack",
"family_name" => "Sparrow",
"email" => "oljacky@sparrowsnest.com"
]
]);
For a full breakdown of the API see the Documentation or the PHP Client Library, (*23)