查询订单支付状态
@param string $paymentId
@return boolean
429910
public function queryOrder($paymentId)
    {
        $params = [
            'appid' => $this->appId,
            'mch_id' => $this->mchId,
            'out_trade_no' => $paymentId,
            'nonce_str' => bin2hex(openssl_random_pseudo_bytes(8)),
        ];
        $params['sign'] = $this->createSign($params);
        $response = $this->api('https://api.mch.weixin.qq.com/pay/orderquery', 'POST', $params);
        if ($response->data['trade_state'] == 'SUCCESS') {
            Payment::setPayStatus($paymentId, true, ['pay_id' => $response->data['transaction_id'], 'message' => $response->data['return_msg']]);
            return true;
        }
        return false;
    }
428593
public function createPaymentByTransactionIdQuery($transactionId)
    {
        $query = $this->getFactory()->createPaymentPayoneQuery();
        $query->filterByTransactionId($transactionId);

        return $query;
    }
2540
public function load($paymentId)
    {
        $this->setPaymentId($paymentId);

        $comments = array();
        $commentsData = $this->getDbGateway()->getList($this->getPaymentId());
        if (is_array($commentsData) && count($commentsData)) {
            $comments = array();
            foreach ($commentsData as $data) {
                $comment = oxNew(\OxidEsales\PayPalModule\Model\OrderPaymentComment::class);
                $comment->setData($data);
                $comments[] = $comment;
            }
        }

        $this->setArray($comments);
    }
344782
static public function isPaymentMode($paymentMode) {
    return ((string) $paymentMode == Connect2PayClient::PAYMENT_MODE_SINGLE ||
        (string) $paymentMode == Connect2PayClient::PAYMENT_MODE_ONSHIPPING ||
        (string) $paymentMode == Connect2PayClient::PAYMENT_MODE_RECURRENT ||
        (string) $paymentMode == Connect2PayClient::PAYMENT_MODE_INSTALMENTS);
  }
554081
public function reverseAccrual($paymentId)
    {
        $class = $this->resourceMetadata->resourceClass;
        /**
         * @var $object Transaction
         */
        $object = new $class();
        $object->id = $paymentId;
        $object->accrual = false;
        $res = $this->updateWithAction($paymentId, 'accrual', null, $object, $class);

        if ($res) {
            return true;
        }

        return false;
    }
938163
public function validateSmsCode($paymentID, $smsCode)
    {
        $obj = new StdClass();

        // Must be in specific order for checksum ---------        
        $obj->MerchantID = $this->getMerchantID();
        $obj->Timestamp = $this->getTimeStamp();
        $obj->PaymentID = $paymentID;
        $obj->SmsCode = $smsCode;

        $obj->Checksum = $this->generateChecksum($obj, $this->getSecretCode());

        $result = $this->client->ValidateSmsCode(array('request' => $obj));
        $result = $result->ValidateSmsCodeResult;

        /* store the checksum momentarily */
        $checksum = $result->Checksum;

        /* Replace the checksum in the data with secretCode to generate a new checksum */
        $result->Checksum = $this->getSecretCode();

        /* Verify response data */
        if ($checksum != $this->generateChecksum($result))
            throw new Exception("Data could not be verified");

        return $result->Success;
    }
89928
protected function setTransactionId(Payment $payment, $transactionId) {
        $payment->setTransactionId($transactionId);
        $payment->setLastTransId($transactionId);
        $payment->setCcTransId($transactionId);
    }
