add online payment module

This commit is contained in:
2025-10-29 18:42:45 +05:00
parent 64dc80e069
commit b0038d3e94
4 changed files with 167 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('online_payments', function (Blueprint $table) {
$table->string('refunded_amount')->nullable();
$table->string('booking_number')->nullable()->index();
$table->string('amount')->nullable();
$table->string('depositedAmount')->nullable();
$table->string('orderNumber')->nullable()->index();
$table->string('description')->nullable();
$table->string('orderId')->nullable()->index();
$table->string('cardholderName')->nullable()->index();
$table->string('pan')->nullable()->index();
$table->string('expiration')->nullable();
$table->string('formUrl')->nullable();
$table->string('successUrl')->nullable();
$table->string('errorUrl')->nullable();
$table->string('paymentStatus')->nullable()->index();
$table->string('callbackStatus')->nullable();
$table->string('username')->nullable()->index();
$table->string('approvalCode')->nullable();
$table->unsignedBigInteger('online_paymantable_id')->index()->nullable();
$table->string('online_paymantable_type')->index()->nullable();
$table->string('api_client')->nullable()->index();
$table->json('api_response')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('online_payments');
}
};

View File

@@ -0,0 +1,46 @@
<?php
namespace App\Modules\OnlinePayment\Models;
use Illuminate\Database\Eloquent\Model;
/**
* @property int $id
* @property string $refunded_amount
* @property string $booking_number
* @property string $amount
* @property string $depositedAmount
* @property string $orderNumber
* @property string $description
* @property string $orderId
* @property string $cardholderName
* @property string $pan
* @property string $approvalCode
* @property string $expiration
* @property string $formUrl
* @property string $successUrl
* @property string $errorUrl
* @property string $api_client
* @property string $paymentStatus
* @property string $callbackStatus
* @property string $username
* @property int $online_paymantable_id
* @property string $online_paymantable_type
* @property ?array $api_response
* @property \Illuminate\Support\Carbon $created_at
* @property \Illuminate\Support\Carbon $updated_at
*/
class OnlinePayment extends Model
{
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'api_response' => 'array',
];
}
}

View File

@@ -0,0 +1,64 @@
<?php
namespace App\Modules\OnlinePayment;
use App\Modules\Makeable;
use App\Modules\ModuleContract;
class OnlinePaymentModule implements ModuleContract
{
use Makeable;
/**
* Module is enabled
*/
protected bool $enabled = true;
/**
* Check if is module enabled
*/
public function isEnabled(): bool
{
return $this->enabled;
}
/**
* Disable module
*/
public function disable(): void
{
$this->enabled = false;
}
/**
* Enable module
*/
public function enable(): void
{
$this->enabled = true;
}
/**
* Check if module has a filament resource
*/
public function hasFilamentResource(): bool
{
return false;
}
/**
* Get module composer requirements
*/
public function getComposerRequirements(): array
{
return [];
}
/**
* Get module composer suggestions
*/
public function getComposerSuggestions(): array
{
return [];
}
}

View File

@@ -0,0 +1,5 @@
<?php
namespace App\Modules\OnlinePayment\Repositories;
class OnlinePaymentRepository {}