-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 新增支付应用、支付渠道应用、支付商户等模型 - 创建支付单、退款单等迁移 - 添加支付状态、商户类型等枚举- 更新领域模型图
- Loading branch information
1 parent
7efab94
commit f2d6897
Showing
23 changed files
with
3,375 additions
and
976 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
packages/payment/database/migrations/create_payment_isvs_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration { | ||
public function up() : void | ||
{ | ||
Schema::create(config('red-jasmine-payment.tables.prefix') . 'payment_isvs', function (Blueprint $table) { | ||
$table->unsignedBigInteger('id')->primary()->comment('ID'); | ||
$table->unsignedBigInteger('merchant_id')->comment('商户ID'); | ||
$table->string('name')->comment('名称'); | ||
$table->string('status')->comment('状态'); | ||
$table->string('remarks')->comment('备注'); | ||
$table->nullableMorphs('creator'); | ||
$table->nullableMorphs('updater'); | ||
$table->timestamps(); | ||
$table->softDeletes(); | ||
$table->comment('支付应用表'); | ||
}); | ||
} | ||
|
||
public function down() : void | ||
{ | ||
Schema::dropIfExists(config('red-jasmine-payment.tables.prefix') . 'payment_isvs'); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
packages/payment/database/migrations/create_payment_transfers_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration { | ||
public function up() : void | ||
{ | ||
Schema::create('payment_transfers', function (Blueprint $table) { | ||
$table->unsignedBigInteger('id')->primary()->comment('表ID'); | ||
|
||
|
||
|
||
$table->timestamps(); | ||
$table->comment('支付-转账'); | ||
}); | ||
} | ||
|
||
public function down() : void | ||
{ | ||
Schema::dropIfExists('payment_transfers'); | ||
} | ||
}; |
30 changes: 30 additions & 0 deletions
30
packages/payment/src/Domain/Models/Enums/MerchantTypeEnum.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace RedJasmine\Payment\Domain\Models\Enums; | ||
|
||
use RedJasmine\Support\Helpers\Enums\EnumsHelper; | ||
|
||
/** | ||
* 商户类型 | ||
*/ | ||
enum MerchantTypeEnum: string | ||
{ | ||
use EnumsHelper; | ||
|
||
// 普通商户 | ||
case GENERAL = 'general'; | ||
|
||
// 二级商户 | ||
case SUB = 'sub'; | ||
|
||
|
||
public static function lables() : array | ||
{ | ||
return [ | ||
self::GENERAL->value => '普通商户', | ||
self::SUB->value => '二级商户', | ||
]; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace RedJasmine\Payment\Domain\Models; | ||
|
||
abstract class Model extends \Illuminate\Database\Eloquent\Model | ||
{ | ||
|
||
public function getConnectionName() | ||
{ | ||
return config('red-jasmine-payment.tables.connection', null); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace RedJasmine\Payment\Domain\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Database\Eloquent\SoftDeletes; | ||
|
||
class PaymentIsv extends Model | ||
{ | ||
|
||
use SoftDeletes; | ||
|
||
|
||
|
||
|
||
public function getTable() : string | ||
{ | ||
return config('red-jasmine-payment.tables.prefix', 'jasmine_') . 'payment_isv'; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.