去除paypal构造函数访问远程, 提升route:list 性能
This commit is contained in:
parent
02855c5fb3
commit
db6614e7a3
|
|
@ -27,11 +27,7 @@ class PaypalController
|
|||
{
|
||||
private PayPal $paypalClient;
|
||||
|
||||
/**
|
||||
* PaypalController constructor.
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function __construct()
|
||||
private function initPaypal()
|
||||
{
|
||||
$paypalSetting = plugin_setting('paypal');
|
||||
$config = [
|
||||
|
|
@ -65,6 +61,7 @@ class PaypalController
|
|||
*/
|
||||
public function create(Request $request): JsonResponse
|
||||
{
|
||||
$this->initPaypal();
|
||||
$data = \json_decode($request->getContent(), true);
|
||||
$orderNumber = $data['orderNumber'];
|
||||
$customer = current_customer();
|
||||
|
|
@ -96,6 +93,7 @@ class PaypalController
|
|||
*/
|
||||
public function capture(Request $request): JsonResponse
|
||||
{
|
||||
$this->initPaypal();
|
||||
$data = \json_decode($request->getContent(), true);
|
||||
$orderNumber = $data['orderNumber'];
|
||||
$customer = current_customer();
|
||||
|
|
|
|||
Loading…
Reference in New Issue