当前位置: 首页>>代码示例>>PHP>>正文


PHP PagSeguroConfig::getEnvironment方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:RobertaFortes,项目名称:assisteste,代码行数:56,代码来源:PaymentController.php

示例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);
     }
 }
开发者ID:cabrerabywaters,项目名称:magentoSunshine,代码行数:53,代码来源:PaymentController.php

示例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']);
     }
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:15,代码来源:PagSeguroConnectionData.class.php

示例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');
 }
开发者ID:kennedimalheiros,项目名称:prestashop,代码行数:16,代码来源:payment.php

示例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;
     }
 }
开发者ID:esilvajr,项目名称:magento,代码行数:24,代码来源:PagSeguroConnectionData.class.php

示例6: __construct

 public function __construct()
 {
     include_once Mage::getBaseDir('lib') . '/PagSeguroLibrary/PagSeguroLibrary.php';
     $this->environment = PagSeguroConfig::getEnvironment();
 }
开发者ID:RobertaFortes,项目名称:assisteste,代码行数:5,代码来源:Conciliation.php

示例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();
开发者ID:kennedimalheiros,项目名称:prestashop,代码行数:31,代码来源:payment.php


注:本文中的PagSeguroConfig::getEnvironment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。