Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vendor
32 changes: 32 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "akcybex/jazzcash",
"description": "Jazzcash - Laravel Jazzcash Payment Gateway Integration",
"type": "project",
"license": "MIT",
"autoload": {
"psr-4": {
"App\\": "app/",
"AKCybex\\JazzCash\\": "src/"
},
"classmap": [
]
},
"authors": [
{
"name": "Rana Tayyab",
"email": "akcybex@gmail.com"
}
],
"minimum-stability": "dev",
"require": {},
"extra": {
"laravel": {
"providers": [
"AKCybex\\JazzCash\\AKJazzCashServiceProvider"
],
"aliases": {
"JazzCash": "AKCybex\\JazzCash\\Facades\\JazzCash"
}
}
}
}
19 changes: 19 additions & 0 deletions publishable/config/jazzcash.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

return [
'environment' => env('JAZZCASH_ENVIRONMENT', 'sandbox'),
'sandbox' => [
'merchant_id' => env('SANDBOX_JAZZCASH_MERCHANT_ID'),
'password' => env('SANDBOX_JAZZCASH_PASSWORD'),
'integerity_salt' => env('SANDBOX_JAZZCASH_INTEGERITY_SALT'),
'return_url' => env('SANDBOX_JAZZCASH_RETURN_URL'),
'endpoint' => env('SANDBOX_JAZZCASH_ENDPOINT'),
],
'live' => [
'merchant_id' => env('JAZZCASH_MERCHANT_ID'),
'password' => env('JAZZCASH_PASSWORD'),
'integerity_salt' => env('JAZZCASH_INTEGERITY_SALT'),
'return_url' => env('JAZZCASH_RETURN_URL'),
'endpoint' => env('JAZZCASH_ENDPOINT'),
],
];
75 changes: 75 additions & 0 deletions src/AKJazzCashServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?php

namespace AKCybex\JazzCash;

use Illuminate\Support\ServiceProvider;

class AKJazzCashServiceProvider extends ServiceProvider
{
/**
* Register services.
*
* @return void
*/
public function register()
{
$this->loadHelpers();

$this->registerConfigs();

if ($this->app->runningInConsole()) {
$this->registerPublishableResources();
}

$this->app->bind('jazzcash', function($app) {
return new JazzCash();
});
}

/**
* Bootstrap services.
*
* @return void
*/
public function boot()
{

}

/**
* Load helpers.
*/
protected function loadHelpers()
{
foreach (glob(__DIR__.'/Helpers/*.php') as $filename) {
require_once $filename;
}
}

/**
* Register the publishable files.
*/
private function registerPublishableResources()
{
$publishablePath = dirname(__DIR__).'/publishable';

$publishable = [
'config' => [
"{$publishablePath}/config/jazzcash.php" => config_path('jazzcash.php'),
],

];

foreach ($publishable as $group => $paths) {
$this->publishes($paths, $group);
}
}

public function registerConfigs()
{
$this->mergeConfigFrom(
dirname(__DIR__).'/publishable/config/jazzcash.php',
'jazzcash'
);
}
}
13 changes: 13 additions & 0 deletions src/Facades/JazzCash.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace AKCybex\JazzCash\Facades;

use Illuminate\Support\Facades\Facade;

class JazzCash extends Facade
{
protected static function getFacadeAccessor()
{
return 'jazzcash';
}
}
Loading