thirdpayment
ljl 11 months ago
parent bc52aa15bd
commit 723ff9977c

@ -58,28 +58,27 @@ class WithdrawCommand extends HyperfCommand
$userService = $this->container->make(UserService::class); $userService = $this->container->make(UserService::class);
$user = User::where('user_id', 'ACT_5')->first(); $user = User::where('user_id', 'ACT_5')->first();
$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) {

@ -16,6 +16,7 @@ class StringHelper
const ORDER_NO_TYPE_WITHDRAW_APPLY_BATCH_NUM = 'withdraw_apply_batch_num'; const ORDER_NO_TYPE_WITHDRAW_APPLY_BATCH_NUM = 'withdraw_apply_batch_num';
const ORDER_NO_TYPE_WITHDRAW_APPLY_NO = 'withdraw_apply_no'; const ORDER_NO_TYPE_WITHDRAW_APPLY_NO = 'withdraw_apply_no';
const ORDER_NO_TYPE_WITHDRAW_NO = 'withdraw_no'; const ORDER_NO_TYPE_WITHDRAW_NO = 'withdraw_no';
const ORDER_NO_TYPE_ACCOUNT_WITHDRAW = 'account_withdraw';
const ORDER_NO_TYPE_ACCOUNT_PAY = 'account_pay'; const ORDER_NO_TYPE_ACCOUNT_PAY = 'account_pay';
public static function getRandomString($length, $withSpecialChar = false) public static function getRandomString($length, $withSpecialChar = false)

Loading…
Cancel
Save