/**
  * Get the raw data array for this message. The format of this varies from gateway to
  * gateway, but will usually be either an associative array, or a SimpleXMLElement.
  *
  * @return mixed
  */
 public function getData()
 {
     $this->validateData();
     $data = array('version' => $this->getVersion(), 'encoding' => $this->getEncoding(), 'certId' => $this->getCertId(), 'txnType' => '01', 'txnSubType' => '01', 'bizType' => $this->getBizType(), 'frontUrl' => $this->getReturnUrl(), 'backUrl' => $this->getNotifyUrl(), 'signMethod' => $this->getSignMethod(), 'channelType' => $this->getChannelType(), 'accessType' => $this->getAccessType(), 'merId' => $this->getMerId(), 'orderId' => $this->getOrderId(), 'txnTime' => $this->getTxnTime(), 'txnAmt' => $this->getTxnAmt(), 'currencyCode' => $this->getCurrencyCode(), 'defaultPayType' => $this->getDefaultPayType(), 'orderDesc' => $this->getOrderDesc(), 'reqReserved' => $this->getReqReserved());
     $data = Helper::filterData($data);
     $data['signature'] = Helper::getParamsSignatureWithRSA($data, $this->getCertPath(), $this->getCertPassword());
     return $data;
 }
 /**
  * Get the raw data array for this message. The format of this varies from gateway to
  * gateway, but will usually be either an associative array, or a SimpleXMLElement.
  *
  * @return mixed
  */
 public function getData()
 {
     $this->validate('certPath', 'certPassword', 'orderId', 'txnTime', 'txnAmt');
     $data = array('version' => $this->getVersion(), 'encoding' => $this->getEncoding(), 'certId' => $this->getCertId(), 'signMethod' => $this->getSignMethod(), 'txnType' => '00', 'txnSubType' => '00', 'bizType' => $this->getBizType(), 'accessType' => $this->getAccessType(), 'channelType' => $this->getChannelType(), 'orderId' => $this->getOrderId(), 'merId' => $this->getMerId(), 'txnTime' => $this->getTxnTime());
     $data = Helper::filterData($data);
     $data['signature'] = Helper::getParamsSignatureWithRSA($data, $this->getCertPath(), $this->getCertPassword());
     return $data;
 }
 /**
  * Get the raw data array for this message. The format of this varies from gateway to
  * gateway, but will usually be either an associative array, or a SimpleXMLElement.
  *
  * @return mixed
  */
 public function getData()
 {
     $this->validateData();
     $data = array('version' => $this->getVersion(), 'charset' => $this->getEncoding(), 'merId' => $this->getMerId(), 'merAbbr' => $this->getMerAbbr(), 'transType' => $this->getTransType(), 'orderAmount' => $this->getOrderAmount(), 'orderNumber' => $this->getOrderNumber(), 'orderTime' => $this->getOrderTime(), 'orderCurrency' => $this->getOrderCurrency(), 'customerIp' => $this->getCustomerIp(), 'frontEndUrl' => $this->getReturnUrl(), 'backEndUrl' => $this->getNotifyUrl(), 'commodityUrl' => $this->getShowUrl(), 'commodityName' => $this->getTitle(), 'origQid' => '', 'acqCode' => '', 'merCode' => '', 'commodityUnitPrice' => '', 'commodityQuantity' => '', 'commodityDiscount' => '', 'transferFee' => '', 'customerName' => '', 'defaultPayType' => '', 'defaultBankNumber' => '', 'transTimeout' => '', 'merReserved' => '');
     $data = Helper::filterData($data);
     $data['signature'] = Helper::getParamsSignatureWithMD5($data, $this->getSecretKey());
     $data['signMethod'] = 'md5';
     return $data;
 }
 /**
  * Send the request with specified data
  *
  * @param  mixed $data The data to send
  *
  * @return ResponseInterface
  */
 public function sendData($data)
 {
     $endpoint = $this->getEndpoint('trade');
     $result = Helper::sendHttpRequest($endpoint, $data);
     parse_str($result, $data);
     if (!is_array($data)) {
         $data = array();
     }
     return $this->response = new LegacyMobilePurchaseResponse($this, $data);
 }
 public function getTradeNo()
 {
     $endpoint = $this->getRequest()->getEndpoint('app');
     $result = Helper::sendHttpRequest($endpoint, $this->data);
     parse_str($result, $data);
     if (is_array($data) && isset($data['tn'])) {
         return $data['tn'];
     } else {
         return null;
     }
 }
 protected function isSignMatch()
 {
     $requestSign = $this->getRequestParam('signature');
     $query = Helper::getStringToSign($this->getParamsToSign());
     return $requestSign === md5($query . '&' . md5($this->getSecretKey()));
 }
 /**
  * Send the request with specified data
  *
  * @param  mixed $data The data to send
  *
  * @return ResponseInterface
  */
 public function sendData($data)
 {
     $data['verify_success'] = Helper::verify($this->getRequestParams(), $this->getCertDir());
     $data['is_paid'] = $data['verify_success'] && $this->getRequestParam('respCode') == '00';
     return $this->response = new ExpressCompletePurchaseResponse($this, $data);
 }
 protected function getCertId()
 {
     return Helper::getCertId($this->getCertPath(), $this->getCertPassword());
 }