|
|
@ -61,25 +61,24 @@ class WithdrawCommand extends HyperfCommand
|
|
|
|
|
|
|
|
|
|
|
|
$balance = $userService->getBalance($user->member_id);
|
|
|
|
$balance = $userService->getBalance($user->member_id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo 'before balance' . $balance . PHP_EOL;
|
|
|
|
|
|
|
|
|
|
|
|
$bankCard = BankCard::where('user_id', $user->user_id)->first();
|
|
|
|
$bankCard = BankCard::where('user_id', $user->user_id)->first();
|
|
|
|
|
|
|
|
|
|
|
|
var_dump([
|
|
|
|
|
|
|
|
'userId' => $user->user_id,
|
|
|
|
|
|
|
|
'withdrawType' => 'entrust',
|
|
|
|
|
|
|
|
'agreementNo' => $bankCard->agreement_no,
|
|
|
|
|
|
|
|
'outWithdrawNo' => StringHelper::generateOrderNo(StringHelper::ORDER_NO_TYPE_WITHDRAW_NO),
|
|
|
|
|
|
|
|
'amount' => $balance
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
$requestLog = $this->createRequestLog([
|
|
|
|
$requestLog = $this->createRequestLog([
|
|
|
|
'userId' => $user->user_id,
|
|
|
|
'userId' => $user->user_id,
|
|
|
|
'withdrawType' => 'entrust',
|
|
|
|
'withdrawType' => 'entrust',
|
|
|
|
'agreementNo' => $order->out_order_no,
|
|
|
|
'agreementNo' => $bankCard->agreement_no,
|
|
|
|
'outWithdrawNo' => $order->amount,
|
|
|
|
'outWithdrawNo' => StringHelper::generateOrderNo(StringHelper::ORDER_NO_TYPE_ACCOUNT_WITHDRAW),
|
|
|
|
'amount' => $balance
|
|
|
|
'amount' => $balance
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
$url = $paymentService->withdraw($requestLog->getData(), $requestLog->app, $requestLog->request_token);
|
|
|
|
$url = $paymentService->withdraw($requestLog->getData(), $requestLog->app, $requestLog->request_token);
|
|
|
|
echo $url;
|
|
|
|
|
|
|
|
|
|
|
|
echo 'result' . $url . PHP_EOL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$balance = $userService->getBalance($user->member_id);
|
|
|
|
|
|
|
|
echo 'after balance' . $balance . PHP_EOL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private function createRequestLog($data) {
|
|
|
|
private function createRequestLog($data) {
|
|
|
|