事情起因

其实也是当初没注意到,知道最近有人提醒才发现原来有这个问题,实在是太失败了,紧急修复了一下,至于是什么BUG呢为了安全起见这里就不多说了,只能说不想被刷余额就赶紧修复一下,还有如果CSS显示不了的话可以试试看这个。

更改代码

如果不想整个插件重新装一次的话可以直接进F2FPay.php更改掉PayReturn功能:

    public function onPayReturn(PayReturnEvent $event){
        $this->Core();
        $alipay_config = $event->getGateway()->getConfigOption();
        $alipay_config['charset'] = 'utf-8';
        $alipay_config['gatewayUrl'] = 'https://openapi.alipay.com/gateway.do';
        $orderid = $event->getGetParams()['orderid'];
        $aop = new AopClient ();
        $aop->gatewayUrl = 'https://openapi.alipay.com/gateway.do';
        $aop->appId = $alipay_config['app_id'];
        $aop->rsaPrivateKey = $alipay_config['merchant_private_key'];
        $aop->alipayrsaPublicKey=$alipay_config['alipay_public_key'];
        $aop->apiVersion = '1.0';
        $aop->signType = $alipay_config['sign_type'];
        $aop->postCharset='utf-8';
        $aop->format='json';
        $request = new AlipayTradeQueryRequest ();
        $request->setBizContent("{" .
        "\"out_trade_no\":\"{$orderid}\"" .
        "  }");
        $result = $aop->execute ($request); 
        
        $responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response";
        $resultCode = $result->$responseNode->code;
        if(!empty($resultCode)&&$resultCode == 10000){
            if($result->$responseNode->trade_status == 'TRADE_SUCCESS' || $result->$responseNode->trade_status == 'TRADE_FINISHED'){
                return array(
                    'status' => 'success',
                    'Orderid' => $event->getGetParams()['orderid']
                );
            } else {
                return array(
                    'status' => 'fail',
                    'Orderid' => $event->getGetParams()['orderid']
                );
            }
        } else {
            return array(
                'status' => 'fail',
                'Orderid' => $event->getGetParams()['orderid']
            );
        }
    }

插件截图

f3RYGD.png