Skip to content

Commit

Permalink
add base code for paypal
Browse files Browse the repository at this point in the history
  • Loading branch information
xxl4 committed Jul 19, 2024
0 parents commit 9127ab8
Show file tree
Hide file tree
Showing 24 changed files with 579 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# NexaMerchant/Paypal

# How to Install


```
NexaMerchant\Paypal\Providers\PaypalServiceProvider::class,
```
Add it to config/app.php $providers

# How to Publish

```
composer require nexa-merchant/paypal
```
40 changes: 40 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "nexa-merchant/paypal",
"license": "MIT",
"type": "library",
"description" : "Paypal Apps",
"authors": [
{
"name": "Steven",
"email": "[email protected]"
}
],
"require": {
"laravel/framework": "~10.0||~11.0"
},
"require-dev": {
"phpunit/phpcov": ">=6.0",
"phpunit/phpunit": ">=8.0",
"laravel/framework": "~10.0||~11.0"
},
"autoload": {
"psr-4": {
"NexaMerchant\\Paypal\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"NexaMerchant\\Paypal\\Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"providers": [
"NexaMerchant\\Paypal\\Providers\\PaypalServiceProvider"
],
"aliases": {}
}
},
"homepage": "https://nexamerchant.github.io/docs/",
"minimum-stability": "dev"
}
34 changes: 34 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="tests/bootstrap.php"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
>
<testsuites>
<testsuite name="Paypal Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<logging>
<log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage" />
<log type="coverage-text" target="php://stdout" showUncoveredFiles="false" showOnlySummary="true"/>
</logging>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src/</directory>
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_DEBUG" value="true"/>
<env name="APP_URL" value="http://localhost"/>
<env name="APP_KEY" value="base64:M1igrxNfAWlVGyxxDholHqvVqvtPjAzCoJ+2/ILAVPw="/>
</php>
</phpunit>
14 changes: 14 additions & 0 deletions src/Config/Paypal.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
/**
*
* This file is auto generate by Nicelizhi\Apps\Commands\Create
* @author Steve
* @date 2024-07-19 15:33:07
* @link https://github.com/xxxl4
*
*/
return [
'name' => 'Paypal',
'version' => '1.0.0',
'versionNum' => '100',
];
12 changes: 12 additions & 0 deletions src/Config/acl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/**
*
* This file is auto generate by Nicelizhi\Apps\Commands\Create
* @author Steve
* @date 2024-07-19 15:33:07
* @link https://github.com/xxxl4
*
*/
return [

];
21 changes: 21 additions & 0 deletions src/Config/menu.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
*
* This file is auto generate by Nicelizhi\Apps\Commands\Create
* @author Steve
* @date 2024-07-19 15:33:07
* @link https://github.com/xxxl4
*
*/
return [
/**
* Paypal Dashboard.
*/
[
'key' => 'Paypal',
'name' => 'paypal::app.paypal.demo',
'route' => 'paypal.admin.example.demo',
'sort' => 1,
'icon' => 'icon-dashboard',
]
];
38 changes: 38 additions & 0 deletions src/Console/Commands/Install.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
*
* This file is auto generate by Nicelizhi\Apps\Commands\Create
* @author Steve
* @date 2024-07-19 15:33:07
* @link https://github.com/xxxl4
*
*/
namespace NexaMerchant\Paypal\Console\Commands;

use Nicelizhi\Apps\Console\Commands\CommandInterface;

class Install extends CommandInterface

{
protected $signature = 'Paypal:install';

protected $description = 'Install Paypal an app';

public function getAppVer() {
return config("Paypal.ver");
}

public function getAppName() {
return config("Paypal.name");
}

public function handle()
{
$this->info("Install app: Paypal");
if (!$this->confirm('Do you wish to continue?')) {
// ...
$this->error("App Paypal Install cannelled");
return false;
}
}
}
Empty file.
37 changes: 37 additions & 0 deletions src/Console/Commands/UnInstall.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
/**
*
* This file is auto generate by Nicelizhi\Apps\Commands\Create
* @author Steve
* @date 2024-07-19 15:33:07
* @link https://github.com/xxxl4
*
*/
namespace NexaMerchant\Paypal\Console\Commands;

