本文整理汇总了PHP中Am_Paysystem_Abstract::createHttpRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP Am_Paysystem_Abstract::createHttpRequest方法的具体用法?PHP Am_Paysystem_Abstract::createHttpRequest怎么用?PHP Am_Paysystem_Abstract::createHttpRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Am_Paysystem_Abstract
的用法示例。
在下文中一共展示了Am_Paysystem_Abstract::createHttpRequest方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(Am_Paysystem_Abstract $plugin)
{
$this->plugin = $plugin;
$cert_file = APPLICATION_PATH . '/configs/cert_key_pem.txt';
if (is_file($cert_file) && is_readable($cert_file)) {
$this->use_cert = true;
}
if (!$this->use_cert) {
$url = $this->plugin->getConfig('testing') ? self::SANDBOX_URL : self::LIVE_URL;
} else {
$url = $this->plugin->getConfig('testing') ? self::CERT_SANDBOX_URL : self::CERT_LIVE_URL;
}
parent::__construct($url, self::METHOD_POST);
if ($adapter = $this->plugin->createHttpRequest()->getConfig('adapter')) {
$this->setConfig('adapter', $adapter);
}
// Check certificate file.
if ($this->use_cert) {
$this->setConfig('ssl_local_cert', $cert_file);
}
// Check certificate file.
$ca_file = APPLICATION_PATH . "/configs/api_cert_chain.crt";
if ($this->use_cert && is_file($ca_file) && is_readable($ca_file)) {
$this->setConfig('ssl_cafile', $cert_file);
}
if (!$this->use_cert) {
$this->addPostParameter('SIGNATURE', $this->plugin->getConfig('api_signature'));
}
$this->addPostParameter('VERSION', '63.0')->addPostParameter('BUTTONSOURCE', 'CgiCentral.aMemberPro')->addPostParameter('USER', $this->plugin->getConfig('api_username'))->addPostParameter('PWD', $this->plugin->getConfig('api_password'));
}
示例2: __construct
public function __construct(Am_Paysystem_Abstract $plugin)
{
$this->plugin = $plugin;
parent::__construct($this->plugin->getConfig('testing') ? self::SANDBOX_URL : self::LIVE_URL, self::METHOD_POST);
if ($adapter = $this->plugin->createHttpRequest()->getConfig('adapter')) {
$this->setConfig('adapter', $adapter);
}
$this->addPostParameter('VERSION', '63.0')->addPostParameter('SIGNATURE', $this->plugin->getConfig('api_signature'))->addPostParameter('USER', $this->plugin->getConfig('api_username'))->addPostParameter('PWD', $this->plugin->getConfig('api_password'));
}