Skip to content

Commit

Permalink
magento plugin files
Browse files Browse the repository at this point in the history
  • Loading branch information
adyenpayments committed Mar 19, 2014
1 parent 1fe219a commit 827f29f
Show file tree
Hide file tree
Showing 654 changed files with 12,093 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Adyen_Payment_Block_Adminhtml_Form_Field_Installments
* is based on
* Mage_CatalogInventory_Block_Adminhtml_Form_Field_Minsaleqty
* from Mage
*
* via OSL rightfully adapted
*
* @category Adyen
* @package Adyen_Payment
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

/**
* Adminhtml catalog inventory "Installments" field
*
* @category Adyen
* @package Adyen_Payment
* @author Adyen, Amsterdam
*/
class Adyen_Payment_Block_Adminhtml_Form_Field_Installments extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
{


/**
* Prepare to render
*/
protected function _prepareToRender()
{
$this->addColumn('installment_currency', array(
'label' => Mage::helper('adyen')->__('Currency'),
'style' => 'width:100px',
));
$this->addColumn('installment_boundary', array(
'label' => Mage::helper('adyen')->__('Minor Units (incl.)'),
'style' => 'width:100px',
));
$this->addColumn('installment_frequency', array(
'label' => Mage::helper('adyen')->__('Maximum Number of Installments'),
'style' => 'width:100px',
));
$this->_addAfter = false;
$this->_addButtonLabel = Mage::helper('adyen')->__('Add Installment Boundary');
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

/**
* Adyen Payment Module
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category Adyen
* @package Adyen_Payment
* @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* @category Payment Gateway
* @package Adyen_Payment
* @author Adyen
* @property Adyen B.V
* @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
*/
class Adyen_Payment_Block_Adminhtml_Sales_Order_Filter_Adyen extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Select {

protected function _getOptions() {
$events = Mage::getResourceModel('adyen/adyen_event')->getAllDistinctEvents();
$select = array(
array('label' => '', 'value' => null),
);
foreach ($events as $event) {
$select[] = array('label' => $event['adyen_event_result'], 'value' => $event['adyen_event_result']);
}
return $select;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

/**
* Adyen Payment Module
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category Adyen
* @package Adyen_Payment
* @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* @category Payment Gateway
* @package Adyen_Payment
* @author Adyen
* @property Adyen B.V
* @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
*/
class Adyen_Payment_Block_Adminhtml_Sales_Order_Renderer_Adyen extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract {

public function render(Varien_Object $row) {
$status = $row->getAdyenEventCode();
switch ($status) {
case null:
return Mage::helper('adyen')->__('N.A');
default:
return $status;
break;
}
}

}
40 changes: 40 additions & 0 deletions app/code/community/Adyen/Payment/Block/Checkout/Success.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

class Adyen_Payment_Block_Checkout_Success extends Mage_Checkout_Block_Onepage_Success
{
private $order;


/*
* check if payment method is boleto
*/
public function isBoletoPayment()
{
$this->order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());

if ($this->order->getPayment()->getMethod() == "adyen_boleto")
return true;

return false;
}

/*
* get the boleto pdf url from order
*/
public function getUrlBoletoPDF()
{
$result = "";

// if isBoletoPayment is not called first load the order
if($this->order == null)
$this->order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());

if ($this->order->getPayment()->getMethod() == "adyen_boleto")
$result = $this->order->getAdyenBoletoPdf();

return $result;
}

}

?>
53 changes: 53 additions & 0 deletions app/code/community/Adyen/Payment/Block/Failure.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

/**
* Adyen Payment Module
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category Adyen
* @package Adyen_Payment
* @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* @category Payment Gateway
* @package Adyen_Payment
* @author Adyen
* @property Adyen B.V
* @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
*/
class Adyen_Payment_Block_Failure extends Mage_Core_Block_Template {

public function __construct() {
$this->setTemplate('adyen/failure.phtml');
parent::__construct();
}

/**
* Return Error message
*
* @return string
*/
public function getErrorMessage() {
$msg = Mage::getSingleton('checkout/session')->getAdyenErrorMessage();
Mage::getSingleton('checkout/session')->unsAdyenErrorMessage();
return $msg;
}

/**
* Get continue shopping url
*/
public function getContinueShoppingUrl() {
return Mage::getUrl('checkout/cart');
}

}
30 changes: 30 additions & 0 deletions app/code/community/Adyen/Payment/Block/Form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

/**
* Adyen Payment Module
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category Adyen
* @package Adyen_Payment
* @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* @category Payment Gateway
* @package Adyen_Payment
* @author Adyen
* @property Adyen B.V
* @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
*/
class Adyen_Payment_Block_Form extends Mage_Payment_Block_Form {

}
44 changes: 44 additions & 0 deletions app/code/community/Adyen/Payment/Block/Form/Boleto.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

/**
* Adyen Payment Module
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category Adyen
* @package Adyen_Payment
* @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* @category Payment Gateway
* @package Adyen_Payment
* @author Adyen
* @property Adyen B.V
* @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
*/
class Adyen_Payment_Block_Form_Boleto extends Mage_Payment_Block_Form {

protected function _construct() {
parent::_construct();
$this->setTemplate('adyen/form/boleto.phtml');
}

/**
* Retrieve availables boleto card types
*
* @return array
*/
public function getBoletoAvailableTypes() {
return $this->getMethod()->getAvailableBoletoTypes();
}

}
73 changes: 73 additions & 0 deletions app/code/community/Adyen/Payment/Block/Form/Cc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?php

/**
* Adyen Payment Module
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category Adyen
* @package Adyen_Payment
* @copyright Copyright (c) 2011 Adyen (http://www.adyen.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* @category Payment Gateway
* @package Adyen_Payment
* @author Adyen
* @property Adyen B.V
* @copyright Copyright (c) 2014 Adyen BV (http://www.adyen.com)
*/
class Adyen_Payment_Block_Form_Cc extends Mage_Payment_Block_Form_Cc {

protected function _construct() {
parent::_construct();
$this->setTemplate('adyen/form/cc.phtml');
}

/**
* Retrieve availables credit card types
*
* @return array
*/
public function getCcAvailableTypes() {
return $this->getMethod()->getAvailableCCTypes();
}

public function isCseEnabled() {
return $this->getMethod()->isCseEnabled();
}
public function getCsePublicKey() {
return $this->getMethod()->getCsePublicKey();
}

public function is3dSecureEnabled() {
return $this->getMethod()->is3dSecureEnabled();
}

public function getPossibleInstallments(){
return $this->getMethod()->getPossibleInstallments();
}

public function hasInstallments(){
return Mage::helper('adyen/installments')->isInstallmentsEnabled();
}

/**
* Alway's return true for creditcard verification otherwise api call to adyen won't work
*
* @return boolean
*/
public function hasVerification()
{
return true;
}

}
Loading

0 comments on commit 827f29f

Please sign in to comment.