use Nicelizhi\Apps\Console\Commands\CommandInterface;

class UnInstall extends CommandInterface

{
protected $signature = 'Paypal:uninstall';

protected $description = 'Uninstall Paypal an app';

public function getAppVer() {
return config("Paypal.ver");
}

public function getAppName() {
return config("Paypal.name");
}

public function handle()
{
if (!$this->confirm('Do you wish to continue?')) {
// ...
$this->error("App Paypal UnInstall cannelled");
return false;
}
}
}
Empty file added src/Console/Commands/Upload.php
Empty file.
30 changes: 30 additions & 0 deletions src/Http/Controllers/Admin/Controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
*
* This file is auto generate by Nicelizhi\Apps\Commands\Create
* @author Steve
* @date 2024-07-19 15:33:07
* @link https://github.com/xxxl4
*
*/
namespace NexaMerchant\Paypal\Http\Controllers\Admin;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function redirectToLogin()
{
return redirect()->route('admin.session.create');
}
}
23 changes: 23 additions & 0 deletions src/Http/Controllers/Admin/ExampleController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
/**
*
* This file is auto generate by Nicelizhi\Apps\Commands\Create
* @author Steve
* @date 2024-07-19 15:33:07
* @link https://github.com/xxxl4
*
*/
namespace NexaMerchant\Paypal\Http\Controllers\Admin;

use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Http\Request;

class ExampleController extends Controller
{
public function demo(Request $request) {
$data = [];
$data['code'] = 200;
$data['message'] = "Demo";
return view('Paypal::Admin.demo', compact("data"));
}
}
19 changes: 19 additions & 0 deletions src/Http/Controllers/Api/Controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
*
* This file is auto generate by Nicelizhi\Apps\Commands\Create
* @author Steve
* @date 2024-07-19 15:33:07
* @link https://github.com/xxxl4
*
*/
namespace NexaMerchant\Paypal\Http\Controllers\Api;

use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;

class Controller extends BaseController
{
use DispatchesJobs, ValidatesRequests;
}
22 changes: 22 additions & 0 deletions src/Http/Controllers/Api/ExampleController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/**
*
* This file is auto generate by Nicelizhi\Apps\Commands\Create
* @author Steve
* @date 2024-07-19 15:33:07
* @link https://github.com/xxxl4
*
*/
namespace NexaMerchant\Paypal\Http\Controllers\Api;

use Illuminate\Foundation\Validation\ValidatesRequests;

class ExampleController extends Controller
{
public function demo() {
$data = [];
$data['code'] = 200;
$data['message'] = "success";
return response()->json($data);
}
}
19 changes: 19 additions & 0 deletions src/Http/Controllers/Web/Controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
*
* This file is auto generate by Nicelizhi\Apps\Commands\Create
* @author Steve
* @date 2024-07-19 15:33:07
* @link https://github.com/xxxl4
*
*/
namespace NexaMerchant\Paypal\Http\Controllers\Web;

use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;

class Controller extends BaseController
{
use DispatchesJobs, ValidatesRequests;
}
23 changes: 23 additions & 0 deletions src/Http/Controllers/Web/ExampleController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
/**
*
* This file is auto generate by Nicelizhi\Apps\Commands\Create
* @author Steve
* @date 2024-07-19 15:33:07
* @link https://github.com/xxxl4
*
*/
namespace NexaMerchant\Paypal\Http\Controllers\Web;

use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Http\Request;

class ExampleController extends Controller
{
public function demo(Request $request) {
$data = [];
$data['code'] = 200;
$data['message'] = "Demo";
return view('Paypal::demo', compact("data"));
}
}
Loading

0 comments on commit 9127ab8

Please sign in to comment.