|
|
@@ -7,6 +7,7 @@ use App\Services\ConfigService;
|
|
|
use App\Models\Config;
|
|
|
use App\Models\Recharge;
|
|
|
use App\Services\Payment\SanJinService;
|
|
|
+use App\Services\PaymentOrderService;
|
|
|
use Illuminate\Validation\ValidationException;
|
|
|
|
|
|
use Exception;
|
|
|
@@ -21,22 +22,48 @@ class Wallet extends BaseController
|
|
|
public function getChannel()
|
|
|
{
|
|
|
$data = SanJinService::getChannel();
|
|
|
+ $product = SanJinService::$PRODUCT;
|
|
|
$list = [];
|
|
|
foreach($data as $k => $v) {
|
|
|
+ foreach($product as $pv) {
|
|
|
+ if ($k == $pv['type']) {
|
|
|
+ $config = $pv;
|
|
|
+ }
|
|
|
+ }
|
|
|
$list[] = [
|
|
|
- 'label' => lang($v),
|
|
|
- 'value' => $k,
|
|
|
- ];
|
|
|
+ 'label' => lang($v),
|
|
|
+ 'value' => $k,
|
|
|
+ 'config' => $config ?? [],
|
|
|
+ ];
|
|
|
}
|
|
|
return $this->success([
|
|
|
'list' => $list,
|
|
|
+ 'product' => $product,
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 创建代收订单
|
|
|
+ */
|
|
|
+ public function createPay()
|
|
|
+ {
|
|
|
+ try {
|
|
|
+ $params = request()->validate([
|
|
|
+ 'amount' => ['required', 'float'],
|
|
|
+ 'payment_type' => ['required', 'string'],
|
|
|
+ ]);
|
|
|
+ $member_id = request()->user->member_id;
|
|
|
+ $res = PaymentOrderService::createPay($member_id, $params['amount'], $params['payment_type']);
|
|
|
+ return $this->success($res);
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ return $this->error($e->getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取充值二维码(USDT充值)
|
|
|
*/
|
|
|
- function scan()
|
|
|
+ public function scan()
|
|
|
{
|
|
|
$member_id = request()->user->member_id;
|
|
|
$type = 'TRC20';
|