Version Notes
Resolved an issue that bundle products with fixed price are forwarded correctly
Download this release
Release Info
Developer | Oscar Villegas |
Extension | Payson |
Version | 1.8.3.3 |
Comparing to | |
See all releases |
Code changes from version 1.8.3.2 to 1.8.3.3
app/code/community/Payson/Payson/Helper/Api.php
CHANGED
@@ -17,7 +17,7 @@ class Payson_Payson_Helper_Api {
|
|
17 |
const PAY_FORWARD_URL = '%s://%s%s.payson.%s/paySecure/';
|
18 |
const APPLICATION_ID = 'Magento';
|
19 |
const MODULE_NAME = 'Payson_AllinOne';
|
20 |
-
const MODULE_VERSION = '1.8.3.
|
21 |
const DEBUG_MODE_MAIL = 'testagent-1@payson.se';
|
22 |
const DEBUG_MODE_AGENT_ID = '4';
|
23 |
const DEBUG_MODE_MD5 = '2acab30d-fe50-426f-90d7-8c60a7eb31d4';
|
@@ -184,20 +184,40 @@ class Payson_Payson_Helper_Api {
|
|
184 |
* @param int $total
|
185 |
* @return array
|
186 |
*/
|
187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
/* @var $product Mage_Catalog_Model_Product */
|
189 |
$product = Mage::getModel('catalog/product')
|
190 |
->load($item->getProductId());
|
191 |
|
192 |
$attributesString = "";
|
|
|
|
|
|
|
|
|
193 |
|
194 |
if (($children = $item->getChildrenItems()) != null && !$product->isConfigurable()) {
|
195 |
$args = array();
|
196 |
-
$
|
|
|
|
|
|
|
|
|
197 |
foreach ($children as $child) {
|
198 |
-
$this->prepareOrderItemData($child, $total);
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
}
|
200 |
-
return;
|
201 |
}
|
202 |
|
203 |
$productOptions = $item->getProductOptions();
|
@@ -214,7 +234,6 @@ class Payson_Payson_Helper_Api {
|
|
214 |
|
215 |
$name = $item->getName() . ($attributesString != "" ? " - " . $attributesString : "");
|
216 |
$sku = $item->getSku();
|
217 |
-
|
218 |
$tax_mod = (float) $item->getTaxPercent();
|
219 |
$tax_mod /= 100;
|
220 |
$tax_mod = round($tax_mod, 5);
|
@@ -457,8 +476,9 @@ class Payson_Payson_Helper_Api {
|
|
457 |
|
458 |
// Calculate price of each item in the order
|
459 |
$total = 0;
|
|
|
460 |
foreach ($order->getAllVisibleItems() as $item) {
|
461 |
-
$this->prepareOrderItemData($item, $total);
|
462 |
}
|
463 |
|
464 |
$productItems = $this->generateProductDataForPayson($args);
|
@@ -466,20 +486,21 @@ class Payson_Payson_Helper_Api {
|
|
466 |
if ($this->getStoreCountry() == 'SE' && $customerCountry == 'SE' && $this->vatDiscount() == 'true') {
|
467 |
|
468 |
foreach ($order->getAllVisibleItems() as $item) {
|
|
|
469 |
$this->setSwedishDiscountItem($item, $total, $productItems, $order);
|
470 |
}
|
471 |
if ($this->order_discount_item > 0) {
|
472 |
switch ($this->getDiscountType()) {
|
473 |
case Mage_SalesRule_Model_Rule::BY_PERCENT_ACTION:
|
474 |
case Mage_SalesRule_Model_Rule::TO_PERCENT_ACTION:
|
475 |
-
$this->prepareProductData('
|
476 |
break;
|
477 |
case Mage_SalesRule_Model_Rule::BY_FIXED_ACTION:
|
478 |
$specialDiscount = $this->order_discount_item / $this->getNumberOfItems();
|
479 |
-
$this->prepareProductData('
|
480 |
break;
|
481 |
default:
|
482 |
-
$this->prepareProductData('
|
483 |
break;
|
484 |
}
|
485 |
}
|
@@ -487,12 +508,13 @@ class Payson_Payson_Helper_Api {
|
|
487 |
|
488 |
foreach ($order->getAllVisibleItems() as $item) {
|
489 |
$this->setInternationalDiscountItem($item, $total);
|
490 |
-
}
|
|
|
491 |
if ($this->order_discount_item > 0) {
|
492 |
$this->prepareProductData('discount', 'discount', 1, -$this->order_discount_item, 0.0);
|
493 |
}
|
494 |
}
|
495 |
-
|
496 |
// Calculate price for shipping
|
497 |
$this->prepareOrderShippingData($order, $customer, $store, $total);
|
498 |
$args = $this->generateProductDataForPayson($args);
|
17 |
const PAY_FORWARD_URL = '%s://%s%s.payson.%s/paySecure/';
|
18 |
const APPLICATION_ID = 'Magento';
|
19 |
const MODULE_NAME = 'Payson_AllinOne';
|
20 |
+
const MODULE_VERSION = '1.8.3.3';
|
21 |
const DEBUG_MODE_MAIL = 'testagent-1@payson.se';
|
22 |
const DEBUG_MODE_AGENT_ID = '4';
|
23 |
const DEBUG_MODE_MD5 = '2acab30d-fe50-426f-90d7-8c60a7eb31d4';
|
184 |
* @param int $total
|
185 |
* @return array
|
186 |
*/
|
187 |
+
private function getProductOptions($id) {
|
188 |
+
$product = new Mage_Catalog_Model_Product();
|
189 |
+
$product->load($id);
|
190 |
+
$product->getTypeInstance(true)->setStoreFilter(Mage::app()->getStore(), $product);
|
191 |
+
return $product;
|
192 |
+
|
193 |
+
}
|
194 |
+
private function prepareOrderItemData($item, &$total, $order) {
|
195 |
/* @var $product Mage_Catalog_Model_Product */
|
196 |
$product = Mage::getModel('catalog/product')
|
197 |
->load($item->getProductId());
|
198 |
|
199 |
$attributesString = "";
|
200 |
+
$quoteItems = Mage::getModel('sales/quote_item')->getCollection();
|
201 |
+
$quoteItems->addFieldToFilter('quote_id', $order->quote_id);
|
202 |
+
$quoteItems->addFieldToFilter('product_type', 'bundle');
|
203 |
+
|
204 |
|
205 |
if (($children = $item->getChildrenItems()) != null && !$product->isConfigurable()) {
|
206 |
$args = array();
|
207 |
+
$product = $this->getProductOptions($item->getProductId());
|
208 |
+
|
209 |
+
if ($item->getProductType() != 'bundle'||$product->getPriceType() == Mage_Bundle_Model_Product_Price::PRICE_TYPE_DYNAMIC) {
|
210 |
+
$this->prepareProductData($item->getName(), $item->getSku(), $item->getQtyOrdered(), 0, 0);
|
211 |
+
}
|
212 |
foreach ($children as $child) {
|
213 |
+
$this->prepareOrderItemData($child, $total, $order);
|
214 |
+
}
|
215 |
+
//checks if there are bundles items is present and if it is dynamic
|
216 |
+
if (($quoteItems->getSize() < 1)) {
|
217 |
+
return;
|
218 |
+
} elseif ($product->getPriceType() == Mage_Bundle_Model_Product_Price::PRICE_TYPE_DYNAMIC && $item->getProductType() == 'bundle') {
|
219 |
+
return;
|
220 |
}
|
|
|
221 |
}
|
222 |
|
223 |
$productOptions = $item->getProductOptions();
|
234 |
|
235 |
$name = $item->getName() . ($attributesString != "" ? " - " . $attributesString : "");
|
236 |
$sku = $item->getSku();
|
|
|
237 |
$tax_mod = (float) $item->getTaxPercent();
|
238 |
$tax_mod /= 100;
|
239 |
$tax_mod = round($tax_mod, 5);
|
476 |
|
477 |
// Calculate price of each item in the order
|
478 |
$total = 0;
|
479 |
+
|
480 |
foreach ($order->getAllVisibleItems() as $item) {
|
481 |
+
$this->prepareOrderItemData($item, $total, $order);
|
482 |
}
|
483 |
|
484 |
$productItems = $this->generateProductDataForPayson($args);
|
486 |
if ($this->getStoreCountry() == 'SE' && $customerCountry == 'SE' && $this->vatDiscount() == 'true') {
|
487 |
|
488 |
foreach ($order->getAllVisibleItems() as $item) {
|
489 |
+
|
490 |
$this->setSwedishDiscountItem($item, $total, $productItems, $order);
|
491 |
}
|
492 |
if ($this->order_discount_item > 0) {
|
493 |
switch ($this->getDiscountType()) {
|
494 |
case Mage_SalesRule_Model_Rule::BY_PERCENT_ACTION:
|
495 |
case Mage_SalesRule_Model_Rule::TO_PERCENT_ACTION:
|
496 |
+
$this->prepareProductData('Rabatt inkl moms', 'Rabatt', 1, -$this->order_discount_item, $this->getAverageVat());
|
497 |
break;
|
498 |
case Mage_SalesRule_Model_Rule::BY_FIXED_ACTION:
|
499 |
$specialDiscount = $this->order_discount_item / $this->getNumberOfItems();
|
500 |
+
$this->prepareProductData('Rabatt inkl moms', 'Rabatt', $this->getNumberOfItems(), -$specialDiscount, $this->getAverageVat());
|
501 |
break;
|
502 |
default:
|
503 |
+
$this->prepareProductData('Rabatt inkl moms', 'Rabatt', 1, -$this->order_discount_item, $this->getAverageVat());
|
504 |
break;
|
505 |
}
|
506 |
}
|
508 |
|
509 |
foreach ($order->getAllVisibleItems() as $item) {
|
510 |
$this->setInternationalDiscountItem($item, $total);
|
511 |
+
}
|
512 |
+
|
513 |
if ($this->order_discount_item > 0) {
|
514 |
$this->prepareProductData('discount', 'discount', 1, -$this->order_discount_item, 0.0);
|
515 |
}
|
516 |
}
|
517 |
+
//
|
518 |
// Calculate price for shipping
|
519 |
$this->prepareOrderShippingData($order, $customer, $store, $total);
|
520 |
$args = $this->generateProductDataForPayson($args);
|
app/code/community/Payson/Payson/controllers/CheckoutController.php
CHANGED
@@ -109,14 +109,16 @@ class Payson_Payson_CheckoutController extends Mage_Core_Controller_Front_Action
|
|
109 |
$paymentStatus = $paymentDetailsResponse->status;
|
110 |
$InvoiceStatus = $paymentDetailsResponse->invoiceStatus;
|
111 |
isset($InvoiceStatus) ? $InvoiceStatus : 'NONE';
|
|
|
112 |
$paymentDetails = $paymentDetailsResponse->receiverList->receiver->ToArray();
|
|
|
113 |
$new_paymentDetails = array();
|
114 |
foreach ($paymentDetails as $item) {
|
115 |
foreach ($item as $key => $value) {
|
116 |
$new_paymentDetails[$key] = $value;
|
117 |
}
|
118 |
}
|
119 |
-
|
120 |
$sendEmail = $api->confirmationEmail($order->getEntityId());
|
121 |
$investigatefee = $order['base_payson_invoice_fee'];
|
122 |
$currentAmount = $new_paymentDetails['amount'];
|
109 |
$paymentStatus = $paymentDetailsResponse->status;
|
110 |
$InvoiceStatus = $paymentDetailsResponse->invoiceStatus;
|
111 |
isset($InvoiceStatus) ? $InvoiceStatus : 'NONE';
|
112 |
+
|
113 |
$paymentDetails = $paymentDetailsResponse->receiverList->receiver->ToArray();
|
114 |
+
|
115 |
$new_paymentDetails = array();
|
116 |
foreach ($paymentDetails as $item) {
|
117 |
foreach ($item as $key => $value) {
|
118 |
$new_paymentDetails[$key] = $value;
|
119 |
}
|
120 |
}
|
121 |
+
|
122 |
$sendEmail = $api->confirmationEmail($order->getEntityId());
|
123 |
$investigatefee = $order['base_payson_invoice_fee'];
|
124 |
$currentAmount = $new_paymentDetails['amount'];
|
app/locale/sv_SE/Payson_Payson.csv
CHANGED
@@ -47,7 +47,7 @@
|
|
47 |
"Show receipt page", "Visa Kvittosidan"
|
48 |
"Here you can enable or disable our receipt page", "Använd Paysons eller Magentos kvittosida"
|
49 |
"Enable average vat on discount", "Aktivera genomsnittlig moms"
|
50 |
-
"Enable/disable average vat on discount", "Aktivera/inaktivera genomsnittlig moms"
|
51 |
|
52 |
"Payson invoice","Payson faktura"
|
53 |
"Enable/disable invoice payment with Payson.","Aktivera eller inaktivera faktura med Payson."
|
@@ -57,6 +57,7 @@
|
|
57 |
"Input an invoice fee within the intervall of 0-40 including Vat.","Välj en fakturaavgift inom intervallet 0-40 inkl moms."
|
58 |
"Invoice fee (EUR)","Fakturaavgift (EUR)"
|
59 |
"Invoice fee for EUR excluding tax.","Fakturaavgift för EUR utan moms."
|
|
|
60 |
"Enable/disable test mode.","Slå på/av testläge"
|
61 |
"Enable this to send Payson invoice to customer instantly after purchase. Disabling this means you have to mark the goods as Shipped in Admin to activate the invoice","Aktivera detta för att skicka Payson-fakturan direkt när ett köp accepterats. Stängs denna funktion av måste ordern markeras som Skickad i Magento Admin eller Payson Admin"
|
62 |
|
47 |
"Show receipt page", "Visa Kvittosidan"
|
48 |
"Here you can enable or disable our receipt page", "Använd Paysons eller Magentos kvittosida"
|
49 |
"Enable average vat on discount", "Aktivera genomsnittlig moms"
|
50 |
+
"Enable/disable average vat on discount", "Aktivera/inaktivera genomsnittlig moms för rabatter"
|
51 |
|
52 |
"Payson invoice","Payson faktura"
|
53 |
"Enable/disable invoice payment with Payson.","Aktivera eller inaktivera faktura med Payson."
|
57 |
"Input an invoice fee within the intervall of 0-40 including Vat.","Välj en fakturaavgift inom intervallet 0-40 inkl moms."
|
58 |
"Invoice fee (EUR)","Fakturaavgift (EUR)"
|
59 |
"Invoice fee for EUR excluding tax.","Fakturaavgift för EUR utan moms."
|
60 |
+
"Test mode", "Testläge"
|
61 |
"Enable/disable test mode.","Slå på/av testläge"
|
62 |
"Enable this to send Payson invoice to customer instantly after purchase. Disabling this means you have to mark the goods as Shipped in Admin to activate the invoice","Aktivera detta för att skicka Payson-fakturan direkt när ett köp accepterats. Stängs denna funktion av måste ordern markeras som Skickad i Magento Admin eller Payson Admin"
|
63 |
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Payson</name>
|
4 |
-
<version>1.8.3.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/bsd-license.php">BSD licence</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Official Payson module for Magento. </summary>
|
10 |
<description>This module integrates with Payson and allows you to charge your customers via Invoice, Card and direct bank transfers.</description>
|
11 |
-
<notes>
|
12 |
<authors><author><name>Karl Brundin</name><user>PaysonAB</user><email>integration@payson.se</email></author></authors>
|
13 |
-
<date>
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Payson"><dir name="Payson"><dir name="Block"><file name="Form.php" hash="74a8967879fbb6af999f0e513bc91323"/><dir name="Invoice"><file name="Form.php" hash="88a008948e1231b135ba8a798eeb1c66"/></dir><dir name="Order"><dir name="Totals"><file name="Fee.php" hash="3e8566e634d68d8df9bb70f597916980"/></dir></dir><dir name="Standard"><file name="Form.php" hash="c715cbec95494a9a26d261992429dff0"/></dir></dir><dir name="Helper"><dir name="Api"><dir name="Response"><file name="Interface.php" hash="51d0ffe7eefaa12eb9b4f2551e9f4259"/><dir name="Standard"><file name="Parameters.php" hash="6965b8259867c23a5e1e682e14491eb2"/></dir><file name="Standard.php" hash="cef827896629364fee49671af879adc3"/><file name="Validate.php" hash="34fb6626af3a6ac06e987c9e10a95796"/></dir></dir><file name="Api.php" hash="
|
16 |
<compatible/>
|
17 |
-
<dependencies><required><php><min>5.3.0</min><max>5.5.
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Payson</name>
|
4 |
+
<version>1.8.3.3</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/bsd-license.php">BSD licence</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Official Payson module for Magento. </summary>
|
10 |
<description>This module integrates with Payson and allows you to charge your customers via Invoice, Card and direct bank transfers.</description>
|
11 |
+
<notes>Resolved an issue that bundle products with fixed price are forwarded correctly</notes>
|
12 |
<authors><author><name>Karl Brundin</name><user>PaysonAB</user><email>integration@payson.se</email></author></authors>
|
13 |
+
<date>2016-04-26</date>
|
14 |
+
<time>13:56:29</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Payson"><dir name="Payson"><dir name="Block"><file name="Form.php" hash="74a8967879fbb6af999f0e513bc91323"/><dir name="Invoice"><file name="Form.php" hash="88a008948e1231b135ba8a798eeb1c66"/></dir><dir name="Order"><dir name="Totals"><file name="Fee.php" hash="3e8566e634d68d8df9bb70f597916980"/></dir></dir><dir name="Standard"><file name="Form.php" hash="c715cbec95494a9a26d261992429dff0"/></dir></dir><dir name="Helper"><dir name="Api"><dir name="Response"><file name="Interface.php" hash="51d0ffe7eefaa12eb9b4f2551e9f4259"/><dir name="Standard"><file name="Parameters.php" hash="6965b8259867c23a5e1e682e14491eb2"/></dir><file name="Standard.php" hash="cef827896629364fee49671af879adc3"/><file name="Validate.php" hash="34fb6626af3a6ac06e987c9e10a95796"/></dir></dir><file name="Api.php" hash="f01b5a48e1094dd4e81627a5a6fe1eb5"/><file name="Data.php" hash="83ff59b1588c0b0ff8d2f7341589ea59"/><file name="FundingConstraint.php" hash="7acf2b5d8c045237aeff6566cd55cca1"/></dir><dir name="Model"><file name="Config.php" hash="7de7a2257df64a5e039de977edbc5492"/><dir name="Method"><file name="Abstract.php" hash="be7d3c5b1aa580761a3c1e75ce5c789b"/><file name="Invoice.php" hash="0b6bce918e80b82b5a5deacdea313ec4"/><file name="Standard.php" hash="136579912fb4971ebd2279d29a85afc3"/></dir><dir name="Mysql4"><file name="Setup.php" hash="3075fa047af3d56d6eac609004e6e1cc"/></dir><dir name="Order"><dir name="Creditmemo"><dir name="Total"><file name="Invoice.php" hash="19fadd6df40cd03528fb9c211c34a8bc"/></dir></dir><dir name="Invoice"><dir name="Total"><file name="Invoice.php" hash="ca74fb558ac69d9325bcbfe839f89b3e"/><file name="Invoice.php.bak" hash="c4f70fbac9ca770483e23f859629fd85"/></dir></dir></dir><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Invoice.php" hash="44eef552e2dd3869c3181f3f939ac355"/></dir></dir></dir><file name="Standard.php" hash="233cf9d7ebe15137d98a8e1b23125a51"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Paysondirectmethod.php" hash="5f0a8584217204a638d11dbf61891779"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="ShipmentController.php" hash="e0c38e9e299483b4dcc01c7da06241be"/></dir></dir></dir><file name="CheckoutController.php" hash="6fbeeb90ee38a3aacc7b457c452eebc0"/><file name="IpnController.php" hash="e7b092cdd0011a3a1359a084bbaf14ad"/></dir><dir name="etc"><file name="config.xml" hash="d4f126578e993c4d08d046defb81fffa"/><file name="system.xml" hash="a7fde5c7fe65587feb71820074400dbe"/></dir><dir name="sql"><dir name="payson_setup"><file name="mysql4-install-0.1.0.php" hash="21cd9fd3436ba1eb2fc20eaaadb42106"/><file name="mysql4-upgrade-0.1.0-0.1.2.php" hash="5bbcb930748e3a87a220c0e9f8448a15"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="Payson.xml" hash="1ace2a646cd9a33521e7b392b6c5f3f1"/></dir><dir name="template"><dir name="Payson"><dir name="Payson"><file name="total.phtml" hash="73984e3bd27f5cd1d67550471e4e3da2"/></dir></dir></dir><dir name="Payson"><dir name="Payson"><file name="total.phtml" hash="e05160dad39cd2cbf86decc34fb8d225"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="Payson.xml" hash="22b9b9ae0cc9b1c70f79d690fbb4db41"/></dir><dir name="template"><dir name="Payson"><dir name="Payson"><file name="standard_form.phtml" hash="23c387ef94322de355e00f1a49e243d4"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Payson_Payson.xml" hash="6bfec3c27e23c2fe4862b7a91d5da651"/></dir></target><target name="magelocale"><dir name="sv_SE"><file name="Payson_Payson.csv" hash="a83325bfdbfd4bdf330deb2a77c6ed9f"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="Payson"><dir name="Payson"><file name="Allinone.png" hash="3c703b6bd292ce2c95ac83cfdb735061"/><file name="Allinone3.png" hash="a94be17f996c1f4adbda35747e188cd5"/><file name="payson.gif" hash="638d0055cbc1a4bdc32e9fa1156b722a"/><file name="payson.png" hash="a80f29596b9af3a6ee95c011bd95f65a"/><file name="payson_faktura.png" hash="fa218c9949c05c6f3452d9f4c541da2c"/></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.3.0</min><max>5.5.9</max></php></required></dependencies>
|
18 |
</package>
|