src/Topxia/MobileBundleV2/Processor/Impl/OrderProcessorImpl.php

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php

namespace Topxia\MobileBundleV2\Processor\Impl;

use ApiBundle\Api\ApiRequest;
use ApiBundle\Api\ResourceKernel;
use AppBundle\Common\ArrayToolkit;
use Biz\OrderFacade\Exception\OrderPayCheckException;
use Codeages\Biz\Pay\Service\PayService;
use Topxia\MobileBundleV2\Processor\BaseProcessor;
use Biz\Order\OrderProcessor\OrderProcessorFactory;
use Topxia\MobileBundleV2\Processor\OrderProcessor;
use Topxia\MobileBundleV2\Alipay\MobileAlipayConfig;

class OrderProcessorImpl extends BaseProcessor implements OrderProcessor
{
    public function getPaymentMode()
    {
        $coinSetting = $this->controller->setting('coin');

        $coinEnabled = true;
        if (empty($coinSetting)) {
            $coinEnabled = false;
        }

        $coinEnabled = isset($coinSetting['coin_enabled']) && $coinSetting['coin_enabled'];

        $payment = $this->controller->setting('payment', array());

        $apipayEnabled = true;
        if (empty($payment['enabled'])) {
            $apipayEnabled = false;
        }

        if (empty($payment['alipay_enabled'])) {
            $apipayEnabled = false;
        }

        if (empty($payment['alipay_key']) || empty($payment['alipay_secret']) || empty($payment['alipay_account'])) {
            $apipayEnabled = false;
        }

        //0 can buy
        $magicSetting = $this->getSettingService()->get('magic', array());
        $iosBuyDisable = isset($magicSetting['ios_buy_disable']) ? $magicSetting['ios_buy_disable'] : 0;

        return array(
            'coin' => $coinEnabled,
            'alipay' => $apipayEnabled,
            'ios_buy_disable' => $iosBuyDisable == 0,
        );
    }

    public function validateIAPReceipt()
    {
        $user = $this->controller->getUserByToken($this->request);

        if (!$user->isLogin()) {
            return $this->createErrorResponse('not_login', '您尚未登录');
        }

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。