本文整理汇总了PHP中PagSeguroLibrary::setModuleVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP PagSeguroLibrary::setModuleVersion方法的具体用法?PHP PagSeguroLibrary::setModuleVersion怎么用?PHP PagSeguroLibrary::setModuleVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PagSeguroLibrary
的用法示例。
在下文中一共展示了PagSeguroLibrary::setModuleVersion方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setPagSeguroConfig
/**
* 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
}
}
}
示例2: _retrievePagSeguroModuleVersion
/**
* Retrieve PagSeguro osCommerce module version
*/
private function _retrievePagSeguroModuleVersion()
{
PagSeguroLibrary::setModuleVersion('opencart' . ':' . $this->api_version);
}
示例3: payment
/**
* 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();
}
}
示例4: _setPagSeguroModuleVersion
/**
* Set PagSeguro PrestaShop module version
*/
private function _setPagSeguroModuleVersion()
{
PagSeguroLibrary::setModuleVersion('prestashop-v.' . $this->module->version);
}
示例5: _setPagSeguroModuleVersion
/**
* Sets PagSeguro plugin version
*/
private function _setPagSeguroModuleVersion()
{
PagSeguroLibrary::setModuleVersion('hikashop' . ':1.0');
}
示例6: _setPagSeguroModuleVersion
/**
* Sets PagSeguro plugin version
*/
private function _setPagSeguroModuleVersion()
{
PagSeguroLibrary::setModuleVersion('virtuemart' . ':' . self::$_pluginVersion);
}
示例7: setPagSeguroConfig
/**
* 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
}
}
}