Version Notes
Enhanced validation if order confirmation letter has been sent out or not. The order confirmation letter will now be sent at both IPN and upon the customers return to the store, whichever arrives first. An improvement has been made on how the module handle discount with Swedish vat rules.
Download this release
Release Info
Developer | Oscar Villegas |
Extension | Payson |
Version | 1.8.3.2 |
Comparing to | |
See all releases |
Code changes from version 1.8.3.1 to 1.8.3.2
- app/code/community/Payson/Payson/Helper/Api.php +156 -72
- app/code/community/Payson/Payson/Model/Method/Invoice.php +12 -7
- app/code/community/Payson/Payson/Model/Order/Invoice/Total/Invoice.php +8 -8
- app/code/community/Payson/Payson/Model/Order/Invoice/Total/Invoice.php.bak +48 -0
- app/code/community/Payson/Payson/controllers/Adminhtml/Sales/Order/ShipmentController.php +3 -3
- app/code/community/Payson/Payson/controllers/CheckoutController.php +21 -3
- app/code/community/Payson/Payson/etc/system.xml +10 -0
- app/etc/modules/Payson_Payson.xml +1 -1
- app/locale/sv_SE/Payson_Payson.csv +13 -3
- package.xml +7 -7
- skin/frontend/base/default/Payson/Payson/Allinone.png +0 -0
- skin/frontend/base/default/Payson/Payson/Allinone3.png +0 -0
- skin/frontend/base/default/Payson/Payson/payson.png +0 -0
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';
|
@@ -64,6 +64,9 @@ class Payson_Payson_Helper_Api {
|
|
64 |
/*
|
65 |
* Private properties
|
66 |
*/
|
|
|
|
|
|
|
67 |
private $_order = null;
|
68 |
private $response;
|
69 |
private $order_discount_item = 0.0;
|
@@ -80,6 +83,7 @@ class Payson_Payson_Helper_Api {
|
|
80 |
public function __construct() {
|
81 |
$this->_config = Mage::getModel('payson/config');
|
82 |
$this->_helper = Mage::helper('payson');
|
|
|
83 |
}
|
84 |
|
85 |
private function getHttpClient($url) {
|
@@ -106,7 +110,69 @@ class Payson_Payson_Helper_Api {
|
|
106 |
return $this;
|
107 |
}
|
108 |
|
109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
$total -= $item->getDiscountAmount();
|
111 |
$this->order_discount_item += $item->getDiscountAmount();
|
112 |
}
|
@@ -184,6 +250,7 @@ class Payson_Payson_Helper_Api {
|
|
184 |
);
|
185 |
$args += $productData;
|
186 |
}
|
|
|
187 |
return $args;
|
188 |
}
|
189 |
|
@@ -209,7 +276,6 @@ class Payson_Payson_Helper_Api {
|
|
209 |
$tax_rate_req = $tax_calc->getRateRequest(
|
210 |
$order->getShippingAddress(), $order->getBillingAddress(), $customer->getTaxClassId(), $store);
|
211 |
|
212 |
-
|
213 |
if (($price = (float) $order->getShippingInclTax()) > 0) {
|
214 |
$tax_mod = $tax_calc->getRate($tax_rate_req->setProductClassId(
|
215 |
Mage::getStoreConfig('tax/classes/shipping_tax_class')));
|
@@ -265,7 +331,17 @@ class Payson_Payson_Helper_Api {
|
|
265 |
return $reciept2;
|
266 |
}
|
267 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
268 |
public function Pay(Mage_Sales_Model_Order $order) {
|
|
|
269 |
$payment_method = $order->getPayment()->getMethod();
|
270 |
|
271 |
/* @var $store Mage_Core_Model_Store */
|
@@ -274,10 +350,11 @@ class Payson_Payson_Helper_Api {
|
|
274 |
->load($order->getCustomerId());
|
275 |
$billing_address = $order->getBillingAddress();
|
276 |
|
277 |
-
// Need a two character locale code
|
278 |
$locale_code = Mage::getSingleton('core/locale')->getLocaleCode();
|
279 |
$locale_code = strtoupper(substr($locale_code, 0, 2));
|
280 |
|
|
|
281 |
if (!in_array($locale_code, array('SV', 'FI', 'EN'))) {
|
282 |
switch ($locale_code) {
|
283 |
case 'DA':
|
@@ -370,9 +447,12 @@ class Payson_Payson_Helper_Api {
|
|
370 |
$payment = $newArray;
|
371 |
}
|
372 |
}
|
373 |
-
|
|
|
|
|
|
|
374 |
$output = array();
|
375 |
-
FundingConstraint::addConstraintsToOutput($
|
376 |
$args = array_merge($args, $output);
|
377 |
|
378 |
// Calculate price of each item in the order
|
@@ -381,13 +461,38 @@ class Payson_Payson_Helper_Api {
|
|
381 |
$this->prepareOrderItemData($item, $total);
|
382 |
}
|
383 |
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
|
388 |
-
|
389 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
390 |
}
|
|
|
391 |
// Calculate price for shipping
|
392 |
$this->prepareOrderShippingData($order, $customer, $store, $total);
|
393 |
$args = $this->generateProductDataForPayson($args);
|
@@ -403,7 +508,21 @@ class Payson_Payson_Helper_Api {
|
|
403 |
}
|
404 |
}
|
405 |
$roundedTotal = round($total, 2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
406 |
|
|
|
|
|
|
|
|
|
|
|
407 |
$args['receiverList.receiver(0).amount'] = $roundedTotal;
|
408 |
|
409 |
$url = vsprintf(self::API_CALL_PAY, $this->getFormatIfTest($order->getStoreId()));
|
@@ -497,12 +616,22 @@ class Payson_Payson_Helper_Api {
|
|
497 |
* @param string $content_type
|
498 |
* @return object $this
|
499 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
500 |
public function Validate($http_body, $content_type) {
|
501 |
|
502 |
// Parse request done by Payson to our IPN controller
|
503 |
$ipn_response = Payson_Payson_Helper_Api_Response_Standard
|
504 |
::FromHttpBody($http_body);
|
505 |
-
|
506 |
// Get the database connection
|
507 |
$resource = Mage::getSingleton('core/resource');
|
508 |
$db = $resource->getConnection('core_write');
|
@@ -589,7 +718,7 @@ LIMIT
|
|
589 |
if ($order->getState() === Mage_Sales_Model_Order::STATE_COMPLETE) {
|
590 |
Mage::throwException('Order is no longer active');
|
591 |
}
|
592 |
-
|
593 |
$receivers = $ipn_response->receiverList->receiver->ToArray();
|
594 |
$investigatefee = $order['base_payson_invoice_fee'];
|
595 |
|
@@ -607,6 +736,9 @@ LIMIT
|
|
607 |
switch ($ipn_response->status) {
|
608 |
case self::STATUS_COMPLETED: {
|
609 |
//Changes the status of the order from pending_payment to processing
|
|
|
|
|
|
|
610 |
$order->setState(
|
611 |
Mage_Sales_Model_Order::STATE_PROCESSING, Mage_Sales_Model_Order::STATE_PROCESSING, $this->_config->get('test_mode') ? $this->_helper->__('Payson test completed the order payment') : $this->_helper->__('Payson completed the order payment'));
|
612 |
$order['payson_invoice_fee'] = 0;
|
@@ -630,6 +762,9 @@ LIMIT
|
|
630 |
($ipn_response->type === self::PAYMENT_METHOD_INVOICE) &&
|
631 |
($ipn_response->invoiceStatus ===
|
632 |
self::INVOICE_STATUS_ORDERCREATED)) {
|
|
|
|
|
|
|
633 |
//Changes the status of the order from pending to processing
|
634 |
$order->setState(
|
635 |
Mage_Sales_Model_Order::STATE_PROCESSING, Mage_Sales_Model_Order::STATE_PROCESSING, $this->_config->get('test_mode') ? $this->_helper->__('Payson test created an invoice') : $this->_helper->__('Payson created an invoice'));
|
@@ -639,7 +774,6 @@ LIMIT
|
|
639 |
$order->save();
|
640 |
|
641 |
|
642 |
-
|
643 |
if (isset($ipn_response->shippingAddress)) {
|
644 |
$address_info = $ipn_response->shippingAddress
|
645 |
->ToArray();
|
@@ -978,47 +1112,6 @@ LIMIT
|
|
978 |
return $this;
|
979 |
}
|
980 |
|
981 |
-
/**
|
982 |
-
* http://api.payson.se/#title12
|
983 |
-
*
|
984 |
-
* @params int $order_id Real order id
|
985 |
-
* @return object $this
|
986 |
-
*
|
987 |
-
* $increment_id = $this->getSession()->getData('last_real_order_id');
|
988 |
-
|
989 |
-
if ($increment_id) {
|
990 |
-
$this->_order = Mage::getModel('sales/order')->loadByIncrementId($increment_id)
|
991 |
-
*
|
992 |
-
*
|
993 |
-
*/
|
994 |
-
// private function getOrder($order_id) {
|
995 |
-
//
|
996 |
-
// $increment_id = $order_id + 100000000;
|
997 |
-
// $this->_order = Mage::getModel('sales/order')->loadByIncrementId($increment_id);
|
998 |
-
//
|
999 |
-
// if (is_null($this->_order->getId())) {
|
1000 |
-
// $this->_order = null;
|
1001 |
-
// }
|
1002 |
-
//
|
1003 |
-
//
|
1004 |
-
// return $this->_order;
|
1005 |
-
// }
|
1006 |
-
|
1007 |
-
// private function cancelOrder($message, $order_id) {
|
1008 |
-
//
|
1009 |
-
// $order = $this->getOrder();
|
1010 |
-
// if (!is_null($order = $this->getOrder($order_id))) {
|
1011 |
-
// $order->cancel();
|
1012 |
-
//
|
1013 |
-
// if ($message != '') {
|
1014 |
-
// $order->addStatusHistoryComment($message);
|
1015 |
-
// }
|
1016 |
-
// }
|
1017 |
-
// $order->save();
|
1018 |
-
// return $this;
|
1019 |
-
// }
|
1020 |
-
|
1021 |
-
|
1022 |
public function PaymentDetails($order_id) {
|
1023 |
|
1024 |
// Get the database connection
|
@@ -1076,26 +1169,26 @@ LIMIT
|
|
1076 |
'valid' => (int) $response->IsValid(),
|
1077 |
'response' => serialize($response->ToArray())
|
1078 |
));
|
1079 |
-
|
1080 |
$payson_validator = $db->fetchRow(
|
1081 |
-
|
1082 |
if ((!$response->IsValid()) && ($payson_validator->ipn_status == NULL && $payson_validator->token == NULL)) {
|
|
|
1083 |
$sales_flat_order = 'sales_flat_order';
|
1084 |
-
if($order_id !== null&& $payson_order !== false){
|
1085 |
-
|
1086 |
-
$db->update($sales_flat_order, array('state'=>'canceled', 'status'=>'canceled'), array('entity_id = ?' => $new_order_id));
|
1087 |
}
|
1088 |
}
|
1089 |
|
1090 |
if (!$response->IsValid()) {
|
1091 |
-
$redirectUrl= Mage::getUrl('checkout/cart');
|
1092 |
Mage::getSingleton('checkout/session')->setRedirectUrl($redirectUrl);
|
1093 |
-
|
1094 |
}
|
1095 |
|
1096 |
return $this;
|
1097 |
}
|
1098 |
-
|
1099 |
/**
|
1100 |
* http://api.payson.se/#title13
|
1101 |
*
|
@@ -1165,14 +1258,6 @@ LIMIT
|
|
1165 |
'response' => serialize($response->ToArray())
|
1166 |
));
|
1167 |
|
1168 |
-
/* if(!$response->IsValid())
|
1169 |
-
{
|
1170 |
-
// TODO: don't seem to return an errorList
|
1171 |
-
throw new Mage_Core_Exception(sprintf($this->_helper->__(
|
1172 |
-
'Failed to update payment. Payson replied: %s'),
|
1173 |
-
$response->GetError()), $response->GetErrorId());
|
1174 |
-
} */
|
1175 |
-
|
1176 |
return $this;
|
1177 |
}
|
1178 |
|
@@ -1193,7 +1278,6 @@ LIMIT
|
|
1193 |
array_push($stack, self::DEBUG_MODE ? "Payment" : "1.0");
|
1194 |
|
1195 |
array_push($stack, self::DEBUG_MODE ? "" : "Payment");
|
1196 |
-
//print_r($stack);
|
1197 |
return $stack;
|
1198 |
}
|
1199 |
|
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.2';
|
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';
|
64 |
/*
|
65 |
* Private properties
|
66 |
*/
|
67 |
+
private $discountType;
|
68 |
+
private $numberofItems;
|
69 |
+
private $discountVat = 0.0;
|
70 |
private $_order = null;
|
71 |
private $response;
|
72 |
private $order_discount_item = 0.0;
|
83 |
public function __construct() {
|
84 |
$this->_config = Mage::getModel('payson/config');
|
85 |
$this->_helper = Mage::helper('payson');
|
86 |
+
$this->_invoice = Mage::getModel('payson/method/invoice');
|
87 |
}
|
88 |
|
89 |
private function getHttpClient($url) {
|
110 |
return $this;
|
111 |
}
|
112 |
|
113 |
+
//Private functions for Swedish discount and vat calculations
|
114 |
+
private function setAverageVat($vat) {
|
115 |
+
$this->discountVat = $vat;
|
116 |
+
}
|
117 |
+
|
118 |
+
private function getAverageVat() {
|
119 |
+
return $this->discountVat;
|
120 |
+
}
|
121 |
+
|
122 |
+
private function setDiscountType($type) {
|
123 |
+
$this->discountType = $type;
|
124 |
+
}
|
125 |
+
|
126 |
+
private function getDiscountType() {
|
127 |
+
return $this->discountType;
|
128 |
+
}
|
129 |
+
|
130 |
+
private function setNumberOfItems($items) {
|
131 |
+
$this->numberofItems = $items;
|
132 |
+
}
|
133 |
+
|
134 |
+
private function getNumberOfItems() {
|
135 |
+
return $this->numberofItems;
|
136 |
+
}
|
137 |
+
|
138 |
+
private function getStoreCountry() {
|
139 |
+
$countryCode = Mage::getStoreConfig('general/country/default');
|
140 |
+
$country = Mage::getModel('directory/country')->loadByCode($countryCode);
|
141 |
+
return $country->country_id;
|
142 |
+
}
|
143 |
+
|
144 |
+
private function setSwedishDiscountItem($item, &$total, $orderitems, $order) {
|
145 |
+
|
146 |
+
/*
|
147 |
+
* Discount types $item->getAppliedRuleIds():
|
148 |
+
* Fixed discount amount for the entire cart
|
149 |
+
* Precentage discount for the entire cart
|
150 |
+
* Fixed discount amount for each article in cart
|
151 |
+
*/
|
152 |
+
$rule = Mage::getModel('salesrule/rule')->load($item->getAppliedRuleIds());
|
153 |
+
$total -= $item->getDiscountAmount();
|
154 |
+
$numberOfItem = floor($order->getData('total_qty_ordered'));
|
155 |
+
$items = 0;
|
156 |
+
|
157 |
+
$discountAmount = $item->getDiscountAmount();
|
158 |
+
for ($i = 0; $i <= $numberOfItem; $i++) {
|
159 |
+
$orderVat = $orderitems['orderItemList.orderItem(' . $i . ').taxPercentage'];
|
160 |
+
$moms += $orderVat;
|
161 |
+
//counting number of tax rows that is not zero
|
162 |
+
if ($orderVat != 0) {
|
163 |
+
$items++;
|
164 |
+
}
|
165 |
+
}
|
166 |
+
$this->setNumberOfItems($numberOfItem);
|
167 |
+
$this->setDiscountType($rule->simple_action);
|
168 |
+
$totalMoms = $moms / $items;
|
169 |
+
|
170 |
+
$this->setAverageVat($totalMoms);
|
171 |
+
|
172 |
+
$this->order_discount_item += $discountAmount;
|
173 |
+
}
|
174 |
+
|
175 |
+
private function setInternationalDiscountItem($item, &$total) {
|
176 |
$total -= $item->getDiscountAmount();
|
177 |
$this->order_discount_item += $item->getDiscountAmount();
|
178 |
}
|
250 |
);
|
251 |
$args += $productData;
|
252 |
}
|
253 |
+
|
254 |
return $args;
|
255 |
}
|
256 |
|
276 |
$tax_rate_req = $tax_calc->getRateRequest(
|
277 |
$order->getShippingAddress(), $order->getBillingAddress(), $customer->getTaxClassId(), $store);
|
278 |
|
|
|
279 |
if (($price = (float) $order->getShippingInclTax()) > 0) {
|
280 |
$tax_mod = $tax_calc->getRate($tax_rate_req->setProductClassId(
|
281 |
Mage::getStoreConfig('tax/classes/shipping_tax_class')));
|
331 |
return $reciept2;
|
332 |
}
|
333 |
|
334 |
+
public function vatDiscount() {
|
335 |
+
$inputValue = (int) $this->_config->Get('vat_discount');
|
336 |
+
$enableVatDiscount = 'false';
|
337 |
+
if ($inputValue === 1) {
|
338 |
+
$enableVatDiscount = 'true';
|
339 |
+
}
|
340 |
+
return $enableVatDiscount;
|
341 |
+
}
|
342 |
+
|
343 |
public function Pay(Mage_Sales_Model_Order $order) {
|
344 |
+
|
345 |
$payment_method = $order->getPayment()->getMethod();
|
346 |
|
347 |
/* @var $store Mage_Core_Model_Store */
|
350 |
->load($order->getCustomerId());
|
351 |
$billing_address = $order->getBillingAddress();
|
352 |
|
353 |
+
// Need a two character locale code. This collects the store chosen language
|
354 |
$locale_code = Mage::getSingleton('core/locale')->getLocaleCode();
|
355 |
$locale_code = strtoupper(substr($locale_code, 0, 2));
|
356 |
|
357 |
+
|
358 |
if (!in_array($locale_code, array('SV', 'FI', 'EN'))) {
|
359 |
switch ($locale_code) {
|
360 |
case 'DA':
|
447 |
$payment = $newArray;
|
448 |
}
|
449 |
}
|
450 |
+
|
451 |
+
$result = (!isset($payment)) ? $payment = '' : $payment;
|
452 |
+
|
453 |
+
define("PMETHOD", serialize($result));
|
454 |
$output = array();
|
455 |
+
FundingConstraint::addConstraintsToOutput($result, $output);
|
456 |
$args = array_merge($args, $output);
|
457 |
|
458 |
// Calculate price of each item in the order
|
461 |
$this->prepareOrderItemData($item, $total);
|
462 |
}
|
463 |
|
464 |
+
$productItems = $this->generateProductDataForPayson($args);
|
465 |
+
$customerCountry = $order->getBillingAddress()->country_id;
|
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('discount', 'discount', 1, -$this->order_discount_item, $this->getAverageVat());
|
476 |
+
break;
|
477 |
+
case Mage_SalesRule_Model_Rule::BY_FIXED_ACTION:
|
478 |
+
$specialDiscount = $this->order_discount_item / $this->getNumberOfItems();
|
479 |
+
$this->prepareProductData('discount', 'discount', $this->getNumberOfItems(), -$specialDiscount, $this->getAverageVat());
|
480 |
+
break;
|
481 |
+
default:
|
482 |
+
$this->prepareProductData('discount', 'discount', 1, -$this->order_discount_item, $this->getAverageVat());
|
483 |
+
break;
|
484 |
+
}
|
485 |
+
}
|
486 |
+
} else {
|
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);
|
508 |
}
|
509 |
}
|
510 |
$roundedTotal = round($total, 2);
|
511 |
+
if ($this->getStoreCountry() == 'SE' && $customerCountry == 'SE' && $this->vatDiscount() == 'true') {
|
512 |
+
if ($this->order_discount_item > 0) {
|
513 |
+
switch ($this->getDiscountType()) {
|
514 |
+
case Mage_SalesRule_Model_Rule::BY_PERCENT_ACTION:
|
515 |
+
case Mage_SalesRule_Model_Rule::TO_PERCENT_ACTION:
|
516 |
+
case Mage_SalesRule_Model_Rule::BY_FIXED_ACTION:
|
517 |
+
case Mage_SalesRule_Model_Rule::CART_FIXED_ACTION:
|
518 |
+
$roundedTotal = $roundedTotal - ($this->order_discount_item * $this->getAverageVat());
|
519 |
+
break;
|
520 |
|
521 |
+
default:
|
522 |
+
break;
|
523 |
+
}
|
524 |
+
}
|
525 |
+
}
|
526 |
$args['receiverList.receiver(0).amount'] = $roundedTotal;
|
527 |
|
528 |
$url = vsprintf(self::API_CALL_PAY, $this->getFormatIfTest($order->getStoreId()));
|
616 |
* @param string $content_type
|
617 |
* @return object $this
|
618 |
*/
|
619 |
+
public function confirmationEmail($entityId) {
|
620 |
+
$resource = Mage::getSingleton('core/resource');
|
621 |
+
$db = $resource->getConnection('core_write');
|
622 |
+
$order_table = $resource->getTableName('sales_flat_order');
|
623 |
+
$status = $db->fetchRow(
|
624 |
+
'SELECT status FROM `' . $order_table . '` WHERE
|
625 |
+
entity_id = ? LIMIT 0,1', $entityId);
|
626 |
+
|
627 |
+
return $status;
|
628 |
+
}
|
629 |
+
|
630 |
public function Validate($http_body, $content_type) {
|
631 |
|
632 |
// Parse request done by Payson to our IPN controller
|
633 |
$ipn_response = Payson_Payson_Helper_Api_Response_Standard
|
634 |
::FromHttpBody($http_body);
|
|
|
635 |
// Get the database connection
|
636 |
$resource = Mage::getSingleton('core/resource');
|
637 |
$db = $resource->getConnection('core_write');
|
718 |
if ($order->getState() === Mage_Sales_Model_Order::STATE_COMPLETE) {
|
719 |
Mage::throwException('Order is no longer active');
|
720 |
}
|
721 |
+
$sendEmail = $this->confirmationEmail($order->getEntityId());
|
722 |
$receivers = $ipn_response->receiverList->receiver->ToArray();
|
723 |
$investigatefee = $order['base_payson_invoice_fee'];
|
724 |
|
736 |
switch ($ipn_response->status) {
|
737 |
case self::STATUS_COMPLETED: {
|
738 |
//Changes the status of the order from pending_payment to processing
|
739 |
+
if ($sendEmail['status'] == 'pending_payment') {
|
740 |
+
$order->sendNewOrderEmail()->save();
|
741 |
+
}
|
742 |
$order->setState(
|
743 |
Mage_Sales_Model_Order::STATE_PROCESSING, Mage_Sales_Model_Order::STATE_PROCESSING, $this->_config->get('test_mode') ? $this->_helper->__('Payson test completed the order payment') : $this->_helper->__('Payson completed the order payment'));
|
744 |
$order['payson_invoice_fee'] = 0;
|
762 |
($ipn_response->type === self::PAYMENT_METHOD_INVOICE) &&
|
763 |
($ipn_response->invoiceStatus ===
|
764 |
self::INVOICE_STATUS_ORDERCREATED)) {
|
765 |
+
if ($sendEmail['status'] == 'pending_payment') {
|
766 |
+
$order->sendNewOrderEmail()->save();
|
767 |
+
}
|
768 |
//Changes the status of the order from pending to processing
|
769 |
$order->setState(
|
770 |
Mage_Sales_Model_Order::STATE_PROCESSING, Mage_Sales_Model_Order::STATE_PROCESSING, $this->_config->get('test_mode') ? $this->_helper->__('Payson test created an invoice') : $this->_helper->__('Payson created an invoice'));
|
774 |
$order->save();
|
775 |
|
776 |
|
|
|
777 |
if (isset($ipn_response->shippingAddress)) {
|
778 |
$address_info = $ipn_response->shippingAddress
|
779 |
->ToArray();
|
1112 |
return $this;
|
1113 |
}
|
1114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1115 |
public function PaymentDetails($order_id) {
|
1116 |
|
1117 |
// Get the database connection
|
1169 |
'valid' => (int) $response->IsValid(),
|
1170 |
'response' => serialize($response->ToArray())
|
1171 |
));
|
1172 |
+
|
1173 |
$payson_validator = $db->fetchRow(
|
1174 |
+
'SELECT ipn_status, token FROM `' . $order_table . '` WHERE order_id = ? LIMIT 0,1', $order_id);
|
1175 |
if ((!$response->IsValid()) && ($payson_validator->ipn_status == NULL && $payson_validator->token == NULL)) {
|
1176 |
+
|
1177 |
$sales_flat_order = 'sales_flat_order';
|
1178 |
+
if ($order_id !== null && $payson_order !== false) {
|
1179 |
+
$new_order_id = Mage::getModel('sales/order')->loadByIncrementId($order_id)->getEntityId();
|
1180 |
+
$db->update($sales_flat_order, array('state' => 'canceled', 'status' => 'canceled'), array('entity_id = ?' => $new_order_id));
|
1181 |
}
|
1182 |
}
|
1183 |
|
1184 |
if (!$response->IsValid()) {
|
1185 |
+
$redirectUrl = Mage::getUrl('checkout/cart');
|
1186 |
Mage::getSingleton('checkout/session')->setRedirectUrl($redirectUrl);
|
|
|
1187 |
}
|
1188 |
|
1189 |
return $this;
|
1190 |
}
|
1191 |
+
|
1192 |
/**
|
1193 |
* http://api.payson.se/#title13
|
1194 |
*
|
1258 |
'response' => serialize($response->ToArray())
|
1259 |
));
|
1260 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1261 |
return $this;
|
1262 |
}
|
1263 |
|
1278 |
array_push($stack, self::DEBUG_MODE ? "Payment" : "1.0");
|
1279 |
|
1280 |
array_push($stack, self::DEBUG_MODE ? "" : "Payment");
|
|
|
1281 |
return $stack;
|
1282 |
}
|
1283 |
|
app/code/community/Payson/Payson/Model/Method/Invoice.php
CHANGED
@@ -26,11 +26,12 @@ class Payson_Payson_Model_Method_Invoice extends Payson_Payson_Model_Method_Abst
|
|
26 |
/**
|
27 |
* @inheritDoc
|
28 |
*/
|
29 |
-
|
30 |
-
public function capture(Varien_Object $payment, $amount) {
|
31 |
-
|
32 |
$order = $payment->getOrder();
|
33 |
-
|
|
|
|
|
|
|
34 |
$order_id = $order->getData('increment_id');
|
35 |
|
36 |
$api = Mage::helper('payson/api');
|
@@ -49,12 +50,16 @@ class Payson_Payson_Model_Method_Invoice extends Payson_Payson_Model_Method_Abst
|
|
49 |
} else {
|
50 |
Mage::throwException($helper->__('Payson is not ready to create an invoice. Please try again later.'));
|
51 |
}
|
52 |
-
|
53 |
return $this;
|
54 |
-
}
|
|
|
55 |
public function authorize(Varien_Object $payment, $amount) {
|
|
|
|
|
|
|
|
|
|
|
56 |
$payment->setTransactionId('auth')->setIsTransactionClosed(0);
|
57 |
return $this;
|
58 |
}
|
59 |
-
|
60 |
}
|
26 |
/**
|
27 |
* @inheritDoc
|
28 |
*/
|
29 |
+
public function capture(Varien_Object $payment, $amount) {
|
|
|
|
|
30 |
$order = $payment->getOrder();
|
31 |
+
$method = $order->getPayment()->getMethod();
|
32 |
+
if (($method !== 'payson_standard') || ($method == "payson_invoice")) {
|
33 |
+
return $this;
|
34 |
+
}
|
35 |
$order_id = $order->getData('increment_id');
|
36 |
|
37 |
$api = Mage::helper('payson/api');
|
50 |
} else {
|
51 |
Mage::throwException($helper->__('Payson is not ready to create an invoice. Please try again later.'));
|
52 |
}
|
|
|
53 |
return $this;
|
54 |
+
}
|
55 |
+
|
56 |
public function authorize(Varien_Object $payment, $amount) {
|
57 |
+
$order = $payment->getOrder();
|
58 |
+
$method = $order->getPayment()->getMethod();
|
59 |
+
if (($method !== 'payson_standard') || ($method == "payson_invoice")) {
|
60 |
+
return $this;
|
61 |
+
}
|
62 |
$payment->setTransactionId('auth')->setIsTransactionClosed(0);
|
63 |
return $this;
|
64 |
}
|
|
|
65 |
}
|
app/code/community/Payson/Payson/Model/Order/Invoice/Total/Invoice.php
CHANGED
@@ -2,8 +2,9 @@
|
|
2 |
|
3 |
class Payson_Payson_Model_Order_Invoice_Total_Invoice extends
|
4 |
Mage_Sales_Model_Order_Invoice_Total_Abstract {
|
5 |
-
|
6 |
protected $_code = 'payson_standard';
|
|
|
7 |
public function collect(Mage_Sales_Model_Order_Invoice $invoice) {
|
8 |
$order = $invoice->getOrder();
|
9 |
$this->_config = Mage::getModel('payson/config');
|
@@ -11,31 +12,30 @@ Mage_Sales_Model_Order_Invoice_Total_Abstract {
|
|
11 |
return $this;
|
12 |
}
|
13 |
$method = $order->getPayment()->getMethodInstance()->getCode();
|
14 |
-
if (($method !== 'payson_standard')||($method == "payson_invoice")) {
|
15 |
return $this;
|
16 |
}
|
17 |
-
if ($order->hasInvoices()
|
18 |
return $this;
|
19 |
}
|
20 |
-
|
21 |
$base_fee = $order->getBasePaysonInvoiceFee();
|
22 |
$fee = $order->getPaysonInvoiceFee();
|
23 |
|
24 |
if (!$base_fee || !$fee) {
|
25 |
return $this;
|
26 |
}
|
27 |
-
|
28 |
$base_grand_total = $invoice->getBaseGrandTotal();
|
29 |
$base_grand_total += $base_fee;
|
|
|
30 |
$grand_total = $invoice->getGrandTotal();
|
31 |
$grand_total += $fee;
|
32 |
-
|
33 |
$invoice->setBasePaysonInvoiceFee($base_fee);
|
34 |
$invoice->setPaysonInvoiceFee($fee);
|
35 |
-
|
36 |
$invoice->setBaseGrandTotal($base_grand_total);
|
37 |
$invoice->setGrandTotal($grand_total);
|
38 |
-
|
39 |
return $this;
|
40 |
}
|
41 |
|
2 |
|
3 |
class Payson_Payson_Model_Order_Invoice_Total_Invoice extends
|
4 |
Mage_Sales_Model_Order_Invoice_Total_Abstract {
|
5 |
+
|
6 |
protected $_code = 'payson_standard';
|
7 |
+
|
8 |
public function collect(Mage_Sales_Model_Order_Invoice $invoice) {
|
9 |
$order = $invoice->getOrder();
|
10 |
$this->_config = Mage::getModel('payson/config');
|
12 |
return $this;
|
13 |
}
|
14 |
$method = $order->getPayment()->getMethodInstance()->getCode();
|
15 |
+
if (($method !== 'payson_standard') || ($method == "payson_invoice")) {
|
16 |
return $this;
|
17 |
}
|
18 |
+
if ($order->hasInvoices() > 0) {
|
19 |
return $this;
|
20 |
}
|
|
|
21 |
$base_fee = $order->getBasePaysonInvoiceFee();
|
22 |
$fee = $order->getPaysonInvoiceFee();
|
23 |
|
24 |
if (!$base_fee || !$fee) {
|
25 |
return $this;
|
26 |
}
|
|
|
27 |
$base_grand_total = $invoice->getBaseGrandTotal();
|
28 |
$base_grand_total += $base_fee;
|
29 |
+
|
30 |
$grand_total = $invoice->getGrandTotal();
|
31 |
$grand_total += $fee;
|
32 |
+
|
33 |
$invoice->setBasePaysonInvoiceFee($base_fee);
|
34 |
$invoice->setPaysonInvoiceFee($fee);
|
35 |
+
|
36 |
$invoice->setBaseGrandTotal($base_grand_total);
|
37 |
$invoice->setGrandTotal($grand_total);
|
38 |
+
|
39 |
return $this;
|
40 |
}
|
41 |
|
app/code/community/Payson/Payson/Model/Order/Invoice/Total/Invoice.php.bak
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Payson_Payson_Model_Order_Invoice_Total_Invoice extends
|
4 |
+
Mage_Sales_Model_Order_Invoice_Total_Abstract {
|
5 |
+
|
6 |
+
protected $_code = 'payson_standard';
|
7 |
+
|
8 |
+
public function collect(Mage_Sales_Model_Order_Invoice $invoice) {
|
9 |
+
$order = $invoice->getOrder();
|
10 |
+
$this->_config = Mage::getModel('payson/config');
|
11 |
+
if (!$this->_config->CanInvoicePayment()) {
|
12 |
+
return $this;
|
13 |
+
}
|
14 |
+
$method = $order->getPayment()->getMethodInstance()->getCode();
|
15 |
+
if (($method !== 'payson_standard') || ($method == "payson_invoice")) {
|
16 |
+
return $this;
|
17 |
+
}
|
18 |
+
/*if ($order->hasInvoices() == 0) {
|
19 |
+
return $this;
|
20 |
+
}*/
|
21 |
+
$base_fee = $order->getBasePaysonInvoiceFee();
|
22 |
+
$fee = $order->getPaysonInvoiceFee();
|
23 |
+
if (!$base_fee || !$fee) {
|
24 |
+
return $this;
|
25 |
+
}
|
26 |
+
$base_grand_total = $invoice->getBaseGrandTotal();
|
27 |
+
$base_grand_total += $base_fee;
|
28 |
+
|
29 |
+
$grand_total = $invoice->getGrandTotal();
|
30 |
+
$grand_total += $fee;
|
31 |
+
|
32 |
+
$invoice->setBasePaysonInvoiceFee($base_fee);
|
33 |
+
$invoice->setPaysonInvoiceFee($fee);
|
34 |
+
|
35 |
+
$invoice->setBaseGrandTotal($base_grand_total);
|
36 |
+
$invoice->setGrandTotal($grand_total);
|
37 |
+
|
38 |
+
/*$invoice->setPaysonInvoiceFee($order->payson_invoice_fee);
|
39 |
+
$invoice->setBaseGrandTotal($order->base_total_due);
|
40 |
+
$invoice->setGrandTotal($order->total_due);*/
|
41 |
+
|
42 |
+
if ($order->hasInvoices() == 0) {
|
43 |
+
return $this;
|
44 |
+
}
|
45 |
+
return $this;
|
46 |
+
}
|
47 |
+
|
48 |
+
}
|
app/code/community/Payson/Payson/controllers/Adminhtml/Sales/Order/ShipmentController.php
CHANGED
@@ -12,12 +12,12 @@ class Payson_Payson_Adminhtml_Sales_Order_ShipmentController extends Mage_Adminh
|
|
12 |
$invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
|
13 |
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
|
14 |
$invoice->register();
|
15 |
-
|
16 |
-
|
17 |
$transactionSave = Mage::getModel('core/resource_transaction')
|
18 |
->addObject($invoice)
|
19 |
->addObject($invoice->getOrder());
|
20 |
-
$transactionSave->save();
|
|
|
21 |
}
|
22 |
parent::saveAction();
|
23 |
}
|
12 |
$invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
|
13 |
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
|
14 |
$invoice->register();
|
15 |
+
|
|
|
16 |
$transactionSave = Mage::getModel('core/resource_transaction')
|
17 |
->addObject($invoice)
|
18 |
->addObject($invoice->getOrder());
|
19 |
+
$transactionSave->save();
|
20 |
+
|
21 |
}
|
22 |
parent::saveAction();
|
23 |
}
|
app/code/community/Payson/Payson/controllers/CheckoutController.php
CHANGED
@@ -103,10 +103,12 @@ class Payson_Payson_CheckoutController extends Mage_Core_Controller_Front_Action
|
|
103 |
}
|
104 |
|
105 |
public function returnAction() {
|
|
|
106 |
$order = $this->getOrder();
|
107 |
-
|
108 |
$paymentDetailsResponse = Mage::helper('payson/api')->PaymentDetails(Mage::getSingleton('checkout/session')->getLastRealOrderId())->getResponse();
|
109 |
$paymentStatus = $paymentDetailsResponse->status;
|
|
|
|
|
110 |
$paymentDetails = $paymentDetailsResponse->receiverList->receiver->ToArray();
|
111 |
$new_paymentDetails = array();
|
112 |
foreach ($paymentDetails as $item) {
|
@@ -114,7 +116,8 @@ class Payson_Payson_CheckoutController extends Mage_Core_Controller_Front_Action
|
|
114 |
$new_paymentDetails[$key] = $value;
|
115 |
}
|
116 |
}
|
117 |
-
|
|
|
118 |
$investigatefee = $order['base_payson_invoice_fee'];
|
119 |
$currentAmount = $new_paymentDetails['amount'];
|
120 |
$newAmount = $currentAmount += $investigatefee;
|
@@ -126,8 +129,12 @@ class Payson_Payson_CheckoutController extends Mage_Core_Controller_Front_Action
|
|
126 |
|
127 |
|
128 |
if ($paymentDetailsResponse->type !== 'INVOICE' && $paymentDetailsResponse->status === 'COMPLETED') {
|
|
|
|
|
|
|
|
|
129 |
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);
|
130 |
-
|
131 |
$order['payson_invoice_fee'] = 0;
|
132 |
$order['base_payson_invoice_fee'] = 0;
|
133 |
|
@@ -152,14 +159,25 @@ class Payson_Payson_CheckoutController extends Mage_Core_Controller_Front_Action
|
|
152 |
}
|
153 |
if ($paymentDetailsResponse->type !== 'INVOICE' && $paymentDetailsResponse->status === 'PENDING') {
|
154 |
Mage::getSingleton('core/session')->addError(sprintf(Mage::helper('payson')->__('Something went wrong with the payment. Please, try a different payment method')));
|
|
|
155 |
$order['payson_invoice_fee'] = 0;
|
156 |
$order['base_payson_invoice_fee'] = 0;
|
157 |
$this->_redirect('checkout/onepage/failure');
|
158 |
break;
|
159 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
//Update the order with the true amount
|
161 |
if ($paymentDetailsResponse->type === 'INVOICE' && $paymentDetailsResponse->type !== 'TRANSFER') {
|
|
|
|
|
|
|
162 |
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);
|
|
|
163 |
$order->sendNewOrderEmail()->save();
|
164 |
$order->setBaseGrandTotal($newAmount);
|
165 |
$order->setGrandTotal($newAmount);
|
103 |
}
|
104 |
|
105 |
public function returnAction() {
|
106 |
+
$api = Mage::helper('payson/api');
|
107 |
$order = $this->getOrder();
|
|
|
108 |
$paymentDetailsResponse = Mage::helper('payson/api')->PaymentDetails(Mage::getSingleton('checkout/session')->getLastRealOrderId())->getResponse();
|
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) {
|
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'];
|
123 |
$newAmount = $currentAmount += $investigatefee;
|
129 |
|
130 |
|
131 |
if ($paymentDetailsResponse->type !== 'INVOICE' && $paymentDetailsResponse->status === 'COMPLETED') {
|
132 |
+
if ($sendEmail['status'] == 'pending_payment') {
|
133 |
+
$order->sendNewOrderEmail()->save();
|
134 |
+
}
|
135 |
+
|
136 |
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);
|
137 |
+
Mage::helper('payson')->__('Either an bank, card or SMS payment was choosen as payment method');
|
138 |
$order['payson_invoice_fee'] = 0;
|
139 |
$order['base_payson_invoice_fee'] = 0;
|
140 |
|
159 |
}
|
160 |
if ($paymentDetailsResponse->type !== 'INVOICE' && $paymentDetailsResponse->status === 'PENDING') {
|
161 |
Mage::getSingleton('core/session')->addError(sprintf(Mage::helper('payson')->__('Something went wrong with the payment. Please, try a different payment method')));
|
162 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, true);
|
163 |
$order['payson_invoice_fee'] = 0;
|
164 |
$order['base_payson_invoice_fee'] = 0;
|
165 |
$this->_redirect('checkout/onepage/failure');
|
166 |
break;
|
167 |
}
|
168 |
+
if ($paymentDetailsResponse->type === 'INVOICE' && $InvoiceStatus === 'PENDING') {
|
169 |
+
Mage::getSingleton('core/session')->addError(sprintf(Mage::helper('payson')->__('Your payment is being processed by Payson')));
|
170 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, true);
|
171 |
+
$this->_redirect('checkout/onepage/failure');
|
172 |
+
break;
|
173 |
+
}
|
174 |
//Update the order with the true amount
|
175 |
if ($paymentDetailsResponse->type === 'INVOICE' && $paymentDetailsResponse->type !== 'TRANSFER') {
|
176 |
+
if ($sendEmail['status'] == 'pending_payment') {
|
177 |
+
$order->sendNewOrderEmail()->save();
|
178 |
+
}
|
179 |
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);
|
180 |
+
Mage::helper('payson')->__('Invoice payment was choosen as payment method');
|
181 |
$order->sendNewOrderEmail()->save();
|
182 |
$order->setBaseGrandTotal($newAmount);
|
183 |
$order->setGrandTotal($newAmount);
|
app/code/community/Payson/Payson/etc/system.xml
CHANGED
@@ -109,6 +109,16 @@
|
|
109 |
<show_in_website>0</show_in_website>
|
110 |
<show_in_store>0</show_in_store>
|
111 |
</show_receipt_page>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
</fields>
|
113 |
</payson_standard>
|
114 |
<payson_invoice translate="label" module="payson">
|
109 |
<show_in_website>0</show_in_website>
|
110 |
<show_in_store>0</show_in_store>
|
111 |
</show_receipt_page>
|
112 |
+
<vat_discount translate="label,comment">
|
113 |
+
<label>Enable average vat on discount</label>
|
114 |
+
<comment>Enable/disable average vat on discount</comment>
|
115 |
+
<frontend_type>select</frontend_type>
|
116 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
117 |
+
<sort_order>250</sort_order>
|
118 |
+
<show_in_default>1</show_in_default>
|
119 |
+
<show_in_website>0</show_in_website>
|
120 |
+
<show_in_store>0</show_in_store>
|
121 |
+
</vat_discount>
|
122 |
</fields>
|
123 |
</payson_standard>
|
124 |
<payson_invoice translate="label" module="payson">
|
app/etc/modules/Payson_Payson.xml
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
<Payson_Payson>
|
5 |
<active>true</active>
|
6 |
<codePool>community</codePool>
|
7 |
-
<version>1.8.3</version>
|
8 |
<depends>
|
9 |
<Mage_Payment />
|
10 |
</depends>
|
4 |
<Payson_Payson>
|
5 |
<active>true</active>
|
6 |
<codePool>community</codePool>
|
7 |
+
<version>1.8.3.2</version>
|
8 |
<depends>
|
9 |
<Mage_Payment />
|
10 |
</depends>
|
app/locale/sv_SE/Payson_Payson.csv
CHANGED
@@ -11,6 +11,7 @@
|
|
11 |
"Order was activated at Payson","Order aktiverades hos Payson"
|
12 |
"Payment was credited at Payson","Betalningen krediterades hos Payson"
|
13 |
"Order was canceled at Payson","Beställningen avbröts hos Payson"
|
|
|
14 |
|
15 |
"Payson is not ready to create an invoice. Please try again later.","Payson är inte redo att skapa en faktura. Försök igen senare."
|
16 |
"Payson is not ready to cancel the order. Please try again later.","Payson är inte redo att avbryta beställningen. Försök igen senare."
|
@@ -27,17 +28,26 @@
|
|
27 |
"Payson pinged the order with status %s","Payson pingade ordern med status: %s"
|
28 |
"Payson cancelled the order with status %s","Payson avbröt ordern med status: %s"
|
29 |
|
|
|
30 |
"Enable","Aktivera"
|
31 |
"Enable Invoice", "Aktivera Payson faktrura"
|
32 |
"Enable/disable payment with Payson.","Aktivera eller inaktivera betalning med Payson."
|
33 |
"Email","E-post"
|
34 |
"Email address bound to your Payson account.","E-postadress för ditt Paysonkonto."
|
35 |
"Agent ID","Agent ID"
|
36 |
-
"Agent ID is found on your Payson profile page.","Logga in på Paysons
|
37 |
-
"MD5 key","MD5-nyckel"
|
38 |
-
"MD5 key is found on your Payson profile page.","Logga in på Paysons webbplats för att hämta din MD5-nyckel."
|
39 |
"Enable payment guarantee","Aktivera Paysongaranti"
|
40 |
"Enable/disable payment guarantee.","Aktivera eller inaktivera Paysongaranti."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
"Payson invoice","Payson faktura"
|
43 |
"Enable/disable invoice payment with Payson.","Aktivera eller inaktivera faktura med Payson."
|
11 |
"Order was activated at Payson","Order aktiverades hos Payson"
|
12 |
"Payment was credited at Payson","Betalningen krediterades hos Payson"
|
13 |
"Order was canceled at Payson","Beställningen avbröts hos Payson"
|
14 |
+
"The order was canceled or not completed within allocated time","Ordern avbröts eller avslutades inte korrekt"
|
15 |
|
16 |
"Payson is not ready to create an invoice. Please try again later.","Payson är inte redo att skapa en faktura. Försök igen senare."
|
17 |
"Payson is not ready to cancel the order. Please try again later.","Payson är inte redo att avbryta beställningen. Försök igen senare."
|
28 |
"Payson pinged the order with status %s","Payson pingade ordern med status: %s"
|
29 |
"Payson cancelled the order with status %s","Payson avbröt ordern med status: %s"
|
30 |
|
31 |
+
|
32 |
"Enable","Aktivera"
|
33 |
"Enable Invoice", "Aktivera Payson faktrura"
|
34 |
"Enable/disable payment with Payson.","Aktivera eller inaktivera betalning med Payson."
|
35 |
"Email","E-post"
|
36 |
"Email address bound to your Payson account.","E-postadress för ditt Paysonkonto."
|
37 |
"Agent ID","Agent ID"
|
38 |
+
"Agent ID is found on your Payson profile page.","Logga in på Paysons för att hämta ditt Agent ID."
|
|
|
|
|
39 |
"Enable payment guarantee","Aktivera Paysongaranti"
|
40 |
"Enable/disable payment guarantee.","Aktivera eller inaktivera Paysongaranti."
|
41 |
+
"Please select the payment method", "Välj vilket betalsätt som passar er"
|
42 |
+
"Choose your prefered Payson payment", "Välj vilket betalsätt som passar er"
|
43 |
+
"Restore cart on cancel", "Återskapa när transaktion avbryts"
|
44 |
+
"Restore cart when customer cancel the payment", "Återskapa varukorgen vid avbruten transaktion"
|
45 |
+
"Restore cart on error", "Återskapa vid fel"
|
46 |
+
"Restore cart when status from Payson is error", "Återskapa varukorgen vid oväntat fel"
|
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."
|
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
|
13 |
-
<date>2015-
|
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>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Payson</name>
|
4 |
+
<version>1.8.3.2</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>Enhanced validation if order confirmation letter has been sent out or not. The order confirmation letter will now be sent at both IPN and upon the customers return to the store, whichever arrives first. An improvement has been made on how the module handle discount with Swedish vat rules.</notes>
|
12 |
+
<authors><author><name>Karl Brundin</name><user>PaysonAB</user><email>integration@payson.se</email></author></authors>
|
13 |
+
<date>2015-11-16</date>
|
14 |
+
<time>14:28:06</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="3b1d1f93c1a712d249f1d1c1d97d6365"/><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="7627a0d2f2937d35512b311b1431ff85"/><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"/><file name="invoice_form.phtml" hash=""/></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="fbc58098d73caab2339652d017393536"/></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.0</max></php></required></dependencies>
|
18 |
</package>
|
skin/frontend/base/default/Payson/Payson/Allinone.png
CHANGED
Binary file
|
skin/frontend/base/default/Payson/Payson/Allinone3.png
CHANGED
Binary file
|
skin/frontend/base/default/Payson/Payson/payson.png
CHANGED
Binary file
|