master
elf 1 year ago
parent 0594758a02
commit dafe9537bb

@ -42,7 +42,7 @@ class MineCommand extends HyperfCommand
public function handle(): void
{
$this->register('RLX1990');
$this->payment();
}
protected function generateToken() {
@ -135,7 +135,7 @@ class MineCommand extends HyperfCommand
* @var UserService $userService
*/
$userService = $this->container->make(UserService::class);
$userService->rsyncBankCards('4673f922e30cfd2efeeb992ff6a32ece');
$userService->rsyncBankCards('247eda1b7de0c76603123c477f2072fa');
}
protected function bindCard()
@ -155,13 +155,13 @@ class MineCommand extends HyperfCommand
*/
$paymentService = $this->container->make(PaymentService::class);
$data = [
'userId' => '24',
'agreementNo' => '322022110300000005068',
'userId' => 'RLX1990',
'agreementNo' => '312023080700002049466',
'notifyUrl' => 'http://www.baidu.com',
'returnUrl' => 'http://www.baidu.com',
'amount' => 10,
'outOrderNo' => time() . rand(1000, 9999),
'expiresIn' => 15*60,
'expiresIn' => 10*60,
'splitInfoList' => [
[
'userId' => 'ELF1990',

@ -40,7 +40,7 @@ class NotifyController extends AbstractController
$baofu = new Baofu();
if (!$baofu->notifyVerify($params, 'register')) {
Log::info('registerNotifyVerifyFail: ' . $params);
Log::info('registerNotifyVerifyFail: ', $params);
return $baofu->notifySuccess();
}

@ -75,8 +75,8 @@ class PayController extends AbstractController
public function payment(RequestInterface $request) {
[$app, $data, $token] = $this->parseReqest($request, UnbindCardRequest::class);
$data = $this->paymentService->payment($data, $app, $token);
return $this->success($data);
$url = $this->paymentService->payment($data, $app, $token);
return $this->success(['url' => $url]);
}
public function refundApply(RequestInterface $request)

@ -214,6 +214,7 @@ trait Common
$needSignParams = $notifyItem['signParams'];
$paramList = explode('|', $needSignParams);
$signString = Tool::getSignStr($needSignParams, $paramList, $data, 'response');
Log::info('Baofu SignString: ' . $signString);
return SignatureUtil::verifySign($signString, $this->getCerFilePath(), $data['signature'] ?: '');
}

@ -53,6 +53,7 @@ class SignatureUtil
$pubKey = file_get_contents($cerPath);
$certs = openssl_get_publickey($pubKey);
$ok = openssl_verify($data, hex2bin($signature), $certs);
var_dump($cerPath, $signature);
if ($ok == 1) {
return true;
}

@ -63,7 +63,7 @@ class PaymentService extends AbstractService
$url = $baofu->paymentSplit([
'loginNo' => $user->member_id,
'outOrderNo' => $order->order_no,
'amount' => $user->member_id,
'amount' => $order->amount,
'paidType' => 'CARD',
'agreementNo' => $order->agreement_no,
'pwdPayExpTime' => strtotime($order->expired_at),
@ -72,6 +72,7 @@ class PaymentService extends AbstractService
$order->status = 'APPLY_SUCCESS';
$order->applied_at = date('Y-m-d H:i:s');
$order->pay_url = $url;
$order->save();
return $url;
} catch (ApiException $e) {
$order->status = 'APPLY_FAILED';

Loading…
Cancel
Save