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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ php artisan migrate
## Configuration
If you complete installation step correctly, you can find Larapay config file as larapay.php in you project config file.

For sandbox (banktest) you should set ```LARAPAY_MODE=development``` in your .env file otherwise set ```LARAPAY_MODE=production```
For sandbox (banktest) you should set `LARAPAY_MODE=development` in your .env file otherwise set `LARAPAY_MODE=production`

If you choose development mode, Larapay use banktest.ir as it's payment gateway.
If you choose development mode, Larapay use banktest.ir as its payment gateway.

Set your gateway(s) configs in your .env file. Here are some example:
```ini
Expand Down
4 changes: 2 additions & 2 deletions config/larapay.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/*
|--------------------------------------------------------------------------
| PhpMonsters e-payment component`s operation mode
| PhpMonsters e-payment components operation mode
|--------------------------------------------------------------------------
|
| *** very important config ***
Expand Down Expand Up @@ -198,11 +198,11 @@
),
],
],

/*
|--------------------------------------------------------------------------
| Route name for handle payment callback
|--------------------------------------------------------------------------
*/

'payment_callback' => env('LARAPAY_PAYMENT_CALLBACK' , '')
];
10 changes: 4 additions & 6 deletions database/migrations/create_larapay_transaction_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ class CreateLarapayTransactionTable extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('larapay_transactions', function (Blueprint $table) {

//primary key
$table->increments('id');

//morph to model like order or user
Expand All @@ -40,11 +38,11 @@ class CreateLarapayTransactionTable extends Migration
$table->text('description')->nullable();
$table->bigInteger('amount')->default(0);

if (env('DB_CONNECTION') == 'pgsql') { // for POSTGRESQL
if (config('database.default') == 'pgsql') {
$table->jsonb('extra_params')->nullable()->default('{}');
$table->jsonb('additional_data')->nullable()->default('{}');
$table->jsonb('sharing')->nullable()->default('{}');
} else { // for MYSQL
} else {
$table->jsonb('extra_params')->nullable();
$table->jsonb('additional_data')->nullable();
$table->jsonb('sharing')->nullable();
Expand All @@ -59,7 +57,7 @@ class CreateLarapayTransactionTable extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::dropIfExists('larapay_transactions');
}
Expand Down