/
Resources.php
116 lines (105 loc) · 3.6 KB
/
Resources.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
namespace Xpressengine\XePlugin\XeroPay;
use App\Facades\XeRegister;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Route;
class Resources
{
public static function registerRoute()
{
Route::namespace('Xpressengine\XePlugin\XeroPay')
->prefix('payment')
->group(function () {
Route::post('/form', [
'as' => 'xero_pay::formList',
'uses' => 'Controller@formList',
'middleware'=>'web'
]);
Route::match(['get', 'post'], '/callback', [
'as' => 'xero_pay::callback',
'uses' => 'Controller@callback'
]);
Route::get('/', [
'as' => 'xero_pay::index',
'uses' => 'Controller@index'
]);
Route::get('/close', [
'as' => 'xero_pay::close',
'uses' => 'Controller@close'
]);
Route::post('/bank', [
'as' => 'xero_pay::bank',
'uses' => 'Controller@vBank'
]);
Route::get('/cancel', [
'as'=>'xero_pay::cancel',
'uses'=>'Controller@cancel'
]);
});
Route::settings('xero_pay', function () {
Route::group([
'namespace' => 'Xpressengine\\XePlugin\\XeroPay'
], function () {
Route::get('/', [
'as' => 'xero_pay::index',
'uses' => 'Controller@index',
'settings_menu' => 'xeropay'
]);
Route::post('/', [
'as' => 'xero_pay::post',
'uses' => 'Controller@setConfig'
]);
});
});
}
public static function registerMenu()
{
XeRegister::push('settings/menu', 'xeropay', [
'title' => '결제 관리',
'description' => '결제관리용',
'display' => true,
'ordering' => 20000
]);
}
public static function addColumn()
{
Schema::table('xero_pay_payment', function (Blueprint $table) {
$table->string('transaction_id')->nullable();
});
}
public static function makeDataTable()
{
Schema::create('xero_pay_payment', function (Blueprint $table) {
$table->string('id', 36);
$table->string('transaction_id')->nullable();
$table->string('user_id');
$table->string('name');
$table->string('ip');
$table->string('payment_type');
$table->string('payable_id');
$table->string('payable_type');
$table->string('payable_unique_id');
$table->integer('price');
$table->string('method');
$table->boolean('is_paid_method');
$table->text('info');
$table->string('status');
$table->text('receipt');
$table->timestamps();
});
Schema::create('xero_pay_log', function (Blueprint $table) {
$table->increments('id');
$table->string('status');
$table->string('payment_id', 36);
$table->text('req');
$table->text('res');
$table->string('action');
$table->timestamps();
});
}
public static function deleteDataTable(){
Schema::dropIfExists('xero_pay_payment');
Schema::dropIfExists('xero_pay_log');
}
}