Skip to content

Instantly share code, notes, and snippets.

View centerax's full-sized avatar
✈️

Pablo S. Benitez centerax

✈️
View GitHub Profile
<?php
class Ebizmarts_SageOne_Block_Adminhtml_Sales_Order_Creditnote_Note extends Mage_Core_Block_Template {
public function getCreditMemo() {
return Mage::registry('current_creditmemo');
}
/**
@centerax
centerax / sagePaySuite_Checkout.js
Created August 5, 2013 20:02
PayPal Hosted PRO with Sage Pay Suite - OneStepCheckout
//Before 'if(!this.isSagePay()) {' add
if(this.getPaymentMethod() == "hosted_pro") {
submitOsc($('onestepcheckout-form'), location.href, 'Please wait, processing your order...', SuiteConfig.getConfig('global', 'osc_loading_image'));
window._sagepayprocessingorder = false;
return;
}
/**
* Sage50 compatible Basket.
*
* @param Mage_Sales_Model_Quote $quote
* @return string Basket as string.
*/
public function getSageBasket($quote) {
$basket = '';
<?php
/**
* @see Ebizmarts_SagePaySuite_Block_Paypal_Express_Review
*/
?>
<div class="page-title">
<h1><?php echo $this->__('Review Order') ?></h1>
</div>
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<currencies>
<currency type="AFN">
<symbol>Af</symbol>
</currency>
<currency type="ANG">
<symbol>NAf.</symbol>
</currency>
<currency type="AOA">
<symbol>Kz</symbol>
</currency>
<?php
/**
* API model access for SagePay
*
* @category Ebizmarts
* @package Ebizmarts_SagePaySuite
* @author Ebizmarts <info@ebizmarts.com>
*/
class Ebizmarts_SagePaySuite_Model_Api_Payment extends Mage_Payment_Model_Method_Cc {
@centerax
centerax / Proxy_SagePaySuite
Created June 5, 2013 13:23
workaround when you are behind a proxy
I have added this patch which should fix it
Payment.php
Add at line 1939
if($this->getConfigData('proxy_enabled')) {
$proxy_user_pwd = $this->getConfigData('proxy_user').':'.$this->getConfigData('proxy_pass');
$proxy_host_port = 'http://'.$this->getConfigData('proxy_host').':'.$this->getConfigData('proxy_port');
curl_setopt($curlSession, CURLOPT_PROXYUSERPWD, $usrPwd);
curl_setopt($curlSession, CURLOPT_PROXY, $proxy_host_port);
}
diff --git a/app/code/local/Ebizmarts/SagePaySuite/Model/Api/Payment.php b/app/code/local/Ebizmarts/SagePaySuite/Model/Api/Payment.php
index 0b191b3..f56efab 100755
--- a/app/code/local/Ebizmarts/SagePaySuite/Model/Api/Payment.php
+++ b/app/code/local/Ebizmarts/SagePaySuite/Model/Api/Payment.php
@@ -62,11 +62,11 @@ class Ebizmarts_SagePaySuite_Model_Api_Payment extends Mage_Payment_Model_Method
/**
* BasketXML related error codes.
- *
- * @var type
<?php
ini_set('error_reporting', E_ERROR | E_PARSE);
ini_set('display_errors', 1);
$baseUrl = "http://www.brou.com.uy";
$data = file_get_contents($baseUrl . "/web/guest/institucional/cotizaciones");
$dom = new DOMDocument;
<?xml version="1.0"?>
<basket>
<item>
<description>Honeycomb Quilted Silk Bed Spread - Blue - Pebble</description>
<productSku>Q-HCOMB/BP</productSku>
<productCode>53521</productCode>
<quantity>1</quantity>
<unitNetAmount>162.50</unitNetAmount>
<unitTaxAmount>32.50</unitTaxAmount>
<unitGrossAmount>195.00</unitGrossAmount>