2020-05-19 16:49:33 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\User;
|
|
|
|
|
2021-04-28 16:56:08 +08:00
|
|
|
use App\Models\Payment;
|
2021-01-08 00:33:11 +08:00
|
|
|
use App\Utils\Dict;
|
2020-05-19 16:49:33 +08:00
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
|
|
|
|
|
|
class CommController extends Controller
|
|
|
|
{
|
|
|
|
public function config()
|
|
|
|
{
|
|
|
|
return response([
|
|
|
|
'data' => [
|
2021-02-03 18:27:21 +08:00
|
|
|
'is_telegram' => (int)config('v2board.telegram_bot_enable', 0),
|
2021-12-17 01:53:03 +08:00
|
|
|
'telegram_discuss_link' => config('v2board.telegram_discuss_link'),
|
2021-02-03 18:27:21 +08:00
|
|
|
'stripe_pk' => config('v2board.stripe_pk_live'),
|
2021-02-03 18:17:32 +08:00
|
|
|
'withdraw_methods' => config('v2board.commission_withdraw_method', Dict::WITHDRAW_METHOD_WHITELIST_DEFAULT),
|
2021-11-14 02:43:41 +08:00
|
|
|
'withdraw_close' => (int)config('v2board.withdraw_close_enable', 0),
|
|
|
|
'currency' => config('v2board.currency', 'CNY'),
|
|
|
|
'currency_symbol' => config('v2board.currency_symbol', '¥')
|
2020-05-19 16:49:33 +08:00
|
|
|
]
|
|
|
|
]);
|
|
|
|
}
|
2021-04-28 16:56:08 +08:00
|
|
|
|
|
|
|
public function getStripePublicKey(Request $request)
|
|
|
|
{
|
|
|
|
$payment = Payment::where('id', $request->input('id'))
|
|
|
|
->where('payment', 'StripeCredit')
|
|
|
|
->first();
|
|
|
|
if (!$payment) abort(500, 'payment is not found');
|
|
|
|
return response([
|
2021-08-06 00:43:01 +08:00
|
|
|
'data' => $payment->config['stripe_pk_live']
|
2021-04-28 16:56:08 +08:00
|
|
|
]);
|
|
|
|
}
|
2020-05-19 16:49:33 +08:00
|
|
|
}
|