-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9ffff5b
Showing
5 changed files
with
131 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
composer.lock | ||
composer.phar | ||
phpunit.xml | ||
vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "christhompsontldr/laravel-recurly", | ||
"homepage": "https://github.com/ChrisThompsonTLDR/laravel-recurly", | ||
"description": "A simple Laravel 5 service provider for including the Recurly PHP client.", | ||
"keywords": ["laravel","laravel 5","recurly","recurring","billing","api"], | ||
"license":"MIT", | ||
"authors":[ | ||
{ | ||
"name":"Chris Thompson", | ||
"email":"christhompsontldr@gmail.com", | ||
"homepage":"https://christhompsontldr.com" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.3.0", | ||
"recurly/recurly-client": "2.6.*" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Christhompsontldr\\LaravelRecurly\\": "src/" | ||
} | ||
} | ||
} | ||
ds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
return [ | ||
/** | ||
* Your Recurly subdomain | ||
*/ | ||
'subdomain' => env('RECURLY_SUBDOMAIN'), | ||
|
||
/** | ||
* API key to connect to Recurly | ||
*/ | ||
'api_key' => env('RECURLY_API_KEY'), | ||
|
||
/** | ||
* Only needed if you plan on using the Recurly JS lib. | ||
*/ | ||
'private_key' => env('RECURLY_PRIVATE_KEY'), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
recurly-client-laravel | ||
====================== | ||
|
||
Integrates the Recurly API with Laravel 5 | ||
|
||
A simple [Laravel 5](http://four.laravel.com/) service provider for including the [Recurly PHP Client](https://github.com/recurly/recurly-client-php). | ||
|
||
## Installation | ||
|
||
Install via [Composer](http://getcomposer.org) by requiring the | ||
`christhompsontldr/laravel-recurly` package in your project's `composer.json`. | ||
|
||
```json | ||
{ | ||
"require": { | ||
"christhompsontldr/laravel-recurly": "1.*" | ||
} | ||
} | ||
``` | ||
|
||
Run composer update to pull in the libraries. | ||
```bash | ||
composer update | ||
``` | ||
|
||
|
||
## Configure | ||
|
||
To use the Recurly Service Provider, you must register the provider when bootstrapping your Laravel application. | ||
|
||
Add 'Christhompsontldr\LaravelRecurly\ServiceProvider' to the list of service providers in app/config/app.php | ||
```php | ||
'Christhompsontldr\LaravelRecurly\ServiceProvider::class,', | ||
``` | ||
|
||
Create a config file for the package | ||
```bash | ||
php artisan config:publish christhompsontldr/laravel-recurly | ||
``` | ||
|
||
Add your Recurly information to the your .env file using the keys found in config/recurly.php. | ||
|
||
## Usage | ||
|
||
http://docs.recurly.com/client-libraries/php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace Christhompsontldr\LaravelRecurly; | ||
|
||
use \Recurly_Client; | ||
use \Recurly_js; | ||
|
||
class ServiceProvider extends \Illuminate\Support\ServiceProvider { | ||
|
||
/** | ||
* Indicates if loading of the provider is deferred. | ||
* | ||
* @var bool | ||
*/ | ||
protected $defer = false; | ||
|
||
/** | ||
* Bootstrap the application events. | ||
* | ||
* @return void | ||
*/ | ||
public function boot() | ||
{ | ||
// config | ||
$this->publishes([ | ||
realpath(dirname(__DIR__)) . '/config/recurly.php' => config_path('recurly.php'), | ||
], 'config'); | ||
} | ||
|
||
/** | ||
* Register the service provider. | ||
* | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
Recurly_Client::$subdomain = config('recurly.subdomain', null); | ||
Recurly_Client::$apiKey = config('recurly.api_key', null); | ||
Recurly_js::$privateKey = config('recurly.private_key', null); | ||
} | ||
} |