167968
public function getOrder($orderId)
    {
        $result = $this->httpRaw(self::WECHAT_SHOP_ORDER_GET_URL . 'access_token=' . $this->getAccessToken(), [
            'order_id' => $orderId
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'success' ? $result['order'] : false;
    }
612958
function in_special_checkout() {
    if ((defined('MODULE_PAYMENT_PAYPALDP_STATUS') && MODULE_PAYMENT_PAYPALDP_STATUS == 'True') &&
             !empty($_SESSION['paypal_ec_token']) &&
             !empty($_SESSION['paypal_ec_payer_id']) &&
             !empty($_SESSION['paypal_ec_payer_info'])) {
      return true;
    }
  }
1081179
static public function isPaymentNetwork($paymentNetwork) {
    return ((string) $paymentNetwork == Connect2PayClient::PAYMENT_NETWORK_SOFORT ||
        (string) $paymentNetwork == Connect2PayClient::PAYMENT_NETWORK_PRZELEWY24 ||
        (string) $paymentNetwork == Connect2PayClient::PAYMENT_NETWORK_IDEAL ||
        (string) $paymentNetwork == Connect2PayClient::PAYMENT_NETWORK_GIROPAY ||
        (string) $paymentNetwork == Connect2PayClient::PAYMENT_NETWORK_EPS ||
        (string) $paymentNetwork == Connect2PayClient::PAYMENT_NETWORK_POLI ||
        (string) $paymentNetwork == Connect2PayClient::PAYMENT_NETWORK_DRAGONPAY ||
        (string) $paymentNetwork == Connect2PayClient::PAYMENT_NETWORK_TRUSTLY);
  }
361697
public function closeOrder($orderId)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_ORDER_CLOSE_PREFIX, [
            'order_id' => $orderId,
        ], [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'success';
    }
186093
public function getPaymentInformation($paymentType = null)
    {
        $paymentInformation = $this->_getField(self::$PAYMENT_INFORMATION);
        if (is_array($paymentInformation)) {
            if (!is_null($paymentType)) {
                $paymentType = strtoupper($paymentType);
                foreach ($paymentInformation as $singlePaymentInformation) {
                    if ($singlePaymentInformation['paymentType'] == $paymentType) {
                        return $singlePaymentInformation;
                    }
                }

                return Array();
            } else {
                return $paymentInformation;
            }
        } else {
            return Array();
        }
    }
227234
public static function setPayStatus($paymentId, $status, $params)
    {
        if (($payment = static::findOne(['id' => $paymentId])) == null) {
            return false;
        }
        if (static::STATE_SUCCESS == $payment->trade_state) {
            return true;
        }
        if ($status == true) {
            $payment->updateAttributes([
                'pay_id' => $params['pay_id'],
                'trade_state' => static::STATE_SUCCESS,
                'note' => $params['message']
            ]);//标记支付已经完成
            /** @var \yuncms\payment\OrderInterface $orderModel */
            $orderModel = $payment->model;
            if (!empty($payment->model_id) && !empty($orderModel)) {
                $orderModel::setPayStatus($payment->model_id, $paymentId, $status, $params);
            }
            return true;
        }
        return false;
    }
966757
public function void($transactionId)
    {
        $xml = new DOMDocument();
        $transaction = $xml->createElement('hps:Transaction');
        $void = $xml->createElement('hps:AltPaymentVoid');

        $void->appendChild($xml->createElement('hps:TransactionType', $this->_transactionType));
        $void->appendChild($xml->createElement('hps:GatewayTxnId', $transactionId));

        $transaction->appendChild($void);
        return $this->_submitTransaction($transaction, 'AltPaymentVoid');
    }
531690
public function getCard($cardId)
    {
        $result = $this->wechat->httpPost(self::WECHAT_CARD_LIST_GET_PREFIX, [
            'card_id' => $cardId
        ], [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] === 'ok' ? $result : false;
    }
1212665
public static function setPayStatus($orderId, $paymentId, $status, $params)
    {
        if (($model = static::findOne(['id' => $orderId])) != null && $status == true) {
            $coin = static::getCoin($model->money, $model->currency);
            coin($model->user_id, 'purchase', $coin);
            return true;
        }
        return false;
    }
51985
public static function getById($paymentId, $apiContext = null)
    {
        if (isset($apiContext)) {
            return Payment::get($paymentId, $apiContext);
        }
        return Payment::get($paymentId);
    }