Version Notes
* Many improvements and fixes.
Download this release
Release Info
| Developer | Aplazame |
| Extension | Aplazame_Aplazame |
| Version | 0.4.3 |
| Comparing to | |
| See all releases | |
Code changes from version 0.4.2 to 0.4.3
- app/code/community/Aplazame/Aplazame/Block/Checkout/Cart/Widget.php +1 -1
- app/code/community/Aplazame/Aplazame/Block/Payment/Form.php +7 -22
- app/code/community/Aplazame/Aplazame/Block/Product/Widget.php +1 -1
- app/code/community/Aplazame/Aplazame/Model/Api/Client.php +11 -0
- app/code/community/Aplazame/Aplazame/Model/Config.php +0 -35
- app/code/community/Aplazame/Aplazame/Model/Payment.php +9 -40
- app/code/community/Aplazame/Aplazame/etc/config.xml +5 -2
- app/code/community/Aplazame/Aplazame/etc/system.xml +43 -9
- app/design/frontend/base/default/layout/aplazame.xml +5 -2
- app/design/frontend/base/default/template/aplazame/checkout/cart/widget.phtml +6 -2
- app/design/frontend/base/default/template/aplazame/payment/form.phtml +16 -15
- app/design/frontend/base/default/template/aplazame/product/widget.phtml +6 -2
- app/locale/es_ES/Aplazame_Aplazame.csv +0 -1
- package.xml +5 -6
app/code/community/Aplazame/Aplazame/Block/Checkout/Cart/Widget.php
CHANGED
|
@@ -30,7 +30,7 @@ class Aplazame_Aplazame_Block_Checkout_Cart_Widget Extends Mage_Core_Block_Templ
|
|
| 30 |
{
|
| 31 |
if($this->getQuote() instanceof Mage_Sales_Model_Quote)
|
| 32 |
{
|
| 33 |
-
$total = $this->getQuote()->
|
| 34 |
} else {
|
| 35 |
$total = 0;
|
| 36 |
}
|
| 30 |
{
|
| 31 |
if($this->getQuote() instanceof Mage_Sales_Model_Quote)
|
| 32 |
{
|
| 33 |
+
$total = $this->getQuote()->getGrandTotal();
|
| 34 |
} else {
|
| 35 |
$total = 0;
|
| 36 |
}
|
app/code/community/Aplazame/Aplazame/Block/Payment/Form.php
CHANGED
|
@@ -1,38 +1,23 @@
|
|
| 1 |
<?php
|
| 2 |
|
|
|
|
|
|
|
|
|
|
| 3 |
class Aplazame_Aplazame_Block_Payment_Form extends Mage_Payment_Block_Form
|
| 4 |
{
|
| 5 |
protected function _construct()
|
| 6 |
{
|
| 7 |
parent::_construct();
|
| 8 |
-
$this->setMethodLabel();
|
| 9 |
$this->setTemplate('aplazame/payment/form.phtml');
|
| 10 |
}
|
| 11 |
|
| 12 |
-
|
| 13 |
{
|
| 14 |
-
$this->
|
| 15 |
-
|
| 16 |
-
$html = 'Financialo con Aplazame';
|
| 17 |
-
|
| 18 |
-
$this->setMethodLabelAfterHtml($html);
|
| 19 |
-
}
|
| 20 |
-
|
| 21 |
-
public function getTotal()
|
| 22 |
-
{
|
| 23 |
-
return $this->getMethod()->getCheckout()->getQuote()->getGrandTotal();
|
| 24 |
}
|
| 25 |
|
| 26 |
-
|
| 27 |
-
* Devuelve el country ID en formato ISO 2 caracteres
|
| 28 |
-
* para comunicarlo a aplazame y que pueda tomar decisiones en base al país de facturación.
|
| 29 |
-
* @return string
|
| 30 |
-
*/
|
| 31 |
-
public function getCountry()
|
| 32 |
{
|
| 33 |
-
$
|
| 34 |
-
$countryId = $quote->getBillingAddress()->getCountryId();
|
| 35 |
-
|
| 36 |
-
return $countryId;
|
| 37 |
}
|
| 38 |
}
|
| 1 |
<?php
|
| 2 |
|
| 3 |
+
/**
|
| 4 |
+
* @method Aplazame_Aplazame_Model_Payment getMethod()
|
| 5 |
+
*/
|
| 6 |
class Aplazame_Aplazame_Block_Payment_Form extends Mage_Payment_Block_Form
|
| 7 |
{
|
| 8 |
protected function _construct()
|
| 9 |
{
|
| 10 |
parent::_construct();
|
|
|
|
| 11 |
$this->setTemplate('aplazame/payment/form.phtml');
|
| 12 |
}
|
| 13 |
|
| 14 |
+
public function getInstructions()
|
| 15 |
{
|
| 16 |
+
return trim($this->getMethod()->getConfigData('instructions'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
}
|
| 18 |
|
| 19 |
+
public function getQuote()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
{
|
| 21 |
+
return $this->getMethod()->getCheckout()->getQuote();
|
|
|
|
|
|
|
|
|
|
| 22 |
}
|
| 23 |
}
|
app/code/community/Aplazame/Aplazame/Block/Product/Widget.php
CHANGED
|
@@ -30,7 +30,7 @@ class Aplazame_Aplazame_Block_Product_Widget Extends Mage_Core_Block_Template
|
|
| 30 |
{
|
| 31 |
if($this->getProduct() instanceof Mage_Catalog_Model_Product)
|
| 32 |
{
|
| 33 |
-
$total = $this->getProduct()->getFinalPrice();
|
| 34 |
} else {
|
| 35 |
$total = 0;
|
| 36 |
}
|
| 30 |
{
|
| 31 |
if($this->getProduct() instanceof Mage_Catalog_Model_Product)
|
| 32 |
{
|
| 33 |
+
$total = Mage::app()->getStore()->convertPrice($this->getProduct()->getFinalPrice());
|
| 34 |
} else {
|
| 35 |
$total = 0;
|
| 36 |
}
|
app/code/community/Aplazame/Aplazame/Model/Api/Client.php
CHANGED
|
@@ -26,6 +26,17 @@ class Aplazame_Aplazame_Model_Api_Client extends Varien_Object
|
|
| 26 |
return $this->apiClient->request(Varien_Http_Client::POST, '/orders/' . $orderId . "/authorize");
|
| 27 |
}
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
/**
|
| 30 |
* @param Mage_Sales_Model_Order $order
|
| 31 |
* @return array
|
| 26 |
return $this->apiClient->request(Varien_Http_Client::POST, '/orders/' . $orderId . "/authorize");
|
| 27 |
}
|
| 28 |
|
| 29 |
+
/**
|
| 30 |
+
* @param string $orderId
|
| 31 |
+
* @return array
|
| 32 |
+
*/
|
| 33 |
+
public function fetchOrder($orderId)
|
| 34 |
+
{
|
| 35 |
+
$orders = $this->apiClient->request(Varien_Http_Client::GET, '/orders?mid=' . $orderId);
|
| 36 |
+
|
| 37 |
+
return $orders['results'][0];
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
/**
|
| 41 |
* @param Mage_Sales_Model_Order $order
|
| 42 |
* @return array
|
app/code/community/Aplazame/Aplazame/Model/Config.php
DELETED
|
@@ -1,35 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class Aplazame_Aplazame_Model_Config
|
| 4 |
-
{
|
| 5 |
-
|
| 6 |
-
const XML_PATH_DEFAULT_COUNTRY = 'general/country/default';
|
| 7 |
-
|
| 8 |
-
protected $_storeId = null;
|
| 9 |
-
|
| 10 |
-
/**
|
| 11 |
-
* Return merchant country code
|
| 12 |
-
*/
|
| 13 |
-
public function getMerchantCountry()
|
| 14 |
-
{
|
| 15 |
-
$countryCode = Mage::getStoreConfig("aplazame/general/merchant_country", $this->_storeId);
|
| 16 |
-
if (!$countryCode) {
|
| 17 |
-
$countryCode = Mage::getStoreConfig(self::XML_PATH_DEFAULT_COUNTRY, $this->_storeId);
|
| 18 |
-
}
|
| 19 |
-
return $countryCode;
|
| 20 |
-
}
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
/**
|
| 26 |
-
* Check whether specified currency code is supported
|
| 27 |
-
*/
|
| 28 |
-
public function isCurrencyCodeSupported($code)
|
| 29 |
-
{
|
| 30 |
-
if ($this->getMerchantCountry() == 'ES' && $code == 'EUR') {
|
| 31 |
-
return true;
|
| 32 |
-
}
|
| 33 |
-
return false;
|
| 34 |
-
}
|
| 35 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Aplazame/Aplazame/Model/Payment.php
CHANGED
|
@@ -14,8 +14,6 @@ class Aplazame_Aplazame_Model_Payment extends Mage_Payment_Model_Method_Abstract
|
|
| 14 |
protected $_isInitializeNeeded = true;
|
| 15 |
protected $_canUseInternal = false;
|
| 16 |
protected $_canUseForMultishipping = false;
|
| 17 |
-
/** @var Aplazame_Aplazame_Model_Config Config */
|
| 18 |
-
private $_config;
|
| 19 |
|
| 20 |
|
| 21 |
public function initialize($paymentAction, $stateObject)
|
|
@@ -27,34 +25,11 @@ class Aplazame_Aplazame_Model_Payment extends Mage_Payment_Model_Method_Abstract
|
|
| 27 |
$stateObject->setIsNotified(false);
|
| 28 |
}
|
| 29 |
|
| 30 |
-
/**
|
| 31 |
-
* Whether method is available for specified currency
|
| 32 |
-
*/
|
| 33 |
-
public function canUseForCurrency($currencyCode)
|
| 34 |
-
{
|
| 35 |
-
return $this->getConfig()->isCurrencyCodeSupported($currencyCode);
|
| 36 |
-
}
|
| 37 |
-
|
| 38 |
private static function _orderTotal($order)
|
| 39 |
{
|
| 40 |
return $order->getTotalDue();
|
| 41 |
}
|
| 42 |
|
| 43 |
-
/**
|
| 44 |
-
* Config instance getter
|
| 45 |
-
*/
|
| 46 |
-
public function getConfig()
|
| 47 |
-
{
|
| 48 |
-
if (null === $this->_config) {
|
| 49 |
-
$params = array($this->_code);
|
| 50 |
-
if ($store = $this->getStore()) {
|
| 51 |
-
$params[] = is_object($store) ? $store->getId() : $store;
|
| 52 |
-
}
|
| 53 |
-
$this->_config = Mage::getModel('aplazame/config', $params);
|
| 54 |
-
}
|
| 55 |
-
return $this->_config;
|
| 56 |
-
}
|
| 57 |
-
|
| 58 |
/**
|
| 59 |
* Get aplazame session namespace
|
| 60 |
*/
|
|
@@ -84,15 +59,6 @@ class Aplazame_Aplazame_Model_Payment extends Mage_Payment_Model_Method_Abstract
|
|
| 84 |
return $this->getInfoInstance()->getAdditionalInformation("charge_id");
|
| 85 |
}
|
| 86 |
|
| 87 |
-
protected function _validate_amount_result($amount, $result)
|
| 88 |
-
{
|
| 89 |
-
if ($result["amount"] != $amount) {
|
| 90 |
-
Mage::throwException(Mage::helper('aplazame')->__(
|
| 91 |
-
'Aplazame authorized amount of ' . $result["amount"] .
|
| 92 |
-
' does not match requested amount of: ' . $amount));
|
| 93 |
-
}
|
| 94 |
-
}
|
| 95 |
-
|
| 96 |
public function authorize(Varien_Object $payment, $amount)
|
| 97 |
{
|
| 98 |
if ($amount <= 0) {
|
|
@@ -103,15 +69,18 @@ class Aplazame_Aplazame_Model_Payment extends Mage_Payment_Model_Method_Abstract
|
|
| 103 |
|
| 104 |
/** @var Aplazame_Aplazame_Model_Api_Client $api */
|
| 105 |
$api = Mage::getModel('aplazame/api_client');
|
| 106 |
-
$result = $api->authorize($token);
|
| 107 |
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
|
|
|
|
|
|
|
|
|
| 112 |
}
|
| 113 |
|
| 114 |
-
$
|
|
|
|
| 115 |
$payment->setTransactionId($this->getChargeId())->setIsTransactionClosed(0);
|
| 116 |
return $this;
|
| 117 |
}
|
| 14 |
protected $_isInitializeNeeded = true;
|
| 15 |
protected $_canUseInternal = false;
|
| 16 |
protected $_canUseForMultishipping = false;
|
|
|
|
|
|
|
| 17 |
|
| 18 |
|
| 19 |
public function initialize($paymentAction, $stateObject)
|
| 25 |
$stateObject->setIsNotified(false);
|
| 26 |
}
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
private static function _orderTotal($order)
|
| 29 |
{
|
| 30 |
return $order->getTotalDue();
|
| 31 |
}
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
/**
|
| 34 |
* Get aplazame session namespace
|
| 35 |
*/
|
| 59 |
return $this->getInfoInstance()->getAdditionalInformation("charge_id");
|
| 60 |
}
|
| 61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
public function authorize(Varien_Object $payment, $amount)
|
| 63 |
{
|
| 64 |
if ($amount <= 0) {
|
| 69 |
|
| 70 |
/** @var Aplazame_Aplazame_Model_Api_Client $api */
|
| 71 |
$api = Mage::getModel('aplazame/api_client');
|
|
|
|
| 72 |
|
| 73 |
+
$aOrder = $api->fetchOrder($token);
|
| 74 |
+
if ($aOrder['total_amount'] !== Aplazame_Sdk_Serializer_Decimal::fromFloat($amount)->jsonSerialize() ||
|
| 75 |
+
$aOrder['currency']['code'] !== Mage::app()->getStore()->getCurrentCurrencyCode()
|
| 76 |
+
) {
|
| 77 |
+
Mage::throwException(Mage::helper('aplazame')->__(
|
| 78 |
+
'Aplazame authorized amount of ' . $aOrder['total_amount'] .
|
| 79 |
+
' does not match requested amount of: ' . $amount));
|
| 80 |
}
|
| 81 |
|
| 82 |
+
$result = $api->authorize($token);
|
| 83 |
+
$this->getInfoInstance()->setAdditionalInformation("charge_id", $result["id"]);
|
| 84 |
$payment->setTransactionId($this->getChargeId())->setIsTransactionClosed(0);
|
| 85 |
return $this;
|
| 86 |
}
|
app/code/community/Aplazame/Aplazame/etc/config.xml
CHANGED
|
@@ -120,10 +120,13 @@
|
|
| 120 |
<active>0</active>
|
| 121 |
<sandbox>0</sandbox>
|
| 122 |
<model>aplazame/payment</model>
|
| 123 |
-
<title>Aplazame</title>
|
| 124 |
<secret_api_key backend_model="adminhtml/system_config_backend_encrypted"/>
|
| 125 |
<button>dt:has(input#p_method_aplazame)</button>
|
| 126 |
-
<
|
|
|
|
|
|
|
|
|
|
| 127 |
</aplazame>
|
| 128 |
</payment>
|
| 129 |
</default>
|
| 120 |
<active>0</active>
|
| 121 |
<sandbox>0</sandbox>
|
| 122 |
<model>aplazame/payment</model>
|
| 123 |
+
<title>Financialo con Aplazame</title>
|
| 124 |
<secret_api_key backend_model="adminhtml/system_config_backend_encrypted"/>
|
| 125 |
<button>dt:has(input#p_method_aplazame)</button>
|
| 126 |
+
<instructions><![CDATA[Aplaza o fracciona tu compra con <a href="https://aplazame.com" target="_blank">Aplazame</a>.
|
| 127 |
+
Obtén financiación al instante sólo con tu Nombre y Apellidos, DNI/NIE, Teléfono y tarjeta de débito o crédito.
|
| 128 |
+
Sin comisiones ocultas ni letra pequeña.]]>
|
| 129 |
+
</instructions>
|
| 130 |
</aplazame>
|
| 131 |
</payment>
|
| 132 |
</default>
|
app/code/community/Aplazame/Aplazame/etc/system.xml
CHANGED
|
@@ -21,6 +21,14 @@
|
|
| 21 |
<show_in_website>1</show_in_website>
|
| 22 |
<show_in_store>1</show_in_store>
|
| 23 |
</active>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
<sandbox translate="label">
|
| 25 |
<label>Test Mode (Sandbox)</label>
|
| 26 |
<frontend_type>select</frontend_type>
|
|
@@ -28,7 +36,7 @@
|
|
| 28 |
<sort_order>20</sort_order>
|
| 29 |
<show_in_default>1</show_in_default>
|
| 30 |
<show_in_website>1</show_in_website>
|
| 31 |
-
<show_in_store>
|
| 32 |
</sandbox>
|
| 33 |
<secret_api_key translate="label">
|
| 34 |
<label>Private API Key</label>
|
|
@@ -37,32 +45,58 @@
|
|
| 37 |
<sort_order>30</sort_order>
|
| 38 |
<show_in_default>1</show_in_default>
|
| 39 |
<show_in_website>1</show_in_website>
|
| 40 |
-
<show_in_store>
|
| 41 |
</secret_api_key>
|
| 42 |
<public_api_key translate="label">
|
| 43 |
<label>Public API Key</label>
|
| 44 |
<frontend_type>text</frontend_type>
|
| 45 |
-
<sort_order>
|
| 46 |
<show_in_default>1</show_in_default>
|
| 47 |
<show_in_website>1</show_in_website>
|
| 48 |
-
<show_in_store>
|
| 49 |
</public_api_key>
|
| 50 |
-
|
| 51 |
<label>Aplazame Button CSS Selector</label>
|
| 52 |
<frontend_type>text</frontend_type>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
<sort_order>50</sort_order>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
<show_in_default>1</show_in_default>
|
| 55 |
<show_in_website>1</show_in_website>
|
| 56 |
<show_in_store>1</show_in_store>
|
| 57 |
-
</
|
| 58 |
<sort_order translate="label">
|
| 59 |
-
<label>
|
| 60 |
<frontend_type>text</frontend_type>
|
| 61 |
<sort_order>70</sort_order>
|
| 62 |
<show_in_default>1</show_in_default>
|
| 63 |
<show_in_website>1</show_in_website>
|
| 64 |
-
<show_in_store>
|
| 65 |
-
<frontend_class>validate-number</frontend_class>
|
| 66 |
</sort_order>
|
| 67 |
<autoinvoice translate="label comment tooltip">
|
| 68 |
<label>Automatic invoice generation</label>
|
| 21 |
<show_in_website>1</show_in_website>
|
| 22 |
<show_in_store>1</show_in_store>
|
| 23 |
</active>
|
| 24 |
+
<title translate="label">
|
| 25 |
+
<label>Title</label>
|
| 26 |
+
<frontend_type>text</frontend_type>
|
| 27 |
+
<sort_order>15</sort_order>
|
| 28 |
+
<show_in_default>1</show_in_default>
|
| 29 |
+
<show_in_website>1</show_in_website>
|
| 30 |
+
<show_in_store>0</show_in_store>
|
| 31 |
+
</title>
|
| 32 |
<sandbox translate="label">
|
| 33 |
<label>Test Mode (Sandbox)</label>
|
| 34 |
<frontend_type>select</frontend_type>
|
| 36 |
<sort_order>20</sort_order>
|
| 37 |
<show_in_default>1</show_in_default>
|
| 38 |
<show_in_website>1</show_in_website>
|
| 39 |
+
<show_in_store>0</show_in_store>
|
| 40 |
</sandbox>
|
| 41 |
<secret_api_key translate="label">
|
| 42 |
<label>Private API Key</label>
|
| 45 |
<sort_order>30</sort_order>
|
| 46 |
<show_in_default>1</show_in_default>
|
| 47 |
<show_in_website>1</show_in_website>
|
| 48 |
+
<show_in_store>0</show_in_store>
|
| 49 |
</secret_api_key>
|
| 50 |
<public_api_key translate="label">
|
| 51 |
<label>Public API Key</label>
|
| 52 |
<frontend_type>text</frontend_type>
|
| 53 |
+
<sort_order>35</sort_order>
|
| 54 |
<show_in_default>1</show_in_default>
|
| 55 |
<show_in_website>1</show_in_website>
|
| 56 |
+
<show_in_store>0</show_in_store>
|
| 57 |
</public_api_key>
|
| 58 |
+
<button>
|
| 59 |
<label>Aplazame Button CSS Selector</label>
|
| 60 |
<frontend_type>text</frontend_type>
|
| 61 |
+
<sort_order>40</sort_order>
|
| 62 |
+
<show_in_default>1</show_in_default>
|
| 63 |
+
<show_in_website>1</show_in_website>
|
| 64 |
+
<show_in_store>0</show_in_store>
|
| 65 |
+
</button>
|
| 66 |
+
<allowspecific translate="label">
|
| 67 |
+
<label>Payment from Applicable Countries</label>
|
| 68 |
+
<frontend_type>allowspecific</frontend_type>
|
| 69 |
<sort_order>50</sort_order>
|
| 70 |
+
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
| 71 |
+
<show_in_default>1</show_in_default>
|
| 72 |
+
<show_in_website>1</show_in_website>
|
| 73 |
+
<show_in_store>0</show_in_store>
|
| 74 |
+
</allowspecific>
|
| 75 |
+
<specificcountry translate="label">
|
| 76 |
+
<label>Payment from Specific Countries</label>
|
| 77 |
+
<frontend_type>multiselect</frontend_type>
|
| 78 |
+
<sort_order>55</sort_order>
|
| 79 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
| 80 |
+
<show_in_default>1</show_in_default>
|
| 81 |
+
<show_in_website>1</show_in_website>
|
| 82 |
+
<show_in_store>0</show_in_store>
|
| 83 |
+
<can_be_empty>1</can_be_empty>
|
| 84 |
+
</specificcountry>
|
| 85 |
+
<instructions translate="label">
|
| 86 |
+
<label>Instructions</label>
|
| 87 |
+
<frontend_type>textarea</frontend_type>
|
| 88 |
+
<sort_order>60</sort_order>
|
| 89 |
<show_in_default>1</show_in_default>
|
| 90 |
<show_in_website>1</show_in_website>
|
| 91 |
<show_in_store>1</show_in_store>
|
| 92 |
+
</instructions>
|
| 93 |
<sort_order translate="label">
|
| 94 |
+
<label>Sort Order</label>
|
| 95 |
<frontend_type>text</frontend_type>
|
| 96 |
<sort_order>70</sort_order>
|
| 97 |
<show_in_default>1</show_in_default>
|
| 98 |
<show_in_website>1</show_in_website>
|
| 99 |
+
<show_in_store>0</show_in_store>
|
|
|
|
| 100 |
</sort_order>
|
| 101 |
<autoinvoice translate="label comment tooltip">
|
| 102 |
<label>Automatic invoice generation</label>
|
app/design/frontend/base/default/layout/aplazame.xml
CHANGED
|
@@ -1,8 +1,11 @@
|
|
| 1 |
<layout version="0.1.0">
|
| 2 |
<default>
|
| 3 |
<reference name="head" before="-">
|
| 4 |
-
<block type="page/html" name="aplazame_common" as="aplazame_common"
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
| 6 |
</reference>
|
| 7 |
</default>
|
| 8 |
<catalog_product_view>
|
| 1 |
<layout version="0.1.0">
|
| 2 |
<default>
|
| 3 |
<reference name="head" before="-">
|
| 4 |
+
<block type="page/html" name="aplazame_common" as="aplazame_common">
|
| 5 |
+
<action method="setTemplate" ifconfig="payment/aplazame/active">
|
| 6 |
+
<template>aplazame/payment/common.phtml</template>
|
| 7 |
+
</action>
|
| 8 |
+
</block>
|
| 9 |
</reference>
|
| 10 |
</default>
|
| 11 |
<catalog_product_view>
|
app/design/frontend/base/default/template/aplazame/checkout/cart/widget.phtml
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
<div
|
| 2 |
data-aplazame-simulator=""
|
| 3 |
data-view="cart"
|
| 4 |
-
data-amount="<?php echo Aplazame_Sdk_Serializer_Decimal::fromFloat($this->getTotal())->jsonSerialize(); ?>"
|
| 5 |
-
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/** @var Aplazame_Aplazame_Block_Checkout_Cart_Widget $this */
|
| 3 |
+
?>
|
| 4 |
<div
|
| 5 |
data-aplazame-simulator=""
|
| 6 |
data-view="cart"
|
| 7 |
+
data-amount="<?php echo Aplazame_Sdk_Serializer_Decimal::fromFloat($this->getTotal())->jsonSerialize(); ?>"
|
| 8 |
+
data-currency="<?php echo Mage::app()->getStore()->getCurrentCurrencyCode() ?>"
|
| 9 |
+
></div>
|
app/design/frontend/base/default/template/aplazame/payment/form.phtml
CHANGED
|
@@ -1,22 +1,23 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
</fieldset>
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
</div>
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
<script>
|
| 16 |
aplazame.button({
|
| 17 |
selector: "<?php echo Mage::getStoreConfig('payment/aplazame/button') ?>",
|
| 18 |
-
amount: <?php echo Aplazame_Sdk_Serializer_Decimal::fromFloat($
|
| 19 |
-
currency: "
|
| 20 |
-
country: "<?php echo $this->getCountry(); ?>"
|
| 21 |
});
|
| 22 |
</script>
|
| 1 |
+
<?php
|
| 2 |
+
/** @var Aplazame_Aplazame_Block_Payment_Form $this */
|
|
|
|
| 3 |
|
| 4 |
+
$quote = $this->getQuote();
|
| 5 |
+
?>
|
| 6 |
+
|
| 7 |
+
<?php if ($instructions = $this->getInstructions()): ?>
|
| 8 |
+
<ul class="form-list checkout-agreements" id="payment_form_<?php echo $this->getMethodCode() ?>" style="display:none;">
|
| 9 |
+
<li>
|
| 10 |
+
<div class="<?php echo $this->getMethodCode() ?>-instructions-content agreement-content">
|
| 11 |
+
<?php echo nl2br($instructions) ?>
|
| 12 |
+
</div>
|
| 13 |
+
</li>
|
| 14 |
+
</ul>
|
| 15 |
+
<?php endif; ?>
|
| 16 |
|
| 17 |
<script>
|
| 18 |
aplazame.button({
|
| 19 |
selector: "<?php echo Mage::getStoreConfig('payment/aplazame/button') ?>",
|
| 20 |
+
amount: <?php echo Aplazame_Sdk_Serializer_Decimal::fromFloat($quote->getGrandTotal())->jsonSerialize() ?>,
|
| 21 |
+
currency: "<?php echo $quote->getQuoteCurrencyCode() ?>"
|
|
|
|
| 22 |
});
|
| 23 |
</script>
|
app/design/frontend/base/default/template/aplazame/product/widget.phtml
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
<div
|
| 2 |
data-aplazame-simulator=""
|
| 3 |
data-view="product"
|
| 4 |
-
data-amount="<?php echo Aplazame_Sdk_Serializer_Decimal::fromFloat($this->getFinalPrice())->jsonSerialize(); ?>"
|
| 5 |
-
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/** @var Aplazame_Aplazame_Block_Product_Widget $this */
|
| 3 |
+
?>
|
| 4 |
<div
|
| 5 |
data-aplazame-simulator=""
|
| 6 |
data-view="product"
|
| 7 |
+
data-amount="<?php echo Aplazame_Sdk_Serializer_Decimal::fromFloat($this->getFinalPrice())->jsonSerialize(); ?>"
|
| 8 |
+
data-currency="<?php echo Mage::app()->getStore()->getCurrentCurrencyCode(); ?>"
|
| 9 |
+
></div>
|
app/locale/es_ES/Aplazame_Aplazame.csv
CHANGED
|
@@ -14,7 +14,6 @@
|
|
| 14 |
"Cannot add the item to shopping cart.","No se puede añadir el producto al carro de compra."
|
| 15 |
"Aplazame error code ","Aplazame error código "
|
| 16 |
"Invalid amount for authorization.","Cantidad inválida para autorizar."
|
| 17 |
-
"Aplazame charge id not returned from call.","ID de cargo aplazame no devuelto."
|
| 18 |
"Associate to Aplazame Campaigns","Asociar a las campañas Aplazame"
|
| 19 |
"Remove from Aplazame Campaigns","Eliminar de las campañas Aplazame"
|
| 20 |
"Aplazame Campaigns","Aplazame Campaigns"
|
| 14 |
"Cannot add the item to shopping cart.","No se puede añadir el producto al carro de compra."
|
| 15 |
"Aplazame error code ","Aplazame error código "
|
| 16 |
"Invalid amount for authorization.","Cantidad inválida para autorizar."
|
|
|
|
| 17 |
"Associate to Aplazame Campaigns","Asociar a las campañas Aplazame"
|
| 18 |
"Remove from Aplazame Campaigns","Eliminar de las campañas Aplazame"
|
| 19 |
"Aplazame Campaigns","Aplazame Campaigns"
|
package.xml
CHANGED
|
@@ -1,20 +1,19 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Aplazame_Aplazame</name>
|
| 4 |
-
<version>0.4.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>GPL</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Aplazame, a consumer credit company, offers a payment system that can be used by online buyers to receive funding for their purchases.</summary>
|
| 10 |
<description>Aplazame, a consumer credit company, offers a payment system that can be used by online buyers to receive funding for their purchases.</description>
|
| 11 |
-
<notes>*
|
| 12 |
-
* [changed] "Sandbox" is now named "Test Mode (Sandbox)"
|
| 13 |
</notes>
|
| 14 |
<authors><author><name>Aplazame</name><user>aplazame</user><email>dev@aplazame.com</email></author></authors>
|
| 15 |
-
<date>
|
| 16 |
-
<time>
|
| 17 |
-
<contents><target name="magecommunity"><dir name="Aplazame"><dir name="Aplazame"><dir name="Block"><dir name="AdminHtml"><file name="ProductCampaigns.php" hash="cc4007bf8a21b0beee3f26fb7a50291b"/><file name="ProductsCampaigns.php" hash="4e654f2a4b65979229e2adcedda2f287"/></dir><dir name="Checkout"><dir name="Cart"><file name="Widget.php" hash="
|
| 18 |
<compatible/>
|
| 19 |
<dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php></required></dependencies>
|
| 20 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Aplazame_Aplazame</name>
|
| 4 |
+
<version>0.4.3</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>GPL</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Aplazame, a consumer credit company, offers a payment system that can be used by online buyers to receive funding for their purchases.</summary>
|
| 10 |
<description>Aplazame, a consumer credit company, offers a payment system that can be used by online buyers to receive funding for their purchases.</description>
|
| 11 |
+
<notes>* Many improvements and fixes.
|
|
|
|
| 12 |
</notes>
|
| 13 |
<authors><author><name>Aplazame</name><user>aplazame</user><email>dev@aplazame.com</email></author></authors>
|
| 14 |
+
<date>2017-02-22</date>
|
| 15 |
+
<time>16:47:49</time>
|
| 16 |
+
<contents><target name="magecommunity"><dir name="Aplazame"><dir name="Aplazame"><dir name="Block"><dir name="AdminHtml"><file name="ProductCampaigns.php" hash="cc4007bf8a21b0beee3f26fb7a50291b"/><file name="ProductsCampaigns.php" hash="4e654f2a4b65979229e2adcedda2f287"/></dir><dir name="Checkout"><dir name="Cart"><file name="Widget.php" hash="c3f29d9e78412d952e2ecc355e71e4af"/></dir><dir name="Onepage"><file name="Billing.php" hash="d908bf39c8555f436f8841ff30b520f1"/><file name="Shipping.php" hash="8968979cc9140f2f6236ee9f2fbafc98"/></dir></dir><dir name="Payment"><file name="Form.php" hash="b23f141b2b8dc37edee3eecbc5f9f589"/><file name="Info.php" hash="eeadafff816256593595d261c9e3b5f8"/><file name="Redirect.php" hash="b585f3542b421e1034a1593a49541bd3"/></dir><dir name="Product"><file name="Widget.php" hash="c3cf7af0e593d8d35283238b0e73d624"/></dir></dir><dir name="Helper"><file name="Cart.php" hash="f95a90db86fb4732f7d3ef1fb6a2322a"/><file name="Data.php" hash="35cc7eb331ff48912492cce397918270"/></dir><dir name="Model"><dir name="Api"><file name="Client.php" hash="ff318342e80f0ec7b70aef715f149e4b"/></dir><file name="CampaignsObserver.php" hash="a24df9a5b2c241a25c5c2578e04c2aab"/><file name="Observer.php" hash="44825f169bd6c5c85d284cf1fd0fdf28"/><file name="Payment.php" hash="d338cae16fc3a1124ce53a731f74412a"/></dir><dir name="controllers"><dir name="AdminHtml"><file name="AplazameController.php" hash="31a80d33439c5c2d36701347556ea2e9"/></dir><file name="ApiController.php" hash="3d37b650de9731d8e2b6556dadb63e98"/><file name="PaymentController.php" hash="d62bacd625b4cc9a4d2ae0af28d447a4"/></dir><dir name="etc"><file name="config.xml" hash="081b1d4679e20af8a48ff8b3577e0456"/><file name="system.xml" hash="390ded5bc6e8866c9b1541acd20c16b8"/></dir></dir></dir></target><target name="magelib"><dir name="Aplazame"><dir name="Aplazame"><dir name="Api"><file name="Article.php" hash="f88b4e4d0e472f5e70f10df77d923504"/><dir name="BusinessModel"><file name="Article.php" hash="b2620ae2f806f61feb94a29ffa0f8ef9"/><file name="HistoricalOrder.php" hash="5c86021841845c3af4b8e20b06310989"/></dir><file name="Order.php" hash="2f73b330a8df3a41f925c6b721f69957"/></dir><dir name="BusinessModel"><file name="Address.php" hash="0d59592092e08dfb4d3a8fd08de4ac57"/><file name="Article.php" hash="a34660c185b9808ae84488031b4ef504"/><file name="Checkout.php" hash="97b13eb130bdf15a38a4aeb04e239034"/><file name="Customer.php" hash="4e3b255e589bde0ca6f97c3b35fac80c"/><file name="Order.php" hash="e66fa54a1ca4203abef33be1c7712076"/><file name="ShippingInfo.php" hash="e5f1b9a91b0839094a30c04ec9d8ed86"/></dir><dir name="Http"><file name="ZendClient.php" hash="605e0739e74ad75540c0cb8963a64e88"/></dir></dir><dir name="Sdk"><dir name="Api"><file name="ApiClientException.php" hash="96792d448d909366049192c2a37556ae"/><file name="ApiCommunicationException.php" hash="2f46d905ad859291aa204bdbef4153bc"/><file name="ApiRequest.php" hash="c060290dfa790d2b2b38d120e7abf534"/><file name="ApiServerException.php" hash="90821aed9204104da1983137129bbb16"/><file name="AplazameExceptionInterface.php" hash="ed0cfbeda38fd29403c916418716eb02"/><file name="Client.php" hash="c8bcd8d2a0c410e0b82ea4c0359f308c"/><file name="DeserializeException.php" hash="155f2f9c7af08c89401bd74fd4d95c56"/></dir><dir name="Http"><file name="ClientInterface.php" hash="ea3fe4fa5fe82da131521d84ab4fea22"/><file name="CurlClient.php" hash="28150b98ff950b2e1fcc1b048d637bdc"/><file name="Request.php" hash="a910df86e3c92328b59e7922a4bb1481"/><file name="RequestInterface.php" hash="deb097c359796fdbb08e8a3041728f33"/><file name="Response.php" hash="85e49bf8b02fc7f0174db3bf4dcace94"/><file name="ResponseInterface.php" hash="f21ac2bb3969a54015089718c3652e15"/></dir><dir name="Serializer"><file name="Date.php" hash="ef81948d05ea2982d88cbeb5643904d4"/><file name="Decimal.php" hash="677664df2610ad6e0374d8629ea6d68a"/><file name="JsonSerializable.php" hash="baf92f09f79e92bf9c1df90b324be5b0"/><file name="JsonSerializer.php" hash="95f308cad5cab0a7765246bd156ffe50"/></dir><file name="json_polyfill.php" hash="8472b84afc7fc1c7ea4e1d9c2b5d0343"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="aplazame.xml" hash="79024c230729c2757d9b372278411308"/></dir><dir name="template"><dir name="aplazame"><file name="productCampaigns.phtml" hash="2ece400970d9efe2d2282056edc79580"/><file name="productsCampaigns.phtml" hash="284b706a86df213d6a4c56b1706d2716"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="aplazame.xml" hash="2f2be6631b96114622fbd824d1df12fd"/></dir><dir name="template"><dir name="aplazame"><dir name="checkout"><dir name="cart"><file name="widget.phtml" hash="b7df941791e4f1e1d3cd5a346406c061"/></dir></dir><dir name="payment"><file name="common.phtml" hash="128898cf9895997954ea62da3ce091c9"/><file name="form.phtml" hash="d575ccfb07826f7b5f6f00e36d052c03"/></dir><dir name="product"><file name="widget.phtml" hash="a85abf1173928e94e75808770df9ad4b"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="es_ES"><file name="Aplazame_Aplazame.csv" hash="e3b2c78dc85275bd807e089a0b50f5b9"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Aplazame_Aplazame.xml" hash="d816c618a1829401ca0314c3406482a1"/></dir></target></contents>
|
| 17 |
<compatible/>
|
| 18 |
<dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php></required></dependencies>
|
| 19 |
</package>
|
