|
|
|
@ -58,28 +58,27 @@ class WithdrawCommand extends HyperfCommand
|
|
|
|
|
$userService = $this->container->make(UserService::class);
|
|
|
|
|
|
|
|
|
|
$user = User::where('user_id', 'ACT_5')->first();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$balance = $userService->getBalance($user->member_id);
|
|
|
|
|
|
|
|
|
|
echo 'before balance' . $balance . PHP_EOL;
|
|
|
|
|
|
|
|
|
|
$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([
|
|
|
|
|
'userId' => $user->user_id,
|
|
|
|
|
'withdrawType' => 'entrust',
|
|
|
|
|
'agreementNo' => $order->out_order_no,
|
|
|
|
|
'outWithdrawNo' => $order->amount,
|
|
|
|
|
'agreementNo' => $bankCard->agreement_no,
|
|
|
|
|
'outWithdrawNo' => StringHelper::generateOrderNo(StringHelper::ORDER_NO_TYPE_ACCOUNT_WITHDRAW),
|
|
|
|
|
'amount' => $balance
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$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) {
|
|
|
|
|