-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Beem-Dev/dev
Dev
- Loading branch information
Showing
42 changed files
with
1,102 additions
and
132 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 @@ | ||
patreon: alphaolomi |
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
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
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
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 |
---|---|---|
@@ -1,5 +1,37 @@ | ||
<?php | ||
// config for Beem\Laravel/Beem | ||
|
||
return [ | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Beem API Key | ||
|-------------------------------------------------------------------------- | ||
| | ||
| You can obtain this key after creating a Beem vendor account, then | ||
| visit the Profile tab and click on "Authentication Information" | ||
| | ||
*/ | ||
'api_key' => env('BEEM_KEY'), | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Beem Secret Key | ||
|-------------------------------------------------------------------------- | ||
| | ||
| You can obtain this key after creating a Beem vendor account, then visit | ||
| the Profile tab and click on "Authentication Information" then Generate | ||
| | ||
*/ | ||
'secret_key' => env('BEEM_SECRET'), | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Beem Path | ||
|-------------------------------------------------------------------------- | ||
| | ||
| This path name will be used as a prefix for all routes available | ||
| | ||
*/ | ||
'path' => env('BEEM_PATH', 'beem'), | ||
|
||
]; |
Empty file.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
<?php | ||
|
||
use Beem\Laravel\Http\Controllers\AirtimeCallbackController; | ||
use Beem\Laravel\Http\Controllers\PaymentCheckoutCallbackController; | ||
use Beem\Laravel\Http\Controllers\PaymentCollectionController; | ||
use Beem\Laravel\Http\Controllers\SmsDeliveryReportController; | ||
use Beem\Laravel\Http\Controllers\TwoWaySmsCallbackController; | ||
use Beem\Laravel\Http\Controllers\UssdCallbackController; | ||
use Illuminate\Support\Facades\Route; | ||
|
||
Route::post('sms-delivery-report', SmsDeliveryReportController::class) | ||
->name('beem.sms-delivery-report'); | ||
|
||
Route::post('outbound-sms', TwoWaySmsCallbackController::class) | ||
->name('beem.outbound-sms'); | ||
|
||
Route::post('ussd-callback', UssdCallbackController::class) | ||
->name('beem.ussd-callback'); | ||
|
||
Route::post('airtime-callback', AirtimeCallbackController::class) | ||
->name('beem.airtime-callback'); | ||
|
||
Route::post('payment-collection', PaymentCollectionController::class) | ||
->name('beem.payment-collection'); | ||
|
||
Route::post('payment-checkout', PaymentCheckoutCallbackController::class) | ||
->name('beem.payment-checkout'); |
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 |
---|---|---|
@@ -1,7 +1,34 @@ | ||
<?php | ||
|
||
namespace Beem\Laravel\Beem; | ||
namespace Beem\Laravel; | ||
|
||
use Beem\Laravel\Traits\Airtime\HandlesAirtime; | ||
use Beem\Laravel\Traits\Contacts\HandlesContacts; | ||
use Beem\Laravel\Traits\Disbursements\HandlesDisbursements; | ||
use Beem\Laravel\Traits\Otp\HandlesOtp; | ||
use Beem\Laravel\Traits\PaymentCollections\HandlesPaymentCollections; | ||
use Beem\Laravel\Traits\Sms\HandlesSms; | ||
use Beem\Laravel\Traits\Ussd\HandlesUssd; | ||
use Illuminate\Config\Repository; | ||
use Illuminate\Contracts\Foundation\Application; | ||
|
||
class Beem | ||
{ | ||
use HandlesAirtime; | ||
use HandlesContacts; | ||
use HandlesDisbursements; | ||
use HandlesOtp; | ||
use HandlesPaymentCollections; | ||
use HandlesSms; | ||
use HandlesUssd; | ||
|
||
/** | ||
* Fetch the prefix name for all routes | ||
* | ||
* @return Repository|Application|mixed | ||
*/ | ||
public static function pathPrefix() | ||
{ | ||
return config('beem.path'); | ||
} | ||
} |
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,10 @@ | ||
<?php | ||
|
||
namespace Beem\Laravel; | ||
|
||
use Beem\Laravel\Traits\PaymentCheckouts\HandlesPaymentCheckouts; | ||
|
||
class BeemRedirect | ||
{ | ||
use HandlesPaymentCheckouts; | ||
} |
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 |
---|---|---|
@@ -1,21 +1,42 @@ | ||
<?php | ||
|
||
namespace Beem\Laravel\Beem; | ||
namespace Beem\Laravel; | ||
|
||
use Beem\Laravel\Beem\Commands\BeemCommand; | ||
use Spatie\LaravelPackageTools\Package; | ||
use Spatie\LaravelPackageTools\PackageServiceProvider; | ||
use Illuminate\Support\Facades\Route; | ||
use Illuminate\Support\ServiceProvider; | ||
|
||
class BeemServiceProvider extends PackageServiceProvider | ||
class BeemServiceProvider extends ServiceProvider | ||
{ | ||
public function configurePackage(Package $package): void | ||
public function boot() | ||
{ | ||
/* More info: https://github.com/spatie/laravel-package-tools */ | ||
$package | ||
->name('laravel-beem') | ||
->hasConfigFile() | ||
->hasViews() | ||
->hasMigration('create_laravel-beem_table') | ||
->hasCommand(BeemCommand::class); | ||
if ($this->app->runningInConsole()) { | ||
$this->publishes([ | ||
__DIR__ . '/../config/beem.php' => config_path('beem.php'), | ||
], 'beem-config'); | ||
} | ||
} | ||
|
||
public function register() | ||
{ | ||
$this->registerFacades(); | ||
|
||
$this->registerRoutes(); | ||
} | ||
|
||
private function registerFacades() | ||
{ | ||
$this->app->singleton('Beem', fn ($app) => new \Beem\Laravel\Beem()); | ||
|
||
$this->app->singleton('BeemRedirect', fn ($app) => new \Beem\Laravel\BeemRedirect()); | ||
} | ||
|
||
private function registerRoutes() | ||
{ | ||
$prefix = Beem::pathPrefix(); | ||
|
||
Route::group( | ||
compact('prefix'), | ||
fn () => $this->loadRoutesFrom(__DIR__ . '/../routes/web.php') | ||
); | ||
} | ||
} |
Oops, something went wrong.