LaravelPackages.net
Acme Inc.
Toggle sidebar
dash8x/rm-laravel

Laravel wrapper for Revenue Monster PHP SDK

405
1
v1.1.0
About dash8x/rm-laravel

dash8x/rm-laravel is a Laravel package for laravel wrapper for revenue monster php sdk. It currently has 1 GitHub stars and 405 downloads on Packagist (latest version v1.1.0). Install it with composer require dash8x/rm-laravel. Discover more Laravel packages by dash8x or browse all Laravel packages to compare alternatives.

Last updated

Revenue Monster Laravel Wrapper

Latest Version on Packagist Test Status Code Coverage Badge Total Downloads

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 [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Comments