https://github.com/midnite81/gocardless
Laravel 5 intergration for GoCardless
https://github.com/midnite81/gocardless
Last synced: 2 months ago
JSON representation
Laravel 5 intergration for GoCardless
- Host: GitHub
- URL: https://github.com/midnite81/gocardless
- Owner: midnite81
- Created: 2018-09-19T14:46:15.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-11T14:32:30.000Z (over 6 years ago)
- Last Synced: 2025-02-16T05:41:42.784Z (4 months ago)
- Language: PHP
- Size: 46.9 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# A Laravel 5 integration for GoCardless [](https://packagist.org/packages/midnite81/gocardless) [](https://packagist.org/packages/midnite81/gocardless) [](https://packagist.org/packages/midnite81/gocardless) [](https://packagist.org/packages/midnite81/gocardless) [](https://travis-ci.org/midnite81/gocardless) [](https://coveralls.io/github/midnite81/gocardless?branch=master)
This package is a laravel 5 wrapper for the [GoCardless API](https://github.com/gocardless/gocardless-pro-php).
This package is in **PreRelease** and currently relies on dev-master. When ready for release, it will
be tagged correctly.# Installation
This package requires PHP 5.6+, and comes with a Laravel 5 Service Provider and Facade for Laravel integration.
Please note, you do not need to have laravel installed to use this package.To install through composer include the package in your `composer.json`.
"midnite81/gocardless": "dev-master"
Run `composer install` or `composer update` to download the dependencies or you can
run `composer require midnite81/gocardless`.## Laravel 5 Integration
To use the package with Laravel 5 add the GoCardless Service Provider to the list of Service Providers
in `app/config/app.php`.'providers' => [
...
Midnite81\GoCardless\GoCardlessServiceProvider::class
...
];
Add the `GoCardless` facade to your aliases array.'aliases' => [
'GoCardless' => Midnite81\GoCardless\Facades\GoCardless::class,
];
## Publish the required files
Publish the config and migration files using
`php artisan vendor:publish --provider="Midnite81\GoCardless\GoCardlessServiceProvider"`## Environmental Variables
Once you have published the files, you will need to update your `.env` to include the following env keys.
```
GOCARDLESS_ENVIRONMENT=
GOCARDLESS_API_KEY_PRODUCTION=
GOCARDLESS_API_KEY_SANDBOX=
GOCARDLESS_PUBLISH_MIGRATIONS=
```## Check the config
You should take a look at the `config/gocardless.php` configuration file as there are a number of settings you should be
aware of. For example, you can prefix migrations with a custom prefix of your own. Please update these if necessary.## Accessing the GoCardless Client
To access GoCardless you can either use the Facade or the GoCardless Client instance is bound to the IOC container and you can
then dependency inject it via its contract.GoCardless::getClient();
public function __construct(Midnite81\GoCardless\Contracts\Services\Client $client)
{
$this->client = $client;
}