final public static setModuleVersion ( $version ) |
/** * Set Config's to PagSeguro API */ private function setPagSeguroConfig() { $activeLog = $this->getConfigData('log'); $charset = $this->getConfigData('charset'); //Module version PagSeguroLibrary::setModuleVersion('magento' . ':' . Mage::helper('pagseguro')->getVersion()); //CMS version PagSeguroLibrary::setCMSVersion('magento' . ':' . Mage::getVersion()); //Setup Charset if ($charset != null and !empty($charset)) { PagSeguroConfig::setApplicationCharset($charset); } //Setup Log if ($activeLog == 1) { $logFile = $this->getConfigData('log_file'); if (self::checkFile(Mage::getBaseDir() . '/' . $logFile)) { PagSeguroConfig::activeLog(Mage::getBaseDir() . '/' . $logFile); } else { PagSeguroConfig::activeLog(); //Default Log } } }
/** * Retrieve PagSeguro osCommerce module version */ private function _retrievePagSeguroModuleVersion() { PagSeguroLibrary::setModuleVersion('opencart' . ':' . $this->api_version); }
/** * Use PagSeguroLibrary * * @param type $order_id * @return type */ public function payment($order) { global $woocommerce; // Instantiate a new payment request $paymentRequest = new PagSeguroPaymentRequest(); // Set cms version PagSeguroLibrary::setCMSVersion('woocommerce-v.' . $woocommerce->version); // Set plugin version PagSeguroLibrary::setModuleVersion('woocommerce-v.' . $this->plugin_version); // Set charset PagSeguroConfig::setApplicationCharset($this->charset); // Sets the currency $paymentRequest->setCurrency(PagSeguroCurrencies::getIsoCodeByName("REAL")); // Set a reference $paymentRequest->setReference($this->invoice_prefix . $order->id); //Sets shipping data $paymentRequest->setShippingAddress($order->billing_postcode, $order->billing_address_1, '', $order->billing_address_2, '', $order->billing_city, $order->billing_state, $order->billing_country); $paymentRequest->setShippingCost($order->order_shipping); $paymentRequest->setShippingType(PagSeguroShippingType::getCodeByType('NOT_SPECIFIED')); // Sets your customer information. $paymentRequest->setSender($order->billing_first_name . ' ' . $order->billing_last_name, $order->billing_email, substr($order->billing_phone, 0, 2), substr($order->billing_phone, 2)); // Sets the url used by PagSeguro for redirect user after ends checkout process if (!empty($this->url_redirect)) { $paymentRequest->setRedirectUrl($this->url_redirect); } else { $paymentRequest->setRedirectUrl($this->get_return_url($order)); } // Sets the url used by PagSeguro for redirect user after ends checkout process if (!empty($this->url_notification)) { $paymentRequest->setNotificationURL($this->url_notification); } else { $paymentRequest->setNotificationURL(home_url() . '/index.php?notificationurl=true'); } //Sets Items if (sizeof($order->get_items()) > 0) { $paymentRequest->setItems($this->setItems($order)); } // Sets the sum of discounts $paymentRequest->setExtraAmount(($order->order_discount + $order->cart_discount) * -1 + ($order->order_tax + $order->order_shipping_tax + $order->prices_include_tax)); try { $credentials = new PagSeguroAccountCredentials($this->email, $this->token); return $paymentRequest->register($credentials); } catch (PagSeguroServiceException $e) { $woocommerce->add_error(__('Sorry, unfortunately there was an error during checkout. Please contact the store administrator if the problem persists.', 'wpwcpagseguro')); $woocommerce->show_messages(); wp_die(); } }
/** * Set PagSeguro PrestaShop module version */ private function _setPagSeguroModuleVersion() { PagSeguroLibrary::setModuleVersion('prestashop-v.' . $this->module->version); }
/** * Sets PagSeguro plugin version */ private function _setPagSeguroModuleVersion() { PagSeguroLibrary::setModuleVersion('hikashop' . ':1.0'); }
/** * Sets PagSeguro plugin version */ private function _setPagSeguroModuleVersion() { PagSeguroLibrary::setModuleVersion('virtuemart' . ':' . self::$_pluginVersion); }
/** * Set Config's to PagSeguro API * */ private function setPagSeguroConfig() { $_activeLog = $this->getConfigData('log'); $_charset = $this->getConfigData('charset'); Mage::getSingleton('PagSeguro_PagSeguro_Helper_Data')->saveAllStatusPagSeguro(); //Module version PagSeguroLibrary::setModuleVersion('magento' . ':' . $this->Module_Version); //CMS version PagSeguroLibrary::setCMSVersion('magento' . ':' . Mage::getVersion()); //Setup Charset if ($_charset != null and !empty($_charset)) { PagSeguroConfig::setApplicationCharset($_charset); } //Setup Log if ($_activeLog == 1) { $_log_file = $this->getConfigData('log_file'); if (self::checkFile(Mage::getBaseDir() . '/' . $_log_file)) { PagSeguroConfig::activeLog(Mage::getBaseDir() . '/' . $_log_file); } else { PagSeguroConfig::activeLog(); //Default Log } } }