ljl 1 year ago
parent 2558522c77
commit 7c6993473d

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

@ -210,12 +210,7 @@ class Baofu
$data['callType'] = $params['callType']; $data['callType'] = $params['callType'];
$res = base64_decode($this->api('payment', $data)); $res = base64_decode($this->api('payment', $data));
if(self::PEYMENT_PAID_TYPE[$params['paidType']]){ return json_decode($res, true);
$res = json_decode($res, true);
if($res['body']){
return $res['body'];
}
}
} }
public function recharge($params, $token) public function recharge($params, $token)

@ -102,7 +102,7 @@ class PaymentService extends AbstractService
$order->applied_at = date('Y-m-d H:i:s'); $order->applied_at = date('Y-m-d H:i:s');
$order->pay_url = $url; $order->pay_url = $url;
$order->save(); $order->save();
return $url; return ['url' => $url];
} catch (ApiException $e) { } catch (ApiException $e) {
$order->status = 'APPLY_FAILED'; $order->status = 'APPLY_FAILED';
$order->applied_at = date('Y-m-d H:i:s'); $order->applied_at = date('Y-m-d H:i:s');
@ -167,9 +167,9 @@ class PaymentService extends AbstractService
], $token); ], $token);
$order->status = 'APPLY_SUCCESS'; $order->status = 'APPLY_SUCCESS';
$order->applied_at = date('Y-m-d H:i:s'); $order->applied_at = date('Y-m-d H:i:s');
$order->acs_no = $result['acsNo']; $order->acs_no = $result['body'] ?? '';
$order->save(); $order->save();
return $result['acsNo']; return $result;
} catch (ApiException $e) { } catch (ApiException $e) {
$order->status = 'APPLY_FAILED'; $order->status = 'APPLY_FAILED';
$order->applied_at = date('Y-m-d H:i:s'); $order->applied_at = date('Y-m-d H:i:s');

Loading…
Cancel
Save