Skip to content
Open
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
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
],
"require": {
"nesbot/carbon": "*",
"paypal/rest-api-sdk-php": "*"
"paypal/rest-api-sdk-php": "*",
"ext-soap": "*"
},
"autoload": {
"psr-4": {
Expand Down
13 changes: 13 additions & 0 deletions config/gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

return [

/*
|--------------------------------------------------------------------------
| Default Gateway Configuration Source
|--------------------------------------------------------------------------
|
| Here you may specify the default source
| to obtain configuration from (file,db,...)
|
*/

'default' => env('GATEWAY_CONFIG_SOURCE', 'file'),

//-------------------------------
// Timezone for insert dates in database
// If you want Gateway not set timezone, just leave it empty
Expand Down Expand Up @@ -126,5 +138,6 @@
//-------------------------------
// Tables names
//--------------------------------
'config_table' => 'gateway_configurations',
'table' => 'gateway_transactions',
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddDescriptionToGatewayTransactions extends Migration
{
public function getTable()
{
return config('config_table', 'gateway_configurations');
}

/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create($this->getTable(), function (Blueprint $table) {
$table->increments('id');

//TODO Laravel 4 does not support enums
// We must use following line in that case
// DB::statement("ALTER TABLE gateway_configurations ADD port ENUM(".join(",",(array)Enum::getIPGs()).");
$table->enum('port', (array)Enum::getIPGs());

// Since Multiple settings can be applied to port other than main configuration
// there must be a key-value pair system in db.
//the main configuration key to load the gateway connectiong settings is : "main"
$table->string('key');
$table->text('value');

$table->integer('user_id')->unsigned()->nullable();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade')->onUpdate("cascade");
$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop($this->getTable());
}
}
Loading