Merge pull request #684 from cuneytsenturk/paypalstandard-dev
Paypal Standard re-factoring
This commit is contained in:
commit
dcfa5a6ad1
@ -1,7 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
return [
|
|
||||||
|
|
||||||
'name' => 'PaypalStandard',
|
|
||||||
|
|
||||||
];
|
|
@ -1,21 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Modules\PaypalStandard\Database\Seeders;
|
|
||||||
|
|
||||||
use Illuminate\Database\Seeder;
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
|
|
||||||
class PaypalStandardDatabaseSeeder extends Seeder
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the database seeds.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function run()
|
|
||||||
{
|
|
||||||
Model::unguard();
|
|
||||||
|
|
||||||
// $this->call("OthersTableSeeder");
|
|
||||||
}
|
|
||||||
}
|
|
@ -3,10 +3,9 @@
|
|||||||
namespace Modules\PaypalStandard\Providers;
|
namespace Modules\PaypalStandard\Providers;
|
||||||
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
use Illuminate\Database\Eloquent\Factory;
|
|
||||||
|
|
||||||
use App\Events\PaymentGatewayListing;
|
use App\Events\PaymentGatewayListing;
|
||||||
use Modules\PaypalStandard\Events\Handlers\PaypalStandardGateway;
|
use Modules\PaypalStandard\Listeners\PaypalStandardGateway;
|
||||||
|
|
||||||
class PaypalStandardServiceProvider extends ServiceProvider
|
class PaypalStandardServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
@ -25,13 +24,10 @@ class PaypalStandardServiceProvider extends ServiceProvider
|
|||||||
public function boot()
|
public function boot()
|
||||||
{
|
{
|
||||||
$this->registerTranslations();
|
$this->registerTranslations();
|
||||||
$this->registerConfig();
|
|
||||||
$this->registerViews();
|
$this->registerViews();
|
||||||
$this->registerFactories();
|
$this->registerMigrations();
|
||||||
|
|
||||||
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
$this->registerEvents();
|
||||||
|
|
||||||
$this->app['events']->listen(PaymentGatewayListing::class, PaypalStandardGateway::class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -44,22 +40,6 @@ class PaypalStandardServiceProvider extends ServiceProvider
|
|||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Register config.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
protected function registerConfig()
|
|
||||||
{
|
|
||||||
$this->publishes([
|
|
||||||
__DIR__.'/../Config/config.php' => config_path('paypalstandard.php'),
|
|
||||||
], 'config');
|
|
||||||
|
|
||||||
$this->mergeConfigFrom(
|
|
||||||
__DIR__.'/../Config/config.php', 'paypalstandard'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register views.
|
* Register views.
|
||||||
*
|
*
|
||||||
@ -96,15 +76,14 @@ class PaypalStandardServiceProvider extends ServiceProvider
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function registerMigrations()
|
||||||
* Register an additional directory of factories.
|
|
||||||
* @source https://github.com/sebastiaanluca/laravel-resource-flow/blob/develop/src/Modules/ModuleServiceProvider.php#L66
|
|
||||||
*/
|
|
||||||
public function registerFactories()
|
|
||||||
{
|
{
|
||||||
if (! app()->environment('production')) {
|
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
||||||
app(Factory::class)->load(__DIR__ . '/Database/factories');
|
}
|
||||||
}
|
|
||||||
|
public function registerEvents()
|
||||||
|
{
|
||||||
|
$this->app['events']->listen(PaymentGatewayListing::class, PaypalStandardGateway::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
21
modules/PaypalStandard/Resources/lang/en-GB/general.php
Normal file
21
modules/PaypalStandard/Resources/lang/en-GB/general.php
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
'title' => 'Paypal Standard',
|
||||||
|
'paypalstandard' => 'Paypal Standard',
|
||||||
|
|
||||||
|
'form' => [
|
||||||
|
'email' => 'Email',
|
||||||
|
'mode' => 'Mode',
|
||||||
|
'debug' => 'Debug',
|
||||||
|
'transaction' => 'Transaction',
|
||||||
|
'customer' => 'Show to Customer',
|
||||||
|
'order' => 'Order',
|
||||||
|
],
|
||||||
|
|
||||||
|
'test_mode' => 'Warning: The payment gateway is in \'Sandbox Mode\'. Your account will not be charged.',
|
||||||
|
'description' => 'Pay with PAYPAL',
|
||||||
|
'confirm' => 'Confirm',
|
||||||
|
|
||||||
|
];
|
@ -1,17 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
return [
|
|
||||||
|
|
||||||
'paypalstandard' => 'Paypal Standard',
|
|
||||||
'email' => 'Email',
|
|
||||||
'mode' => 'Mode',
|
|
||||||
'debug' => 'Debug',
|
|
||||||
'transaction' => 'Transaction',
|
|
||||||
'customer' => 'Show to Customer',
|
|
||||||
'order' => 'Order',
|
|
||||||
|
|
||||||
'test_mode' => 'Warning: The payment gateway is in \'Sandbox Mode\'. Your account will not be charged.',
|
|
||||||
'description' => 'Pay with PAYPAL',
|
|
||||||
'confirm' => 'Confirm',
|
|
||||||
|
|
||||||
];
|
|
@ -1,11 +1,11 @@
|
|||||||
<h2>{{ $gateway['name'] }}</h2>
|
<h2>{{ $gateway['name'] }}</h2>
|
||||||
|
|
||||||
@if($gateway['mode'] == 'sandbox')
|
@if($gateway['mode'] == 'sandbox')
|
||||||
<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> {{ trans('paypalstandard::paypalstandard.test_mode') }}</div>
|
<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> {{ trans('paypalstandard::general.test_mode') }}</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<div class="well well-sm">
|
<div class="well well-sm">
|
||||||
{{ trans('paypalstandard::paypalstandard.description') }}
|
{{ trans('paypalstandard::general.description') }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form action="{{ $gateway['action'] }}" method="post">
|
<form action="{{ $gateway['action'] }}" method="post">
|
||||||
@ -42,7 +42,7 @@
|
|||||||
<input type="hidden" name="bn" value="Akaunting_1.0_WPS" />
|
<input type="hidden" name="bn" value="Akaunting_1.0_WPS" />
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<input type="submit" value="{{ trans('paypalstandard::paypalstandard.confirm') }}" class="btn btn-success" />
|
<input type="submit" value="{{ trans('paypalstandard::general.confirm') }}" class="btn btn-success" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
"name": "PaypalStandard",
|
"name": "PaypalStandard",
|
||||||
"alias": "paypalstandard",
|
"alias": "paypalstandard",
|
||||||
"description": "",
|
"description": "",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"category": "payment-gateways",
|
"category": "payment-gateway",
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"active": 1,
|
"active": 1,
|
||||||
"order": 0,
|
"order": 0,
|
||||||
@ -28,7 +28,7 @@
|
|||||||
{
|
{
|
||||||
"type": "textGroup",
|
"type": "textGroup",
|
||||||
"name": "email",
|
"name": "email",
|
||||||
"title": "paypalstandard::paypalstandard.email",
|
"title": "paypalstandard::general.form.email",
|
||||||
"icon": "envelope-o",
|
"icon": "envelope-o",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"required": "required"
|
"required": "required"
|
||||||
@ -37,7 +37,7 @@
|
|||||||
{
|
{
|
||||||
"type": "selectGroup",
|
"type": "selectGroup",
|
||||||
"name": "mode",
|
"name": "mode",
|
||||||
"title": "paypalstandard::paypalstandard.mode",
|
"title": "paypalstandard::general.form.mode",
|
||||||
"icon": "plane",
|
"icon": "plane",
|
||||||
"values": {
|
"values": {
|
||||||
"live": "Live",
|
"live": "Live",
|
||||||
@ -49,7 +49,7 @@
|
|||||||
{
|
{
|
||||||
"type": "selectGroup",
|
"type": "selectGroup",
|
||||||
"name": "transaction",
|
"name": "transaction",
|
||||||
"title": "paypalstandard::paypalstandard.transaction",
|
"title": "paypalstandard::general.form.transaction",
|
||||||
"icon": "exchange",
|
"icon": "exchange",
|
||||||
"values": {
|
"values": {
|
||||||
"authorization": "Authorization",
|
"authorization": "Authorization",
|
||||||
@ -61,7 +61,7 @@
|
|||||||
{
|
{
|
||||||
"type": "radioGroup",
|
"type": "radioGroup",
|
||||||
"name": "customer",
|
"name": "customer",
|
||||||
"title": "paypalstandard::paypalstandard.customer",
|
"title": "paypalstandard::general.form.customer",
|
||||||
"enable": "general.yes",
|
"enable": "general.yes",
|
||||||
"disable": "general.no",
|
"disable": "general.no",
|
||||||
"attributes": {}
|
"attributes": {}
|
||||||
@ -69,7 +69,7 @@
|
|||||||
{
|
{
|
||||||
"type": "radioGroup",
|
"type": "radioGroup",
|
||||||
"name": "debug",
|
"name": "debug",
|
||||||
"title": "paypalstandard::paypalstandard.debug",
|
"title": "paypalstandard::general.form.debug",
|
||||||
"enable": "general.yes",
|
"enable": "general.yes",
|
||||||
"disable": "general.no",
|
"disable": "general.no",
|
||||||
"attributes": {}
|
"attributes": {}
|
||||||
@ -77,7 +77,7 @@
|
|||||||
{
|
{
|
||||||
"type": "textGroup",
|
"type": "textGroup",
|
||||||
"name": "order",
|
"name": "order",
|
||||||
"title": "paypalstandard::paypalstandard.order",
|
"title": "paypalstandard::general.form.order",
|
||||||
"icon": "sort",
|
"icon": "sort",
|
||||||
"attributes": {}
|
"attributes": {}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user