本文整理汇总了PHP中PagSeguroConfig::getEnvironment方法的典型用法代码示例。如果您正苦于以下问题:PHP PagSeguroConfig::getEnvironment方法的具体用法?PHP PagSeguroConfig::getEnvironment怎么用?PHP PagSeguroConfig::getEnvironment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PagSeguroConfig
的用法示例。
在下文中一共展示了PagSeguroConfig::getEnvironment方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: requestAction
/**
* Process the payment request and redirect to PagSeguro Gateway
*/
public function requestAction()
{
$Order = $this->getOrder();
//Order Data
$PagSeguroPaymentModel = $this->getPagSeguroPaymentModel();
$enabledOSC = false;
$fileOSC = scandir(getcwd() . '/app/code/community/DeivisonArthur');
if ($fileOSC) {
$enabledOSC = Mage::helper('onepagecheckout')->isOnepageCheckoutEnabled();
}
$feedback = $enabledOSC == false ? 'checkout/onepage' : 'onepagecheckout';
if ($Order->getState() == Mage_Sales_Model_Order::STATE_NEW and $Order->getPayment()->getMethod() == $PagSeguroPaymentModel->getCode() and $Order->getId()) {
$orderId = $Order->getEntityId();
include_once Mage::getBaseDir('lib') . '/PagSeguroLibrary/PagSeguroLibrary.php';
$environment = PagSeguroConfig::getEnvironment();
if ($environment == 'production') {
$environment = "Produção";
} else {
$environment = "Sandbox";
}
$tp = (string) Mage::getConfig()->getTablePrefix();
$table = $tp . 'pagseguro_orders';
$read = Mage::getSingleton('core/resource')->getConnection('core_read');
$value = $read->query("SELECT `order_id` FROM `" . $table . "` WHERE `order_id` = " . $orderId);
$row = $value->fetch();
if ($row == false) {
$connection = Mage::getSingleton('core/resource')->getConnection('core_write');
$sql = "INSERT INTO `" . $table . "` (`order_id`, `environment`) \n VALUES ('{$orderId}','{$environment}')";
$connection->query($sql);
}
try {
$PagSeguroPaymentModel->setOrder($Order);
$this->_redirectUrl($PagSeguroPaymentModel->getRedirectPaymentHtml($Order));
//after verify if the order was created, instantiates the sendEmail() method
$this->sendEmail();
} catch (Exception $ex) {
Mage::log($ex->getMessage());
Mage::getSingleton('core/session')->addError(self::MENSAGEM);
$this->_redirectUrl(Mage::getUrl('checkout/cart'));
if ($checkout == 'PADRAO') {
$this->_redirectUrl(Mage::getUrl() . $feedback);
}
$this->_canceledStatus($Order);
}
} else {
Mage::getSingleton('core/session/canceled')->addError(self::MENSAGEM);
$this->_redirectUrl(Mage::getUrl('checkout/cart'));
if ($checkout == 'PADRAO') {
$this->_redirectUrl(Mage::getUrl() . $feedback);
}
$this->_canceledStatus($Order);
}
}
示例2: requestAction
/**
* Process the payment request and redirect to PagSeguro Gateway
*/
public function requestAction()
{
$helper = Mage::helper('pagseguro');
$paymentMethod = $helper->paymentModel();
$feedback = 'checkout/onepage';
$order = Mage::getModel('sales/order')->load($this->getCheckout()->getLastOrderId());
$method = $order->getPayment()->getMethod();
$code = $paymentMethod->getCode();
if ($order->getState() == Mage_Sales_Model_Order::STATE_NEW && $method == $code && $order->getId()) {
$orderId = $order->getEntityId();
include_once Mage::getBaseDir('lib') . '/PagSeguroLibrary/PagSeguroLibrary.php';
$environment = PagSeguroConfig::getEnvironment();
if ($environment == 'production') {
$environment = $helper->__("Produção");
} else {
$environment = $helper->__("Sandbox ");
}
$tp = (string) Mage::getConfig()->getTablePrefix();
$table = $tp . 'pagseguro_orders';
$read = Mage::getSingleton('core/resource')->getConnection('core_read');
$value = $read->query("SELECT `order_id` FROM `" . $table . "` WHERE `order_id` = " . $orderId);
$row = $value->fetch();
if ($row == false) {
$connection = Mage::getSingleton('core/resource')->getConnection('core_write');
$sql = "INSERT INTO `" . $table . "` (`order_id`, `environment`) VALUES ('{$orderId}','{$environment}')";
$connection->query($sql);
}
try {
$paymentMethod->setOrder($order);
$this->_redirectUrl($paymentMethod->getRedirectPaymentHtml($order));
//after verify if the order was created, instantiates the sendEmail() method
$this->sendEmail();
} catch (Exception $ex) {
Mage::log($ex->getMessage());
Mage::getSingleton('core/session')->addError($helper->__(self::MENSAGEM));
$this->_redirectUrl(Mage::getUrl('checkout/cart'));
if ($checkout == 'PADRAO') {
$this->_redirectUrl(Mage::getUrl() . $feedback);
}
$this->canceledStatus($order);
}
} else {
Mage::getSingleton('core/session/canceled')->addError($helper->__(self::MENSAGEM));
$this->_redirectUrl(Mage::getUrl('checkout/cart'));
if ($checkout == 'PADRAO') {
$this->_redirectUrl(Mage::getUrl() . $feedback);
}
$this->canceledStatus($order);
}
}
示例3: __construct
public function __construct(Credentials $credentials, $serviceName)
{
$this->credentials = $credentials;
$this->serviceName = $serviceName;
$this->setEnvironment(PagSeguroConfig::getEnvironment());
$this->setWebserviceUrl(PagSeguroResources::getWebserviceUrl($this->getEnvironment()));
$this->setCharset(PagSeguroConfig::getApplicationCharset());
$this->resources = PagSeguroResources::getData($this->serviceName);
if (isset($this->resources['servicePath'])) {
$this->setServicePath($this->resources['servicePath']);
}
if (isset($this->resources['serviceTimeout'])) {
$this->setServiceTimeout($this->resources['serviceTimeout']);
}
}
示例4: initContent
public function initContent()
{
$this->display_column_left = false;
parent::initContent();
$payment = new PagSeguroPaymentOrderPrestashop();
$payment->setVariablesPaymentExecutionView();
$environment = PagSeguroConfig::getEnvironment();
$this->context = Context::getContext();
$this->context->smarty->assign('environment', $environment);
if (version_compare(_PS_VERSION_, '1.5.0.1', '>=')) {
$this->context->smarty->assign('width_center_column', '100%');
}
$url = "index.php?fc=module&module=pagseguro&controller=error";
$this->context->smarty->assign('errurl', $url);
$this->setTemplate('payment_execution.tpl');
}
示例5: __construct
public function __construct(PagSeguroCredentials $credentials, $serviceName)
{
$this->credentials = $credentials;
$this->serviceName = $serviceName;
try {
$this->setEnvironment(PagSeguroConfig::getEnvironment());
$this->setWebserviceUrl(PagSeguroResources::getWebserviceUrl($this->getEnvironment()));
$this->setPaymentUrl(PagSeguroResources::getPaymentUrl($this->getEnvironment()));
$this->setBaseUrl(PagSeguroResources::getBaseUrl($this->getEnvironment()));
$this->setInstallmentUrl(PagSeguroResources::getInstallmentUrl());
$this->setAuthorizationUrl(PagSeguroResources::getAuthorizationUrl());
$this->setSessionUrl(PagSeguroResources::getSessionUrl());
$this->setCharset(PagSeguroConfig::getApplicationCharset());
$this->resources = PagSeguroResources::getData($this->serviceName);
if (isset($this->resources['servicePath'])) {
$this->setServicePath($this->resources['servicePath']);
}
if (isset($this->resources['serviceTimeout'])) {
$this->setServiceTimeout($this->resources['serviceTimeout']);
}
} catch (Exception $e) {
throw $e;
}
}
示例6: __construct
public function __construct()
{
include_once Mage::getBaseDir('lib') . '/PagSeguroLibrary/PagSeguroLibrary.php';
$this->environment = PagSeguroConfig::getEnvironment();
}
示例7: dirname
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2014 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
include_once dirname(__FILE__) . '/../../../../config/config.inc.php';
include_once dirname(__FILE__) . '/../../../../init.php';
include_once dirname(__FILE__) . '/../../pagseguro.php';
include_once dirname(__FILE__) . '/../../backward_compatibility/backward.php';
include_once dirname(__FILE__) . '/../../features/payment/pagseguropaymentorderprestashop.php';
$useSSL = true;
$showView = new BWDisplay();
$context = Context::getContext();
if (!$context->cookie->isLogged(true)) {
Tools::redirect('authentication.php?back=order.php');
}
$payment = new PagSeguroPaymentOrderPrestashop();
$payment->setVariablesPaymentExecutionView();
$environment = PagSeguroConfig::getEnvironment();
$context->smarty->assign('environment', $environment);
$url = "modules/pagseguro/standard/front/error.php";
$context->smarty->assign('errurl', $url);
$showView->setTemplate(_PS_MODULE_DIR_ . 'pagseguro/views/templates/front/payment_execution.tpl');
$showView->run();