Laravel wrapper for Revenue Monster PHP SDK.
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;
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
],
...
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();
}
Refer to the readme for the Official PHP SDK.
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.