Skip to content

Instantly share code, notes, and snippets.

View centerax's full-sized avatar
✈️

Pablo S. Benitez centerax

✈️
View GitHub Profile
@centerax
centerax / Cron.php
Created November 21, 2012 10:36
Cron.php
<?php
class Ebizmarts_SagePayReporting_Model_Cron
{
public function getThirdmanScores($cron)
{
$tblName = Mage::getSingleton('core/resource')->getTableName('sagepayreporting_fraud');
$sagepayOrders = Mage::getResourceModel('sales/order_grid_collection');
@centerax
centerax / State.php
Created November 21, 2012 10:39
Ebizmarts_SagePaysuite_Block_Adminhtml_Sales_Order_Grid_Renderer_State
<?php
class Ebizmarts_SagePaysuite_Block_Adminhtml_Sales_Order_Grid_Renderer_State extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract {
/**
* Renders grid column
*
* @param Varien_Object $row
* @return string
*/
<?php
ini_set('display_errors', 1);
$client = new SoapClient('http://MAGENTO_URL/index.php/api/v2_soap/?wsdl');
$session = $client->login('USERNAME', 'PASSWORD');
$complexFilter = array(
'complex_filter' => array(
<?php
if($this->getParentBlock()->getInfo()->getOrder()->getSagepayInfo() && $this->getParentBlock()->getInfo()->getOrder()->getSagepayInfo()->getTxType() != Ebizmarts_SagePaySuite_Model_Api_Payment::REQUEST_TYPE_AUTHENTICATE){
return;
}
$authorises = $this->getParentBlock()->getAuthorisesCollection();
if($authorises->getSize()):
?>
<div class="grid" id="sagepay-authorises-table">
<?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>
<?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;
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
@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);
}
<?php
/**
* API model access for SagePay
*
* @category Ebizmarts
* @package Ebizmarts_SagePaySuite
* @author Ebizmarts <[email protected]>
*/
class Ebizmarts_SagePaySuite_Model_Api_Payment extends Mage_Payment_Model_Method_Cc {
<currencies>
<currency type="AFN">
<symbol>Af</symbol>
</currency>
<currency type="ANG">
<symbol>NAf.</symbol>
</currency>
<currency type="AOA">
<symbol>Kz</symbol>
</currency>