dash8x / rm-laravel
Laravel wrapper for Revenue Monster PHP SDK
Requires
- php: ^8.0
- illuminate/support: ^6.20 || ^7.30 || ^8.83 || ^9.0 || ^10.0 || ^11.0
- revenuemonster/sdk: ^2.0
Requires (Dev)
- orchestra/testbench: ^4.0 || ^5.0 || ^6.44 || ^7.0 || ^8.0 || ^9.0
- phpunit/phpunit: ^8.5 || ^9.5 || ^10.5
README
Laravel wrapper for Revenue Monster PHP SDK.
Installation
You can install the package via composer:
composer require dash8x/rm-laravel
Optionally you can use the Facade for shorter code. Add this to your facades:
'RevenueMonster' => Dash8x\RevenueMonster\Facades\RevenueMonsterFacade::class;
Setting up the Revenue Monster credentials
Add your Revenue Monster Client ID and Client Secret to your config/services.php
.
You can refer to how to create the API Client from the Official Revenue Monster Documentation.
Make sure to add the private key file to gitignore if you've it in the project directory.
// config/services.php ... 'rm' => [ 'client_id' => env('RM_CLIENT_ID'), // Client ID 'client_secret' => env('RM_CLIENT_SECRET'), // Client Secret 'sandbox' => env('RM_SANDBOX', false), // Whether to use the sandbox mode 'private_key' => base_path('/rm-private-key.pem'), // Path to the private key file ], ...
Usage
Using the App container:
$rm = App::make('rm'); // Get merchant profile try { $response = $rm->merchant->profile(); } catch(ApiException $e) { echo "statusCode : {$e->getCode()}, errorCode : {$e->getErrorCode()}, errorMessage : {$e->getMessage()}"; } catch(Exception $e) { echo $e->getMessage(); }
Using the Facade
// Get merchant profile try { $response = RevenueMonster::merchant()->profile(); } catch(ApiException $e) { echo "statusCode : {$e->getCode()}, errorCode : {$e->getErrorCode()}, errorMessage : {$e->getMessage()}"; } catch(Exception $e) { echo $e->getMessage(); }
Available Methods
Refer to the readme for the Official PHP SDK.
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email contact@arushad.org instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.