Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
zqhong committed Apr 11, 2018
1 parent 899d98b commit 80c9a7d
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 117 deletions.
102 changes: 102 additions & 0 deletions src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,106 @@ public function downloadStatement(array $parameters = [])
{
return $this->createRequest(DownloadStatementRequest::class, $parameters);
}

/**
* @return mixed
*/
public function getCertFilePath()
{
return $this->getParameter('cert_file_path');
}

/**
* @param mixed $certFilePath
* @return Gateway
*/
public function setCertFilePath($certFilePath)
{
return $this->setParameter('cert_file_path', $certFilePath);
}

/**
* @return mixed
*/
public function getMchId()
{
return $this->getParameter('mch_id');
}

/**
* @param string $mchId
* @return Gateway
*/
public function setMchId($mchId)
{
return $this->setParameter('mch_id', $mchId);
}

/**
* @return string
*/
public function getMchKey()
{
return $this->getParameter('mch_key');
}

/**
* @param string $mchKey
* @return Gateway
*/
public function setMchKey($mchKey)
{
return $this->setParameter('mch_key', $mchKey);
}

/**
* @return string
*/
public function getKeyFilePath()
{
return $this->getParameter('key_file_path');
}

/**
* @param string $keyFilePath
* @return Gateway
*/
public function setKeyFilePath($keyFilePath)
{
return $this->setParameter('key_file_path', $keyFilePath);
}

/**
* @return string
*/
public function getNotifyUrl()
{
return $this->getParameter('notify_url');
}

/**
* @param string $notifyUrl
* @return Gateway
*/
public function setNotifyUrl($notifyUrl)
{
return $this->setParameter('notify_url', $notifyUrl);
}

/**
* @return string
*/
public function getOpUserPasswd()
{
return $this->getParameter('op_user_passwd');
}

/**
* @param string $opUserPassword
* @return Gateway
*/
public function setOpUserPasswd($opUserPassword)
{
return $this->setParameter('op_user_passwd', $opUserPassword);
}
}
123 changes: 6 additions & 117 deletions src/Message/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@

abstract class AbstractRequest extends AbstractCommomRequest
{
protected $mchId;

protected $mchKey;

protected $certFilePath;

protected $keyFilePath;

protected $notifyUrl;

protected $opUserPassword;

/**
* @return string
*/
Expand All @@ -39,115 +27,16 @@ public function getData()
public function sendData($data)
{
$api = new QpayMchAPI($this->getEndpoint(), true, 5, [
'MCH_ID' => $this->getMchId(),
'MCH_ID' => $this->getParameter('mch_id'),
'SUB_MCH_ID' => '',
'MCH_KEY' => $this->getMchKey(),
'OP_USER_PASSWD' => $this->getOpUserPassword(),
'CERT_FILE_PATH' => $this->getCertFilePath(),
'KEY_FILE_PATH' => $this->getKeyFilePath(),
'NOTIFY_URL' => $this->getNotifyUrl(),
'MCH_KEY' => $this->getParameter('mch_key'),
'OP_USER_PASSWD' => $this->getParameter('op_user_passwd'),
'CERT_FILE_PATH' => $this->getParameter('cert_file_path'),
'KEY_FILE_PATH' => $this->getParameter('key_file_path'),
'NOTIFY_URL' => $this->getParameter('notify_url'),
]);

$result = $api->reqQpay($data);
return new Response($this, $result);
}


/**
* @return mixed
*/
public function getCertFilePath()
{
return $this->certFilePath;
}

/**
* @param mixed $certFilePath
*/
public function setCertFilePath($certFilePath)
{
$this->certFilePath = $certFilePath;
}

/**
* @return mixed
*/
public function getMchId()
{
return $this->mchId;
}

/**
* @param mixed $mchId
*/
public function setMchId($mchId)
{
$this->mchId = $mchId;
}

/**
* @return mixed
*/
public function getMchKey()
{
return $this->mchKey;
}

/**
* @param mixed $mchKey
*/
public function setMchKey($mchKey)
{
$this->mchKey = $mchKey;
}

/**
* @return mixed
*/
public function getKeyFilePath()
{
return $this->keyFilePath;
}

/**
* @param mixed $keyFilePath
*/
public function setKeyFilePath($keyFilePath)
{
$this->keyFilePath = $keyFilePath;
}

/**
* @return mixed
*/
public function getNotifyUrl()
{
return $this->notifyUrl;
}

/**
* @param mixed $notifyUrl
*/
public function setNotifyUrl($notifyUrl)
{
$this->notifyUrl = $notifyUrl;
}

/**
* @return mixed
*/
public function getOpUserPassword()
{
return $this->opUserPassword;
}

/**
* @param mixed $opUserPassword
*/
public function setOpUserPassword($opUserPassword)
{
$this->opUserPassword = $opUserPassword;
}


}

0 comments on commit 80c9a7d

Please sign in to comment.