Version Notes
Multi creditcards fix;
Installments fix.
Download this release
Release Info
| Developer | MundiPagg |
| Extension | Mundipagg_Integracao |
| Version | 2.7.1 |
| Comparing to | |
| See all releases | |
Code changes from version 2.7.0 to 2.7.1
- app/code/community/Uecommerce/Mundipagg/Helper/Installments.php +297 -289
- app/code/community/Uecommerce/Mundipagg/Helper/Log.php +4 -0
- app/code/community/Uecommerce/Mundipagg/Model/Api.php +213 -78
- app/code/community/Uecommerce/Mundipagg/Model/Observer.php +18 -16
- app/code/community/Uecommerce/Mundipagg/Model/Order/Payment.php +47 -0
- app/code/community/Uecommerce/Mundipagg/Model/Standard.php +266 -203
- app/code/community/Uecommerce/Mundipagg/Model/Urlvalidation.php +1 -1
- app/code/community/Uecommerce/Mundipagg/controllers/StandardController.php +28 -7
- app/code/community/Uecommerce/Mundipagg/controllers/TestController.php +139 -0
- app/code/community/Uecommerce/Mundipagg/controllers/TesteController.php +65 -6
- app/code/community/Uecommerce/Mundipagg/etc/config.xml +1 -1
- app/design/adminhtml/default/default/template/mundipagg/payment/info/mundipagg.phtml +197 -185
- app/design/frontend/base/default/template/mundipagg/partial.phtml +3 -2
- app/locale/pt_BR/Uecommerce_Mundipagg.csv +1 -0
- package.xml +7 -6
app/code/community/Uecommerce/Mundipagg/Helper/Installments.php
CHANGED
|
@@ -27,310 +27,318 @@
|
|
| 27 |
* @package Uecommerce_Mundipagg
|
| 28 |
* @author Uecommerce Dev Team
|
| 29 |
*/
|
|
|
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 294 |
//Mage::log( 'ccTypeInstallments' );
|
| 295 |
//Mage::log( print_r($ccTypeInstallments,1) );
|
| 296 |
-
|
| 297 |
//Mage::log( 'all_installments' );
|
| 298 |
//Mage::log( print_r($all_installments,1) );
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
|
| 303 |
//Mage::log( 'if empty all_installments' );
|
| 304 |
//Mage::log( print_r($all_installments,1) );
|
| 305 |
|
| 306 |
-
|
| 307 |
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
|
| 323 |
-
|
| 324 |
|
| 325 |
-
|
| 326 |
|
| 327 |
-
|
| 328 |
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
|
| 334 |
-
|
| 335 |
-
|
| 336 |
}
|
| 27 |
* @package Uecommerce_Mundipagg
|
| 28 |
* @author Uecommerce Dev Team
|
| 29 |
*/
|
| 30 |
+
class Uecommerce_Mundipagg_Helper_Installments extends Mage_Core_Helper_Abstract {
|
| 31 |
|
| 32 |
+
public $displayTotal = true;
|
| 33 |
+
|
| 34 |
+
protected function _fixQty($qty) {
|
| 35 |
+
return (!empty($qty) ? (float)$qty : null);
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
public function getInstallments($store = null, $ccType = "installments") {
|
| 39 |
+
$value = Mage::getStoreConfig("payment/mundipagg_standard/" . $ccType, $store);
|
| 40 |
+
$value = $this->_unserializeValue($value);
|
| 41 |
+
|
| 42 |
+
return $value;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
protected function _unserializeValue($value) {
|
| 46 |
+
if (is_string($value) && !empty($value)) {
|
| 47 |
+
return unserialize($value);
|
| 48 |
+
} else {
|
| 49 |
+
return array();
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
protected function _isEncodedArrayFieldValue($value) {
|
| 54 |
+
if (!is_array($value)) {
|
| 55 |
+
return false;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
unset($value['__empty']);
|
| 59 |
+
|
| 60 |
+
foreach ($value as $_id => $row) {
|
| 61 |
+
if (!is_array($row) || !array_key_exists('installment_boundary', $row) || !array_key_exists('installment_frequency', $row) || !array_key_exists('installment_interest', $row)) {
|
| 62 |
+
return false;
|
| 63 |
+
}
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
return true;
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
protected function _decodeArrayFieldValue(array $value) {
|
| 70 |
+
$result = array();
|
| 71 |
+
unset($value['__empty']);
|
| 72 |
+
|
| 73 |
+
foreach ($value as $_id => $row) {
|
| 74 |
+
if (!is_array($row) || !array_key_exists('installment_boundary', $row) || !array_key_exists('installment_frequency', $row) || !array_key_exists('installment_interest', $row)) {
|
| 75 |
+
continue;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
$boundary = $row['installment_boundary'];
|
| 79 |
+
$frequency = $row['installment_frequency'];
|
| 80 |
+
$interest = $row['installment_interest'];
|
| 81 |
+
$result[] = array($boundary, $frequency, $interest);
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
return $result;
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
protected function _encodeArrayFieldValue(array $value) {
|
| 88 |
+
$result = array();
|
| 89 |
+
|
| 90 |
+
foreach ($value as $triplet) {
|
| 91 |
+
$boundary = (isset($triplet[0])) ? $triplet[0] : "";
|
| 92 |
+
$frequency = (isset($triplet[1])) ? $triplet[1] : "";
|
| 93 |
+
$interest = (isset($triplet[2])) ? $triplet[2] : "";
|
| 94 |
+
|
| 95 |
+
$_id = Mage::helper('core')->uniqHash('_');
|
| 96 |
+
|
| 97 |
+
$result[$_id] = array(
|
| 98 |
+
'installment_boundary' => $boundary,
|
| 99 |
+
'installment_frequency' => $frequency,
|
| 100 |
+
'installment_interest' => $interest
|
| 101 |
+
);
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
return $result;
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
protected function _serializeValue($value) {
|
| 108 |
+
return serialize($value);
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
public function makeArrayFieldValue($value) {
|
| 112 |
+
$value = $this->_unserializeValue($value);
|
| 113 |
+
|
| 114 |
+
if (!$this->_isEncodedArrayFieldValue($value)) {
|
| 115 |
+
$value = $this->_encodeArrayFieldValue($value);
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
return $value;
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
public function makeStorableArrayFieldValue($value) {
|
| 122 |
+
if ($this->_isEncodedArrayFieldValue($value)) {
|
| 123 |
+
$value = $this->_decodeArrayFieldValue($value);
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
$value = $this->_serializeValue($value);
|
| 127 |
+
|
| 128 |
+
return $value;
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
public function getConfigValue($amount, $store = null, $ccType = "installments") {
|
| 132 |
+
$value = $this->getInstallments($store, $ccType);
|
| 133 |
+
|
| 134 |
+
if ($this->_isEncodedArrayFieldValue($value)) {
|
| 135 |
+
$value = $this->_decodeArrayFieldValue($value);
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
$cur_minimal_boundary = -1;
|
| 139 |
+
$resulting_freq = 1;
|
| 140 |
+
|
| 141 |
+
foreach ($value as $row) {
|
| 142 |
+
list($boundary, $frequency) = $row;
|
| 143 |
+
|
| 144 |
+
if ($amount <= $boundary && ($boundary <= $cur_minimal_boundary || $cur_minimal_boundary == -1)) {
|
| 145 |
+
$cur_minimal_boundary = $boundary;
|
| 146 |
+
$resulting_freq = $frequency;
|
| 147 |
+
}
|
| 148 |
+
if ($boundary == "" && $cur_minimal_boundary == -1) {
|
| 149 |
+
$resulting_freq = $frequency;
|
| 150 |
+
}
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
return $resulting_freq;
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
public function isInstallmentsEnabled($store = null) {
|
| 157 |
+
$value = Mage::getStoreConfig("payment/mundipagg_standard/enable_installments", $store);
|
| 158 |
+
|
| 159 |
+
return $value;
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
public function getMaxInstallments($ccType = null, $amount = null) {
|
| 163 |
+
$session = Mage::getSingleton('admin/session');
|
| 164 |
+
|
| 165 |
+
if ($session->isLoggedIn()) {
|
| 166 |
+
$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();
|
| 167 |
+
} else {
|
| 168 |
+
$quote = (Mage::getModel('checkout/type_onepage') !== false) ? Mage::getModel('checkout/type_onepage')->getQuote() : Mage::getModel('checkout/session')->getQuote();;
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
if (!$amount) {
|
| 172 |
+
// Get pre-authorized amount
|
| 173 |
+
$authorizedAmount = Mage::getSingleton('checkout/session')->getAuthorizedAmount();
|
| 174 |
+
|
| 175 |
+
$amount = (double)$quote->getGrandTotal() - $quote->getMundipaggInterest() - $authorizedAmount;
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
$amount = str_replace(',', '.', $amount);
|
| 179 |
+
$ccTypeInstallments = "installments_" . $ccType;
|
| 180 |
+
|
| 181 |
+
$all_installments = $this->getInstallments(null, $ccTypeInstallments);
|
| 182 |
+
|
| 183 |
+
if (empty($all_installments)) {
|
| 184 |
+
$ccTypeInstallments = null;
|
| 185 |
+
} else {
|
| 186 |
+
$max_installments = $this->getConfigValue($amount, null, $ccTypeInstallments);
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
if ($ccTypeInstallments == null) {
|
| 190 |
+
$max_installments = $this->getConfigValue($amount, null);
|
| 191 |
+
$all_installments = $this->getInstallments();
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
if (!$max_installments) {
|
| 195 |
+
$max_installments = 1;
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
return $max_installments;
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
public function getInstallmentForCreditCardType($ccType = null, $amount = null) {
|
| 202 |
+
$session = Mage::getSingleton('admin/session');
|
| 203 |
+
|
| 204 |
+
if ($session->isLoggedIn()) {
|
| 205 |
+
$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();
|
| 206 |
+
} else {
|
| 207 |
+
$quote = (Mage::getModel('checkout/type_onepage') !== false) ? Mage::getModel('checkout/type_onepage')->getQuote() : Mage::getModel('checkout/session')->getQuote();
|
| 208 |
+
}
|
| 209 |
+
|
| 210 |
+
if (!$amount) {
|
| 211 |
+
// Get pre-authorized amount
|
| 212 |
+
$authorizedAmount = Mage::getSingleton('checkout/session')->getAuthorizedAmount();
|
| 213 |
+
$amount = (double)$quote->getGrandTotal() - $quote->getMundipaggInterest() - $authorizedAmount;
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
$result = array();
|
| 217 |
+
$amount = str_replace(',', '.', $amount);
|
| 218 |
+
$ccTypeInstallments = "installments_" . $ccType;
|
| 219 |
+
|
| 220 |
+
$all_installments = $this->getInstallments(null, $ccTypeInstallments);
|
| 221 |
+
|
| 222 |
+
if (empty($all_installments)) {
|
| 223 |
+
$ccTypeInstallments = null;
|
| 224 |
+
} else {
|
| 225 |
+
$max_installments = $this->getConfigValue($amount, null, $ccTypeInstallments);
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
// Fallback to the default installments if creditcard type has no one configured
|
| 229 |
+
if ($ccTypeInstallments == null) {
|
| 230 |
+
$max_installments = $this->getConfigValue($amount, null);
|
| 231 |
+
$all_installments = $this->getInstallments();
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
if (!$max_installments) {
|
| 235 |
+
$max_installments = 0;
|
| 236 |
+
}
|
| 237 |
+
|
| 238 |
+
// result array here
|
| 239 |
+
for ($i = 1; $i <= $max_installments; $i++) {
|
| 240 |
+
// check if installment has extra interest
|
| 241 |
+
$key = $i - 1;
|
| 242 |
+
|
| 243 |
+
if (!array_key_exists($key, $all_installments)) {
|
| 244 |
+
$all_installments[$key] = array();
|
| 245 |
+
}
|
| 246 |
+
|
| 247 |
+
$installment = $all_installments[$key];
|
| 248 |
+
|
| 249 |
+
if (isset($installment[2]) && $installment[2] > 0) {
|
| 250 |
+
$total_amount_with_interest = $this->priceFormatter($amount + ($amount * ($installment[2] / 100)));
|
| 251 |
+
$message = $this->__('with interest');
|
| 252 |
+
|
| 253 |
+
// if ($displayTotal && $this->displayTotal) {
|
| 254 |
+
// $message .= ' (Total: ' . Mage::helper('core')->formatPrice(round((($total_amount_with_interest) / $i), 2) * $i, false) . ')';
|
| 255 |
+
// }
|
| 256 |
+
|
| 257 |
+
} else {
|
| 258 |
+
$total_amount_with_interest = $amount;
|
| 259 |
+
$message = $this->__('without interest');
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
// $coreHelper = Mage::helper('core');
|
| 263 |
+
// $partial_amount = $this->priceFormatter($total_amount_with_interest / $i);
|
| 264 |
+
|
| 265 |
+
$accurPriceWithInterest = $this->priceFormatter($total_amount_with_interest);
|
| 266 |
+
$accurInstallmentAmount = $this->priceFormatter($accurPriceWithInterest / $i);
|
| 267 |
+
$accurParcelsTotals = $this->priceFormatter($accurInstallmentAmount * $i);
|
| 268 |
+
$accuDifference = $this->priceFormatter($accurPriceWithInterest - $accurParcelsTotals);
|
| 269 |
+
|
| 270 |
+
$accurParcelsTotals += $accuDifference;
|
| 271 |
+
|
| 272 |
+
$currencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
|
| 273 |
+
$currencySymbol = Mage::app()->getLocale()->currency($currencyCode)->getSymbol();
|
| 274 |
+
|
| 275 |
+
$accurInstallmentAmount = number_format($accurInstallmentAmount, 2, ',', '');
|
| 276 |
+
$accurParcelsTotals = number_format($accurParcelsTotals, 2, ',', '');
|
| 277 |
+
|
| 278 |
+
$message = "{$i} x {$currencySymbol} {$accurInstallmentAmount} {$message} ";
|
| 279 |
+
$message .= "(Total: {$accurParcelsTotals})";
|
| 280 |
+
|
| 281 |
+
$result[$i] = $message;
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
return $result;
|
| 285 |
+
}
|
| 286 |
+
|
| 287 |
+
private function priceFormatter($number) {
|
| 288 |
+
return round($number, 2, PHP_ROUND_HALF_DOWN);
|
| 289 |
+
}
|
| 290 |
+
|
| 291 |
+
public function getInterestForCard($installments = 1, $ccType = null, $grandTotal = null) {
|
| 292 |
+
$session = Mage::getSingleton('admin/session');
|
| 293 |
+
|
| 294 |
+
if ($session->isLoggedIn()) {
|
| 295 |
+
$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();
|
| 296 |
+
} else {
|
| 297 |
+
$quote = Mage::getSingleton('checkout/session')->getQuote();
|
| 298 |
+
}
|
| 299 |
+
|
| 300 |
+
if ($installments > 0) {
|
| 301 |
+
$ccTypeInstallments = "installments_" . $ccType;
|
| 302 |
//Mage::log( 'ccTypeInstallments' );
|
| 303 |
//Mage::log( print_r($ccTypeInstallments,1) );
|
| 304 |
+
$all_installments = $this->getInstallments(null, $ccTypeInstallments);
|
| 305 |
//Mage::log( 'all_installments' );
|
| 306 |
//Mage::log( print_r($all_installments,1) );
|
| 307 |
+
if (empty($all_installments)) {
|
| 308 |
+
$all_installments = $this->getInstallments();
|
| 309 |
+
}
|
| 310 |
|
| 311 |
//Mage::log( 'if empty all_installments' );
|
| 312 |
//Mage::log( print_r($all_installments,1) );
|
| 313 |
|
| 314 |
+
$installmentKey = $installments - 1;
|
| 315 |
|
| 316 |
+
if (!$installmentKey) {
|
| 317 |
+
return 0;
|
| 318 |
+
}
|
| 319 |
+
$installment = $all_installments[$installmentKey];
|
| 320 |
|
| 321 |
+
if ($installment != null && is_array($installment)) {
|
| 322 |
+
// check if interest rate is filled in
|
| 323 |
+
if (isset($installment[2]) && $installment[2] > 0) {
|
| 324 |
+
$interestRate = $installment[2];
|
| 325 |
|
| 326 |
+
if (!$grandTotal) {
|
| 327 |
+
$grandTotal = $quote->getGrandTotal();
|
| 328 |
+
}
|
| 329 |
+
$grandTotal = str_replace(',', '.', $grandTotal);
|
| 330 |
|
| 331 |
+
$grandTotalInterest = $grandTotal + ($grandTotal * ($interestRate / 100));
|
| 332 |
|
| 333 |
+
$fee = (round(($grandTotalInterest / $installments), 2) * $installments) - $grandTotal;
|
| 334 |
|
| 335 |
+
$balance = round($fee, 2);
|
| 336 |
|
| 337 |
+
return $balance;
|
| 338 |
+
}
|
| 339 |
+
}
|
| 340 |
+
}
|
| 341 |
|
| 342 |
+
return 0;
|
| 343 |
+
}
|
| 344 |
}
|
app/code/community/Uecommerce/Mundipagg/Helper/Log.php
CHANGED
|
@@ -20,6 +20,10 @@ class Uecommerce_Mundipagg_Helper_Log extends Mage_Core_Helper_Abstract {
|
|
| 20 |
$this->logLabel = $logLabel;
|
| 21 |
}
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
public function info($msg) {
|
| 24 |
$this->level = Zend_Log::INFO;
|
| 25 |
$this->write($msg);
|
| 20 |
$this->logLabel = $logLabel;
|
| 21 |
}
|
| 22 |
|
| 23 |
+
public function getLogLabel() {
|
| 24 |
+
return $this->logLabel;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
public function info($msg) {
|
| 28 |
$this->level = Zend_Log::INFO;
|
| 29 |
$this->write($msg);
|
app/code/community/Uecommerce/Mundipagg/Model/Api.php
CHANGED
|
@@ -29,6 +29,10 @@
|
|
| 29 |
*/
|
| 30 |
class Uecommerce_Mundipagg_Model_Api extends Uecommerce_Mundipagg_Model_Standard {
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
private $helperUtil;
|
| 33 |
private $modelStandard;
|
| 34 |
private $debugEnabled;
|
|
@@ -1121,18 +1125,17 @@ class Uecommerce_Mundipagg_Model_Api extends Uecommerce_Mundipagg_Model_Standard
|
|
| 1121 |
|
| 1122 |
try {
|
| 1123 |
// Get Webservice URL
|
| 1124 |
-
$url = $standard->getURL()
|
| 1125 |
|
| 1126 |
unset($data['ManageOrderOperationEnum']);
|
| 1127 |
|
| 1128 |
// Get store key
|
| 1129 |
$key = $standard->getMerchantKey();
|
| 1130 |
-
|
| 1131 |
$dataToPost = json_encode($data);
|
|
|
|
| 1132 |
|
| 1133 |
if ($standard->getDebug() == 1) {
|
| 1134 |
-
$
|
| 1135 |
-
|
| 1136 |
$helperLog->debug("Request:\n{$helperUtil->jsonEncodePretty($data)}\n");
|
| 1137 |
}
|
| 1138 |
|
|
@@ -1144,27 +1147,19 @@ class Uecommerce_Mundipagg_Model_Api extends Uecommerce_Mundipagg_Model_Standard
|
|
| 1144 |
|
| 1145 |
// Set the url, number of POST vars, POST data
|
| 1146 |
curl_setopt($ch, CURLOPT_URL, $url);
|
| 1147 |
-
|
| 1148 |
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataToPost);
|
| 1149 |
-
|
| 1150 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
| 1151 |
|
| 1152 |
// Execute post
|
| 1153 |
$_response = curl_exec($ch);
|
|
|
|
|
|
|
| 1154 |
|
| 1155 |
// Close connection
|
| 1156 |
curl_close($ch);
|
| 1157 |
|
| 1158 |
if ($standard->getDebug() == 1) {
|
| 1159 |
-
$
|
| 1160 |
-
$domXml = new DOMDocument('1.0');
|
| 1161 |
-
|
| 1162 |
-
$domXml->formatOutput = true;
|
| 1163 |
-
$domXml->loadXML($xml->asXML());
|
| 1164 |
-
|
| 1165 |
-
$xml = $domXml->saveXML();
|
| 1166 |
-
|
| 1167 |
-
$helperLog->debug("Response:\n{$xml}\n");
|
| 1168 |
}
|
| 1169 |
|
| 1170 |
// Return
|
|
@@ -1267,6 +1262,7 @@ class Uecommerce_Mundipagg_Model_Api extends Uecommerce_Mundipagg_Model_Standard
|
|
| 1267 |
$returnMessage = "OK | {$returnMessageLabel} | Order already canceled.";
|
| 1268 |
|
| 1269 |
$helperLog->info($returnMessage);
|
|
|
|
| 1270 |
return $returnMessage;
|
| 1271 |
}
|
| 1272 |
|
|
@@ -1325,6 +1321,59 @@ class Uecommerce_Mundipagg_Model_Api extends Uecommerce_Mundipagg_Model_Standard
|
|
| 1325 |
|
| 1326 |
switch ($lowerStatus) {
|
| 1327 |
case 'captured':
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1328 |
case 'paid':
|
| 1329 |
case 'overpaid':
|
| 1330 |
if ($order->canUnhold()) {
|
|
@@ -1566,88 +1615,89 @@ class Uecommerce_Mundipagg_Model_Api extends Uecommerce_Mundipagg_Model_Standard
|
|
| 1566 |
}
|
| 1567 |
|
| 1568 |
/**
|
| 1569 |
-
*
|
| 1570 |
-
*
|
| 1571 |
-
*
|
| 1572 |
-
* @
|
| 1573 |
-
* @
|
| 1574 |
*/
|
| 1575 |
-
private function
|
| 1576 |
-
$
|
| 1577 |
-
$
|
| 1578 |
-
$capturedAmountInCents = $postData['CreditCardTransaction']['CapturedAmountInCents'];
|
| 1579 |
-
$ccTransactionEnum = new Uecommerce_Mundipagg_Model_Enum_CreditCardTransactionStatusEnum();
|
| 1580 |
-
$helperLog = new Uecommerce_Mundipagg_Helper_Log(__METHOD__);
|
| 1581 |
|
| 1582 |
-
|
| 1583 |
-
|
| 1584 |
-
|
|
|
|
| 1585 |
|
| 1586 |
-
|
| 1587 |
-
|
|
|
|
| 1588 |
|
| 1589 |
-
|
| 1590 |
-
break;
|
| 1591 |
|
| 1592 |
-
|
| 1593 |
-
|
|
|
|
| 1594 |
|
| 1595 |
-
|
| 1596 |
-
|
| 1597 |
|
| 1598 |
-
|
|
|
|
|
|
|
| 1599 |
break;
|
|
|
|
|
|
|
| 1600 |
|
| 1601 |
-
|
| 1602 |
-
|
|
|
|
| 1603 |
|
| 1604 |
-
|
| 1605 |
-
|
|
|
|
| 1606 |
|
| 1607 |
-
|
| 1608 |
-
|
|
|
|
|
|
|
|
|
|
| 1609 |
|
| 1610 |
-
|
| 1611 |
-
|
|
|
|
|
|
|
| 1612 |
|
| 1613 |
-
|
| 1614 |
-
break;
|
| 1615 |
|
| 1616 |
-
|
| 1617 |
-
|
|
|
|
|
|
|
|
|
|
| 1618 |
|
| 1619 |
-
|
| 1620 |
-
|
|
|
|
| 1621 |
|
| 1622 |
-
|
| 1623 |
-
|
| 1624 |
-
}
|
| 1625 |
-
}
|
| 1626 |
|
| 1627 |
-
|
| 1628 |
-
|
| 1629 |
-
* @since 2016-07-20
|
| 1630 |
-
* Status reference:
|
| 1631 |
-
* http://docs.mundipagg.com/docs/enumera%C3%A7%C3%B5es
|
| 1632 |
-
* @TODO refatorar o tratamento das transacoes de boleto com este metodo
|
| 1633 |
-
*/
|
| 1634 |
-
private function processBoletoTransactionNotification() {
|
| 1635 |
-
$status = '';
|
| 1636 |
-
$boletoTransactionEnum = new Uecommerce_Mundipagg_Model_Enum_BoletoTransactionStatusEnum();
|
| 1637 |
|
| 1638 |
-
|
| 1639 |
-
|
| 1640 |
-
|
| 1641 |
|
| 1642 |
-
|
| 1643 |
-
break;
|
| 1644 |
|
| 1645 |
-
|
| 1646 |
-
|
|
|
|
|
|
|
| 1647 |
|
| 1648 |
-
case $boletoTransactionEnum::OVERPAID:
|
| 1649 |
-
break;
|
| 1650 |
-
}
|
| 1651 |
}
|
| 1652 |
|
| 1653 |
/**
|
|
@@ -1778,6 +1828,91 @@ class Uecommerce_Mundipagg_Model_Api extends Uecommerce_Mundipagg_Model_Standard
|
|
| 1778 |
return array('result' => simplexml_load_string($_response));
|
| 1779 |
}
|
| 1780 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1781 |
/**
|
| 1782 |
* Mail error to Mage::getStoreConfig('trans_email/ident_custom1/email')
|
| 1783 |
*
|
|
@@ -1921,7 +2056,7 @@ class Uecommerce_Mundipagg_Model_Api extends Uecommerce_Mundipagg_Model_Standard
|
|
| 1921 |
$requestRawJson = json_encode($dataToPost);
|
| 1922 |
$requestJSON = $this->helperUtil->jsonEncodePretty($_logRequest);
|
| 1923 |
|
| 1924 |
-
$helperLog->debug("Request
|
| 1925 |
}
|
| 1926 |
|
| 1927 |
$ch = curl_init();
|
|
@@ -1945,7 +2080,7 @@ class Uecommerce_Mundipagg_Model_Api extends Uecommerce_Mundipagg_Model_Standard
|
|
| 1945 |
$responseArray = json_decode($responseJSON, true);
|
| 1946 |
|
| 1947 |
if ($debug) {
|
| 1948 |
-
$helperLog->debug("Response
|
| 1949 |
}
|
| 1950 |
|
| 1951 |
$responseData = array(
|
| 29 |
*/
|
| 30 |
class Uecommerce_Mundipagg_Model_Api extends Uecommerce_Mundipagg_Model_Standard {
|
| 31 |
|
| 32 |
+
const TRANSACTION_NOT_FOUND = "Transaction not found";
|
| 33 |
+
const TRANSACTION_ALREADY_CAPTURED = "Transaction already captured";
|
| 34 |
+
const TRANSACTION_CAPTURED = "Transaction captured";
|
| 35 |
+
|
| 36 |
private $helperUtil;
|
| 37 |
private $modelStandard;
|
| 38 |
private $debugEnabled;
|
| 1125 |
|
| 1126 |
try {
|
| 1127 |
// Get Webservice URL
|
| 1128 |
+
$url = "{$standard->getURL()}{$data['ManageOrderOperationEnum']}";
|
| 1129 |
|
| 1130 |
unset($data['ManageOrderOperationEnum']);
|
| 1131 |
|
| 1132 |
// Get store key
|
| 1133 |
$key = $standard->getMerchantKey();
|
|
|
|
| 1134 |
$dataToPost = json_encode($data);
|
| 1135 |
+
$helperUtil = new Uecommerce_Mundipagg_Helper_Util();
|
| 1136 |
|
| 1137 |
if ($standard->getDebug() == 1) {
|
| 1138 |
+
$helperLog->debug("Url: {$url}");
|
|
|
|
| 1139 |
$helperLog->debug("Request:\n{$helperUtil->jsonEncodePretty($data)}\n");
|
| 1140 |
}
|
| 1141 |
|
| 1147 |
|
| 1148 |
// Set the url, number of POST vars, POST data
|
| 1149 |
curl_setopt($ch, CURLOPT_URL, $url);
|
|
|
|
| 1150 |
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataToPost);
|
|
|
|
| 1151 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
| 1152 |
|
| 1153 |
// Execute post
|
| 1154 |
$_response = curl_exec($ch);
|
| 1155 |
+
$xml = simplexml_load_string($_response);
|
| 1156 |
+
$json = $helperUtil->jsonEncodePretty($xml);
|
| 1157 |
|
| 1158 |
// Close connection
|
| 1159 |
curl_close($ch);
|
| 1160 |
|
| 1161 |
if ($standard->getDebug() == 1) {
|
| 1162 |
+
$helperLog->debug("Response:\n{$json}\n");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1163 |
}
|
| 1164 |
|
| 1165 |
// Return
|
| 1262 |
$returnMessage = "OK | {$returnMessageLabel} | Order already canceled.";
|
| 1263 |
|
| 1264 |
$helperLog->info($returnMessage);
|
| 1265 |
+
|
| 1266 |
return $returnMessage;
|
| 1267 |
}
|
| 1268 |
|
| 1321 |
|
| 1322 |
switch ($lowerStatus) {
|
| 1323 |
case 'captured':
|
| 1324 |
+
$amountToCapture = $capturedAmountInCents * 0.01;
|
| 1325 |
+
|
| 1326 |
+
try {
|
| 1327 |
+
$return = $this->captureTransaction($order, $amountToCapture, $transactionKey);
|
| 1328 |
+
|
| 1329 |
+
} catch (Exception $e) {
|
| 1330 |
+
$orderPayment = new Uecommerce_Mundipagg_Model_Order_Payment();
|
| 1331 |
+
$error = $e->getMessage();
|
| 1332 |
+
|
| 1333 |
+
$helperLog->setLogLabel("#{$orderReference} | {$transactionKey}");
|
| 1334 |
+
|
| 1335 |
+
switch ($error) {
|
| 1336 |
+
case $orderPayment::ERR_CANNOT_CREATE_INVOICE:
|
| 1337 |
+
$error = "Can't created invoice";
|
| 1338 |
+
$helperLog->error($error);
|
| 1339 |
+
break;
|
| 1340 |
+
|
| 1341 |
+
case $orderPayment::ERR_CANNOT_CREATE_INVOICE_WITHOUT_PRODUCTS:
|
| 1342 |
+
$error = "Can't create invoice without products";
|
| 1343 |
+
$helperLog->error($error);
|
| 1344 |
+
break;
|
| 1345 |
+
|
| 1346 |
+
default:
|
| 1347 |
+
$error = "Can't create invoice, unexpected error: {$error}";
|
| 1348 |
+
$helperLog->error($error);
|
| 1349 |
+
}
|
| 1350 |
+
|
| 1351 |
+
$returnMessage = "KO | #{$orderReference} | Can't capture transaction {$transactionKey} | {$error}";
|
| 1352 |
+
|
| 1353 |
+
$helperLog->setLogLabel("");
|
| 1354 |
+
$helperLog->info($returnMessage);
|
| 1355 |
+
|
| 1356 |
+
return $returnMessage;
|
| 1357 |
+
}
|
| 1358 |
+
|
| 1359 |
+
switch ($return) {
|
| 1360 |
+
case self::TRANSACTION_ALREADY_CAPTURED:
|
| 1361 |
+
$returnMessage = "OK | #{$orderReference} | {$transactionKey} | " . self::TRANSACTION_ALREADY_CAPTURED;
|
| 1362 |
+
$helperLog->info($returnMessage);
|
| 1363 |
+
|
| 1364 |
+
return $returnMessage;
|
| 1365 |
+
break;
|
| 1366 |
+
|
| 1367 |
+
case self::TRANSACTION_CAPTURED:
|
| 1368 |
+
$returnMessage = "OK | #{$orderReference} | {$transactionKey} | " . self::TRANSACTION_CAPTURED;
|
| 1369 |
+
$helperLog->info($returnMessage);
|
| 1370 |
+
|
| 1371 |
+
return $returnMessage;
|
| 1372 |
+
break;
|
| 1373 |
+
}
|
| 1374 |
+
|
| 1375 |
+
break;
|
| 1376 |
+
|
| 1377 |
case 'paid':
|
| 1378 |
case 'overpaid':
|
| 1379 |
if ($order->canUnhold()) {
|
| 1615 |
}
|
| 1616 |
|
| 1617 |
/**
|
| 1618 |
+
* @param Mage_Sales_Model_Order $order
|
| 1619 |
+
* @param $amountToCapture
|
| 1620 |
+
* @param $transactionKey
|
| 1621 |
+
* @throws RuntimeException
|
| 1622 |
+
* @return string
|
| 1623 |
*/
|
| 1624 |
+
private function captureTransaction(Mage_Sales_Model_Order $order, $amountToCapture, $transactionKey) {
|
| 1625 |
+
$log = new Uecommerce_Mundipagg_Helper_Log(__METHOD__);
|
| 1626 |
+
$log->setLogLabel("#{$order->getIncrementId()} | {$transactionKey}");
|
|
|
|
|
|
|
|
|
|
| 1627 |
|
| 1628 |
+
$totalPaid = $order->getTotalPaid();
|
| 1629 |
+
$grandTotal = $order->getGrandTotal();
|
| 1630 |
+
$createInvoice = false;
|
| 1631 |
+
$transaction = null;
|
| 1632 |
|
| 1633 |
+
if (is_null($totalPaid)) {
|
| 1634 |
+
$totalPaid = 0;
|
| 1635 |
+
}
|
| 1636 |
|
| 1637 |
+
$totalPaid += $amountToCapture;
|
|
|
|
| 1638 |
|
| 1639 |
+
$transactions = Mage::getModel('sales/order_payment_transaction')
|
| 1640 |
+
->getCollection()
|
| 1641 |
+
->addAttributeToFilter('order_id', array('eq' => $order->getEntityId()));
|
| 1642 |
|
| 1643 |
+
foreach ($transactions as $i) {
|
| 1644 |
+
$orderTransactionKey = $i->getAdditionalInformation('TransactionKey');
|
| 1645 |
|
| 1646 |
+
// transactionKey found
|
| 1647 |
+
if ($orderTransactionKey == $transactionKey) {
|
| 1648 |
+
$transaction = $i;
|
| 1649 |
break;
|
| 1650 |
+
}
|
| 1651 |
+
}
|
| 1652 |
|
| 1653 |
+
if (is_null($transaction)) {
|
| 1654 |
+
Mage::throwException(self::TRANSACTION_NOT_FOUND);
|
| 1655 |
+
}
|
| 1656 |
|
| 1657 |
+
if ($transaction->getIsClosed() == '1') {
|
| 1658 |
+
return self::TRANSACTION_ALREADY_CAPTURED;
|
| 1659 |
+
}
|
| 1660 |
|
| 1661 |
+
if ($totalPaid < $grandTotal) {
|
| 1662 |
+
$order->setStatus('underpaid');
|
| 1663 |
+
} elseif ($totalPaid > $grandTotal) {
|
| 1664 |
+
$order->setStatus('overpaid');
|
| 1665 |
+
}
|
| 1666 |
|
| 1667 |
+
if ($totalPaid == $grandTotal) {
|
| 1668 |
+
// reset total paid, preparing to invoice
|
| 1669 |
+
$createInvoice = true;
|
| 1670 |
+
}
|
| 1671 |
|
| 1672 |
+
$orderPayment = new Uecommerce_Mundipagg_Model_Order_Payment();
|
|
|
|
| 1673 |
|
| 1674 |
+
try {
|
| 1675 |
+
if($createInvoice){
|
| 1676 |
+
$invoice = $orderPayment->createInvoice($order);
|
| 1677 |
+
$log->info("Invoice {$invoice->getIncrementId()} created");
|
| 1678 |
+
}
|
| 1679 |
|
| 1680 |
+
$resource = Mage::getSingleton('core/resource');
|
| 1681 |
+
$conn = $resource->getConnection('core_write');
|
| 1682 |
+
$query = "UPDATE sales_payment_transaction SET is_closed = TRUE WHERE transaction_id={$transaction->getId()}";
|
| 1683 |
|
| 1684 |
+
$conn->query($query);
|
| 1685 |
+
$log->info("Magento payment transaction closed");
|
|
|
|
|
|
|
| 1686 |
|
| 1687 |
+
$order->setTotalPaid($totalPaid);
|
| 1688 |
+
$order->save();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1689 |
|
| 1690 |
+
} catch (Exception $e) {
|
| 1691 |
+
throw new RuntimeException($e->getMessage());
|
| 1692 |
+
}
|
| 1693 |
|
| 1694 |
+
$log->info("Captured amount: {$amountToCapture}");
|
|
|
|
| 1695 |
|
| 1696 |
+
return self::TRANSACTION_CAPTURED;
|
| 1697 |
+
}
|
| 1698 |
+
|
| 1699 |
+
private function queryTransactions() {
|
| 1700 |
|
|
|
|
|
|
|
|
|
|
| 1701 |
}
|
| 1702 |
|
| 1703 |
/**
|
| 1828 |
return array('result' => simplexml_load_string($_response));
|
| 1829 |
}
|
| 1830 |
|
| 1831 |
+
/**
|
| 1832 |
+
* Status reference:
|
| 1833 |
+
* http://docs.mundipagg.com/docs/enumera%C3%A7%C3%B5es
|
| 1834 |
+
*
|
| 1835 |
+
* @param array $postData
|
| 1836 |
+
* @TODO refatorar o tratamento das transacoes com este metodo
|
| 1837 |
+
*/
|
| 1838 |
+
private function processCreditCardTransactionNotification($postData) {
|
| 1839 |
+
$status = $postData['CreditCardTransaction']['CreditCardTransactionStatus'];
|
| 1840 |
+
$transactionKey = $postData['CreditCardTransaction']['TransactionKey'];
|
| 1841 |
+
$capturedAmountInCents = $postData['CreditCardTransaction']['CapturedAmountInCents'];
|
| 1842 |
+
$ccTransactionEnum = new Uecommerce_Mundipagg_Model_Enum_CreditCardTransactionStatusEnum();
|
| 1843 |
+
$helperLog = new Uecommerce_Mundipagg_Helper_Log(__METHOD__);
|
| 1844 |
+
|
| 1845 |
+
switch ($status) {
|
| 1846 |
+
case $ccTransactionEnum::AUTHORIZED_PENDING_CAPTURE:
|
| 1847 |
+
break;
|
| 1848 |
+
|
| 1849 |
+
case $ccTransactionEnum::CAPTURED:
|
| 1850 |
+
break;
|
| 1851 |
+
|
| 1852 |
+
case $ccTransactionEnum::PARTIAL_CAPTURE:
|
| 1853 |
+
break;
|
| 1854 |
+
|
| 1855 |
+
case $ccTransactionEnum::NOT_AUTHORIZED:
|
| 1856 |
+
break;
|
| 1857 |
+
|
| 1858 |
+
case $ccTransactionEnum::VOIDED:
|
| 1859 |
+
break;
|
| 1860 |
+
|
| 1861 |
+
case $ccTransactionEnum::PENDING_VOID:
|
| 1862 |
+
break;
|
| 1863 |
+
|
| 1864 |
+
case $ccTransactionEnum::PARTIAL_VOID:
|
| 1865 |
+
break;
|
| 1866 |
+
|
| 1867 |
+
case $ccTransactionEnum::REFUNDED:
|
| 1868 |
+
break;
|
| 1869 |
+
|
| 1870 |
+
case $ccTransactionEnum::PENDING_REFUND:
|
| 1871 |
+
break;
|
| 1872 |
+
|
| 1873 |
+
case $ccTransactionEnum::PARTIAL_REFUNDED:
|
| 1874 |
+
break;
|
| 1875 |
+
|
| 1876 |
+
case $ccTransactionEnum::WITH_ERROR:
|
| 1877 |
+
break;
|
| 1878 |
+
|
| 1879 |
+
case $ccTransactionEnum::NOT_FOUND_ACQUIRER:
|
| 1880 |
+
break;
|
| 1881 |
+
|
| 1882 |
+
case $ccTransactionEnum::PENDING_AUTHORIZE:
|
| 1883 |
+
break;
|
| 1884 |
+
|
| 1885 |
+
case $ccTransactionEnum::INVALID:
|
| 1886 |
+
break;
|
| 1887 |
+
}
|
| 1888 |
+
}
|
| 1889 |
+
|
| 1890 |
+
/**
|
| 1891 |
+
* @author Ruan Azevedo
|
| 1892 |
+
* @since 2016-07-20
|
| 1893 |
+
* Status reference:
|
| 1894 |
+
* http://docs.mundipagg.com/docs/enumera%C3%A7%C3%B5es
|
| 1895 |
+
* @TODO refatorar o tratamento das transacoes de boleto com este metodo
|
| 1896 |
+
*/
|
| 1897 |
+
private function processBoletoTransactionNotification() {
|
| 1898 |
+
$status = '';
|
| 1899 |
+
$boletoTransactionEnum = new Uecommerce_Mundipagg_Model_Enum_BoletoTransactionStatusEnum();
|
| 1900 |
+
|
| 1901 |
+
switch ($status) {
|
| 1902 |
+
case $boletoTransactionEnum::GENERATED:
|
| 1903 |
+
break;
|
| 1904 |
+
|
| 1905 |
+
case $boletoTransactionEnum::PAID:
|
| 1906 |
+
break;
|
| 1907 |
+
|
| 1908 |
+
case $boletoTransactionEnum::UNDERPAID:
|
| 1909 |
+
break;
|
| 1910 |
+
|
| 1911 |
+
case $boletoTransactionEnum::OVERPAID:
|
| 1912 |
+
break;
|
| 1913 |
+
}
|
| 1914 |
+
}
|
| 1915 |
+
|
| 1916 |
/**
|
| 1917 |
* Mail error to Mage::getStoreConfig('trans_email/ident_custom1/email')
|
| 1918 |
*
|
| 2056 |
$requestRawJson = json_encode($dataToPost);
|
| 2057 |
$requestJSON = $this->helperUtil->jsonEncodePretty($_logRequest);
|
| 2058 |
|
| 2059 |
+
$helperLog->debug("Request:\n{$requestJSON}\n");
|
| 2060 |
}
|
| 2061 |
|
| 2062 |
$ch = curl_init();
|
| 2080 |
$responseArray = json_decode($responseJSON, true);
|
| 2081 |
|
| 2082 |
if ($debug) {
|
| 2083 |
+
$helperLog->debug("Response:\n{$responseJSON} \n");
|
| 2084 |
}
|
| 2085 |
|
| 2086 |
$responseData = array(
|
app/code/community/Uecommerce/Mundipagg/Model/Observer.php
CHANGED
|
@@ -64,24 +64,22 @@ class Uecommerce_Mundipagg_Model_Observer extends Uecommerce_Mundipagg_Model_Sta
|
|
| 64 |
$incrementId = $order->getIncrementId();
|
| 65 |
$offlineRetry = $model->loadByIncrementId($incrementId);
|
| 66 |
|
| 67 |
-
if (empty($offlineRetry->getData())) {
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
$helperLog = new Uecommerce_Mundipagg_Helper_Log(__METHOD__);
|
| 72 |
-
$helperLog->setLogLabel("Order #{$incrementId} canceled");
|
| 73 |
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
|
| 78 |
-
|
| 79 |
-
|
|
|
|
| 80 |
}
|
| 81 |
}
|
| 82 |
|
|
|
|
| 83 |
$this->cancelOrderViaApi($order);
|
| 84 |
-
|
| 85 |
}
|
| 86 |
}
|
| 87 |
|
|
@@ -106,11 +104,15 @@ class Uecommerce_Mundipagg_Model_Observer extends Uecommerce_Mundipagg_Model_Sta
|
|
| 106 |
$url = "{$this->getUrl()}/Cancel";
|
| 107 |
|
| 108 |
$incrementId = $order->getIncrementId();
|
| 109 |
-
$
|
| 110 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
|
| 112 |
-
$logHelper->info("Order #{$incrementId} | Order canceled. Cancel via MundiPagg Api...");
|
| 113 |
-
$api->sendRequest($data, $url);
|
| 114 |
}
|
| 115 |
|
| 116 |
/**
|
| 64 |
$incrementId = $order->getIncrementId();
|
| 65 |
$offlineRetry = $model->loadByIncrementId($incrementId);
|
| 66 |
|
| 67 |
+
if (!empty($offlineRetry->getData())) {
|
| 68 |
+
$helperLog = new Uecommerce_Mundipagg_Helper_Log(__METHOD__);
|
| 69 |
+
$helperLog->setLogLabel("Order #{$incrementId} canceled");
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
+
try {
|
| 72 |
+
$offlineRetry->delete();
|
| 73 |
+
$helperLog->info("Offline retry data deleted successfully.");
|
| 74 |
|
| 75 |
+
} catch (Exception $e) {
|
| 76 |
+
$helperLog->info("Offline retry data cannot be deleted: {$e}");
|
| 77 |
+
}
|
| 78 |
}
|
| 79 |
}
|
| 80 |
|
| 81 |
+
//cancel Mundi transactions via API
|
| 82 |
$this->cancelOrderViaApi($order);
|
|
|
|
| 83 |
}
|
| 84 |
}
|
| 85 |
|
| 104 |
$url = "{$this->getUrl()}/Cancel";
|
| 105 |
|
| 106 |
$incrementId = $order->getIncrementId();
|
| 107 |
+
$orderKeys = (array)$payment->getAdditionalInformation('OrderKey');
|
| 108 |
+
|
| 109 |
+
foreach ($orderKeys as $orderKey) {
|
| 110 |
+
$data = array('OrderKey' => $orderKey);
|
| 111 |
+
|
| 112 |
+
$logHelper->info("Order #{$incrementId} | Order canceled. Cancel via MundiPagg Api...");
|
| 113 |
+
$api->sendRequest($data, $url);
|
| 114 |
+
}
|
| 115 |
|
|
|
|
|
|
|
| 116 |
}
|
| 117 |
|
| 118 |
/**
|
app/code/community/Uecommerce/Mundipagg/Model/Order/Payment.php
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Uecommerce_Mundipagg_Model_Order_Payment {
|
| 4 |
+
|
| 5 |
+
const ERR_CANNOT_CREATE_INVOICE = 1;
|
| 6 |
+
const ERR_CANNOT_CREATE_INVOICE_WITHOUT_PRODUCTS = 2;
|
| 7 |
+
|
| 8 |
+
/**
|
| 9 |
+
* @param Mage_Sales_Model_Order $order
|
| 10 |
+
* @throws Exception
|
| 11 |
+
* @return Mage_Sales_Model_Order_Invoice
|
| 12 |
+
*/
|
| 13 |
+
public function createInvoice(Mage_Sales_Model_Order $order) {
|
| 14 |
+
|
| 15 |
+
if (!$order->canInvoice()) {
|
| 16 |
+
Mage::throwException(self::ERR_CANNOT_CREATE_INVOICE);
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
$invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
|
| 20 |
+
|
| 21 |
+
if (!$invoice->getTotalQty()) {
|
| 22 |
+
Mage::throwException(self::ERR_CANNOT_CREATE_INVOICE_WITHOUT_PRODUCTS);
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE);
|
| 26 |
+
$invoice->register();
|
| 27 |
+
$invoice->getOrder()->setCustomerNoteNotify(true);
|
| 28 |
+
$invoice->getOrder()->setIsInProcess(true);
|
| 29 |
+
$invoice->setCanVoidFlag(true);
|
| 30 |
+
$invoice->pay();
|
| 31 |
+
|
| 32 |
+
try {
|
| 33 |
+
$transactionSave = Mage::getModel('core/resource_transaction')
|
| 34 |
+
->addObject($invoice)
|
| 35 |
+
->addObject($invoice->getOrder());
|
| 36 |
+
|
| 37 |
+
$transactionSave->save();
|
| 38 |
+
|
| 39 |
+
} catch (Exception $e) {
|
| 40 |
+
Mage::throwException($e->getMessage());
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
return $invoice;
|
| 44 |
+
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
}
|
app/code/community/Uecommerce/Mundipagg/Model/Standard.php
CHANGED
|
@@ -219,15 +219,12 @@ class Uecommerce_Mundipagg_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
| 219 |
}
|
| 220 |
|
| 221 |
$info = $this->getInfoInstance();
|
| 222 |
-
|
| 223 |
$mundipagg = array();
|
| 224 |
$helper = Mage::helper('mundipagg');
|
| 225 |
|
| 226 |
foreach ($data->getData() as $id => $value) {
|
| 227 |
$mundipagg[$id] = $value;
|
| 228 |
|
| 229 |
-
//Mage::log($id.' '.$value, null, 'Uecommerce_Mundipagg.log');
|
| 230 |
-
|
| 231 |
// We verify if a CPF OR CNPJ is valid
|
| 232 |
$posTaxvat = strpos($id, 'taxvat');
|
| 233 |
|
|
@@ -356,30 +353,25 @@ class Uecommerce_Mundipagg_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
| 356 |
// Total Installments from token and Credit Card
|
| 357 |
(float)$totalInstallments = $totalInstallmentsToken + $totalInstallmentsNew;
|
| 358 |
|
| 359 |
-
//Mage::log('totalInstallmentsToken: '. $totalInstallmentsToken, null, 'Uecommerce_Mundipagg.log');
|
| 360 |
-
//Mage::log('totalInstallmentsNew: '. $totalInstallmentsNew, null, 'Uecommerce_Mundipagg.log');
|
| 361 |
-
|
| 362 |
// If an amount has already been authorized
|
| 363 |
if (isset($mundipagg['multi']) && Mage::getSingleton('checkout/session')->getAuthorizedAmount()) {
|
| 364 |
-
//Mage::log('multi already authorized', null, 'Uecommerce_Mundipagg.log');
|
| 365 |
-
|
| 366 |
(float)$totalInstallments += (float)Mage::getSingleton('checkout/session')->getAuthorizedAmount();
|
| 367 |
|
| 368 |
// Unset session
|
| 369 |
Mage::getSingleton('checkout/session')->setAuthorizedAmount();
|
| 370 |
}
|
| 371 |
|
| 372 |
-
// Mage::log('grandTotal: '.$grandTotal, null, 'Uecommerce_Mundipagg.log');
|
| 373 |
-
// Mage::log('totalInstallments: '.$totalInstallments, null, 'Uecommerce_Mundipagg.log');
|
| 374 |
-
// Mage::log('getPaymentInterest: '. $info->getPaymentInterest());
|
| 375 |
-
// Mage::log('cal: '. abs($grandTotal-$totalInstallments-$info->getPaymentInterest()), null, 'Uecommerce_Mundipagg.log');
|
| 376 |
-
|
| 377 |
-
|
| 378 |
$epsilon = 0.00001;
|
| 379 |
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 383 |
}
|
| 384 |
} else {
|
| 385 |
if (isset($mundipagg['method'])) {
|
|
@@ -642,7 +634,8 @@ class Uecommerce_Mundipagg_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
| 642 |
if (
|
| 643 |
count($creditCardTransactionResultCollection) > 1 &&
|
| 644 |
$this->getAntiFraud() == 0 &&
|
| 645 |
-
$this->getPaymentAction() == 'order'
|
|
|
|
| 646 |
) {
|
| 647 |
$this->captureAndcreateInvoice($payment);
|
| 648 |
}
|
|
@@ -650,6 +643,7 @@ class Uecommerce_Mundipagg_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
| 650 |
}
|
| 651 |
|
| 652 |
return $this;
|
|
|
|
| 653 |
} catch (Exception $e) {
|
| 654 |
Mage::logException($e);
|
| 655 |
}
|
|
@@ -695,48 +689,52 @@ class Uecommerce_Mundipagg_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
| 695 |
$TransactionReference = $transaction->getAdditionalInformation('TransactionReference');
|
| 696 |
}
|
| 697 |
|
| 698 |
-
$data['CreditCardTransactionCollection']['AmountInCents'] = $payment->getOrder()->getBaseGrandTotal() * 100;
|
| 699 |
-
$data['CreditCardTransactionCollection']['TransactionKey'] = $TransactionKey;
|
| 700 |
-
$data['CreditCardTransactionCollection']['TransactionReference'] = $TransactionReference;
|
| 701 |
-
$
|
| 702 |
-
$data['ManageOrderOperationEnum'] = 'Capture';
|
| 703 |
|
| 704 |
-
|
| 705 |
-
|
|
|
|
| 706 |
|
| 707 |
-
|
|
|
|
| 708 |
|
| 709 |
-
|
| 710 |
-
$xml = $capture['result'];
|
| 711 |
-
$json = json_encode($xml);
|
| 712 |
|
| 713 |
-
|
| 714 |
-
|
|
|
|
| 715 |
|
| 716 |
-
|
| 717 |
-
|
| 718 |
-
if (count($xml->CreditCardTransactionResultCollection->CreditCardTransactionResult) == 1) {
|
| 719 |
-
$trans = $capture['result']['CreditCardTransactionResultCollection']['CreditCardTransactionResult'];
|
| 720 |
|
| 721 |
-
|
| 722 |
-
|
| 723 |
-
$
|
|
|
|
| 724 |
|
| 725 |
-
|
| 726 |
-
|
| 727 |
-
$CapturedAmountInCents
|
| 728 |
-
}
|
| 729 |
|
| 730 |
-
|
| 731 |
-
|
| 732 |
-
|
|
|
|
| 733 |
|
| 734 |
-
|
| 735 |
-
|
| 736 |
-
|
| 737 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 738 |
|
| 739 |
-
|
|
|
|
| 740 |
}
|
| 741 |
} else {
|
| 742 |
Mage::throwException(Mage::helper('mundipagg')->__('No OrderKey found.'));
|
|
@@ -1006,7 +1004,6 @@ class Uecommerce_Mundipagg_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
| 1006 |
|
| 1007 |
if ($customerId) {
|
| 1008 |
$customer = Mage::getModel('customer/customer')->load($customerId);
|
| 1009 |
-
|
| 1010 |
$taxvat = $customer->getTaxvat();
|
| 1011 |
}
|
| 1012 |
|
|
@@ -1021,15 +1018,12 @@ class Uecommerce_Mundipagg_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
| 1021 |
$data['customer_id'] = $order->getCustomerId();
|
| 1022 |
$data['address_id'] = $order->getBillingAddress()->getCustomerAddressId();
|
| 1023 |
$data['payment_method'] = isset($postData['payment']['method']) ? $postData['payment']['method'] : $mundipaggData['method'];
|
| 1024 |
-
|
| 1025 |
$type = $data['payment_method'];
|
| 1026 |
|
| 1027 |
// 1 or more Credit Cards Payment
|
| 1028 |
if ($data['payment_method'] != 'mundipagg_boleto' && $data['payment_method'] != 'mundipagg_debit') {
|
| 1029 |
$helper = Mage::helper('mundipagg');
|
| 1030 |
-
|
| 1031 |
$num = $helper->getCreditCardsNumber($type);
|
| 1032 |
-
|
| 1033 |
$method = $helper->getPaymentMethod($num);
|
| 1034 |
|
| 1035 |
if ($num == 0) {
|
|
@@ -1069,6 +1063,7 @@ class Uecommerce_Mundipagg_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
| 1069 |
}
|
| 1070 |
|
| 1071 |
$data['payment'][$i]['TaxDocumentNumber'] = isset($postData['payment'][$method . '_cc_taxvat_' . $num . '_' . $i]) ? $postData['payment'][$method . '_cc_taxvat_' . $num . '_' . $i] : $taxvat;
|
|
|
|
| 1072 |
} else { // Token
|
| 1073 |
$data['payment'][$i]['card_on_file_id'] = isset($postData['payment'][$method . '_token_' . $num . '_' . $i]) ? $postData['payment'][$method . '_token_' . $num . '_' . $i] : $mundipaggData[$method . '_token_' . $num . '_' . $i];
|
| 1074 |
$data['payment'][$i]['InstallmentCount'] = isset($postData['payment'][$method . '_credito_parcelamento_' . $num . '_' . $i]) ? $postData['payment'][$method . '_credito_parcelamento_' . $num . '_' . $i] : 1;
|
|
@@ -1152,6 +1147,7 @@ class Uecommerce_Mundipagg_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
| 1152 |
|
| 1153 |
// Api
|
| 1154 |
$api = Mage::getModel('mundipagg/api');
|
|
|
|
| 1155 |
|
| 1156 |
// Get approval request from gateway
|
| 1157 |
switch ($type) {
|
|
@@ -1170,14 +1166,20 @@ class Uecommerce_Mundipagg_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
| 1170 |
|
| 1171 |
// Set some data from Mundipagg
|
| 1172 |
$payment = $this->setPaymentAdditionalInformation($approvalRequest, $payment);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1173 |
|
| 1174 |
// Payment gateway error
|
| 1175 |
if (isset($approvalRequest['error'])) {
|
|
|
|
| 1176 |
// Partial payment
|
| 1177 |
if (isset($approvalRequest['ErrorCode']) && $approvalRequest['ErrorCode'] == 'multi') {
|
| 1178 |
-
|
|
|
|
| 1179 |
$orderGrandTotal = $order->getGrandTotal();
|
| 1180 |
-
$authorizedAmount = 0;
|
| 1181 |
|
| 1182 |
foreach ($approvalRequest['result']->CreditCardTransactionResultCollection->CreditCardTransactionResult as $key => $result) {
|
| 1183 |
if ($result->Success == true) {
|
|
@@ -1197,136 +1199,171 @@ class Uecommerce_Mundipagg_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
| 1197 |
Mage::getSingleton('checkout/session')->setApprovalRequestSuccess('partial');
|
| 1198 |
Mage::getSingleton('checkout/session')->setAuthorizedAmount($authorizedAmount);
|
| 1199 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1200 |
} else {
|
|
|
|
| 1201 |
Mage::getSingleton('checkout/session')->setApprovalRequestSuccess('cancel');
|
| 1202 |
}
|
| 1203 |
} else {
|
| 1204 |
$this->offlineRetryCancelOrSuccessOrder($order->getIncrementId());
|
| 1205 |
}
|
| 1206 |
-
} else {
|
| 1207 |
-
switch ($approvalRequest['message']) {
|
| 1208 |
-
// BoletoBancario
|
| 1209 |
-
case 0:
|
| 1210 |
-
Mage::getSingleton('checkout/session')->setApprovalRequestSuccess('success');
|
| 1211 |
-
break;
|
| 1212 |
|
| 1213 |
-
|
| 1214 |
-
|
| 1215 |
-
case 2: // AuthOnly
|
| 1216 |
-
case 3: // AuthAndCaptureWithDelay
|
| 1217 |
-
// We set authorized amount in session
|
| 1218 |
-
$orderGrandTotal = $order->getGrandTotal();
|
| 1219 |
-
$authorizedAmount = 0;
|
| 1220 |
|
| 1221 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1222 |
|
| 1223 |
-
|
| 1224 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1225 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1226 |
if ($result->Success == true) {
|
| 1227 |
$authorizedAmount += $result->AuthorizedAmountInCents * 0.01;
|
| 1228 |
}
|
| 1229 |
-
}
|
| 1230 |
-
|
| 1231 |
-
|
| 1232 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1233 |
}
|
| 1234 |
}
|
|
|
|
| 1235 |
}
|
| 1236 |
|
| 1237 |
-
|
| 1238 |
-
$
|
| 1239 |
-
|
| 1240 |
-
|
| 1241 |
-
|
| 1242 |
-
Mage::getSingleton('checkout/session')->setAuthorizedAmount();
|
| 1243 |
|
| 1244 |
-
if ($orderGrandTotal < $authorizedAmount) {
|
| 1245 |
$interestInformation = $payment->getAdditionalInformation('mundipagg_interest_information');
|
|
|
|
| 1246 |
$newInterestInformation = array();
|
|
|
|
| 1247 |
if (count($interestInformation)) {
|
| 1248 |
-
$newInterest = 0;
|
| 1249 |
foreach ($interestInformation as $key => $ii) {
|
| 1250 |
-
if (strpos($key, 'partial') !== false) {
|
| 1251 |
-
if ($ii->hasValue()) {
|
| 1252 |
-
$newInterest += (float)($ii->getInterest());
|
| 1253 |
-
}
|
| 1254 |
-
}
|
| 1255 |
|
| 1256 |
-
|
| 1257 |
-
|
| 1258 |
-
|
| 1259 |
-
|
| 1260 |
-
|
| 1261 |
-
|
| 1262 |
-
|
| 1263 |
-
|
| 1264 |
-
|
| 1265 |
-
if (($orderGrandTotal - $authorizedAmount) >= $epsilon) {
|
| 1266 |
-
|
| 1267 |
-
Mage::getSingleton('checkout/session')->setApprovalRequestSuccess('partial');
|
| 1268 |
-
Mage::getSingleton('checkout/session')->setAuthorizedAmount($authorizedAmount);
|
| 1269 |
-
$interestInformation = $payment->getAdditionalInformation('mundipagg_interest_information');
|
| 1270 |
-
$unauthorizedAmount = (float)($orderGrandTotal - $authorizedAmount);
|
| 1271 |
-
$newInterestInformation = array();
|
| 1272 |
-
if (count($interestInformation)) {
|
| 1273 |
-
foreach ($interestInformation as $key => $ii) {
|
| 1274 |
-
|
| 1275 |
-
if ($ii->hasValue()) {
|
| 1276 |
-
if ((float)($ii->getValue() + $ii->getInterest()) == (float)trim($unauthorizedAmount)) {
|
| 1277 |
-
$this->removeInterestToOrder($order, $ii->getInterest());
|
| 1278 |
-
} else {
|
| 1279 |
-
$newInterestInformation[$key] = $ii;
|
| 1280 |
-
}
|
| 1281 |
} else {
|
| 1282 |
-
|
| 1283 |
-
$this->removeInterestToOrder($order, $ii->getInterest());
|
| 1284 |
-
} else {
|
| 1285 |
-
$newInterestInformation[$key] = $ii;
|
| 1286 |
-
}
|
| 1287 |
}
|
| 1288 |
}
|
| 1289 |
-
|
| 1290 |
-
$payment->setAdditionalInformation('mundipagg_interest_information', $newInterestInformation);
|
| 1291 |
}
|
|
|
|
|
|
|
| 1292 |
}
|
| 1293 |
-
} else {
|
| 1294 |
-
$this->offlineRetryCancelOrSuccessOrder($order->getIncrementId());
|
| 1295 |
}
|
|
|
|
|
|
|
| 1296 |
}
|
|
|
|
| 1297 |
|
| 1298 |
-
|
| 1299 |
-
|
| 1300 |
-
|
| 1301 |
-
|
| 1302 |
-
|
| 1303 |
-
|
| 1304 |
-
// Transaction
|
| 1305 |
-
$transactionKey = isset($dataR['CreditCardTransactionResultCollection']['CreditCardTransactionResult']['TransactionKey']) ? $dataR['CreditCardTransactionResultCollection']['CreditCardTransactionResult']['TransactionKey'] : null;
|
| 1306 |
-
$creditCardTransactionStatusEnum = isset($dataR['CreditCardTransactionResultCollection']['CreditCardTransactionResult']['CreditCardTransactionStatus']) ? $dataR['CreditCardTransactionResultCollection']['CreditCardTransactionResult']['CreditCardTransactionStatus'] : null;
|
| 1307 |
|
| 1308 |
-
|
| 1309 |
-
|
| 1310 |
-
|
| 1311 |
|
| 1312 |
-
|
|
|
|
|
|
|
| 1313 |
|
| 1314 |
-
|
| 1315 |
-
|
| 1316 |
-
} catch (Exception $e) {
|
| 1317 |
-
continue;
|
| 1318 |
}
|
| 1319 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1320 |
|
| 1321 |
-
|
| 1322 |
-
|
| 1323 |
-
|
| 1324 |
-
|
| 1325 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1326 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1327 |
}
|
| 1328 |
|
| 1329 |
return $approvalRequest;
|
|
|
|
| 1330 |
} catch (Exception $e) {
|
| 1331 |
//Api
|
| 1332 |
$api = Mage::getModel('mundipagg/api');
|
|
@@ -1438,62 +1475,76 @@ class Uecommerce_Mundipagg_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
| 1438 |
$TransactionReference = $transaction->getAdditionalInformation('TransactionReference');
|
| 1439 |
}
|
| 1440 |
|
| 1441 |
-
$data['CreditCardTransactionCollection']['AmountInCents'] = $payment->getOrder()->getBaseGrandTotal() * 100;
|
| 1442 |
-
$data['CreditCardTransactionCollection']['TransactionKey'] = $TransactionKey;
|
| 1443 |
-
$data['CreditCardTransactionCollection']['TransactionReference'] = $TransactionReference;
|
| 1444 |
-
$data['OrderKey'] = $payment->getAdditionalInformation('OrderKey');
|
| 1445 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1446 |
|
| 1447 |
-
|
| 1448 |
-
|
|
|
|
| 1449 |
|
| 1450 |
-
|
|
|
|
| 1451 |
|
| 1452 |
-
|
| 1453 |
-
$xml = $void['result'];
|
| 1454 |
-
$json = json_encode($xml);
|
| 1455 |
|
| 1456 |
-
|
| 1457 |
-
|
|
|
|
| 1458 |
|
| 1459 |
-
|
| 1460 |
-
|
| 1461 |
-
if (count($xml->CreditCardTransactionResultCollection->CreditCardTransactionResult) == 1) {
|
| 1462 |
-
$trans = $void['result']['CreditCardTransactionResultCollection']['CreditCardTransactionResult'];
|
| 1463 |
|
| 1464 |
-
|
| 1465 |
-
|
| 1466 |
-
|
| 1467 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1468 |
}
|
| 1469 |
}
|
| 1470 |
-
}
|
| 1471 |
|
| 1472 |
-
|
| 1473 |
-
|
| 1474 |
-
|
| 1475 |
-
|
| 1476 |
-
|
| 1477 |
-
|
| 1478 |
-
|
| 1479 |
-
|
| 1480 |
-
|
| 1481 |
-
|
| 1482 |
-
|
| 1483 |
-
|
| 1484 |
-
|
| 1485 |
-
|
| 1486 |
-
|
| 1487 |
-
|
| 1488 |
|
| 1489 |
-
|
| 1490 |
-
|
| 1491 |
-
|
| 1492 |
|
| 1493 |
-
|
| 1494 |
-
|
| 1495 |
|
| 1496 |
-
|
|
|
|
| 1497 |
}
|
| 1498 |
} else {
|
| 1499 |
Mage::throwException(Mage::helper('mundipagg')->__('No OrderKey found.'));
|
|
@@ -1622,7 +1673,7 @@ class Uecommerce_Mundipagg_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
| 1622 |
|
| 1623 |
$info = $this->getInfoInstance();
|
| 1624 |
|
| 1625 |
-
$errorMsg =
|
| 1626 |
|
| 1627 |
// Check if we are dealing with a new Credit Card
|
| 1628 |
$isToken = $info->getAdditionalInformation('mundipagg_creditcard_token_1_1');
|
|
@@ -1632,33 +1683,43 @@ class Uecommerce_Mundipagg_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
| 1632 |
|
| 1633 |
$ccNumber = $info->getCcNumber();
|
| 1634 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1635 |
// remove credit card number delimiters such as "-" and space
|
| 1636 |
$ccNumber = preg_replace('/[\-\s]+/', '', $ccNumber);
|
| 1637 |
$info->setCcNumber($ccNumber);
|
| 1638 |
|
| 1639 |
if (in_array($info->getCcType(), $availableTypes)) {
|
| 1640 |
if (!Mage::helper('mundipagg')->validateCcNum($ccNumber) && $info->getCcType() != 'HI') {
|
| 1641 |
-
$errorMsg = Mage::helper('payment')->__('Invalid Credit Card Number');
|
| 1642 |
}
|
| 1643 |
} else {
|
| 1644 |
-
$errorMsg = Mage::helper('payment')->__('Credit card type is not allowed for this payment method.');
|
| 1645 |
}
|
| 1646 |
|
| 1647 |
if (!$info->getCcType()) {
|
| 1648 |
-
$errorMsg = Mage::helper('payment')->__('Please select your credit card type.');
|
| 1649 |
}
|
| 1650 |
|
| 1651 |
if (!$info->getCcOwner()) {
|
| 1652 |
-
$errorMsg = Mage::helper('payment')->__('Please enter your credit card holder name.');
|
| 1653 |
}
|
| 1654 |
|
| 1655 |
if ($info->getCcType() && $info->getCcType() != 'SS' && !Mage::helper('mundipagg')->validateExpDate('20' . $info->getCcExpYear(), $info->getCcExpMonth())) {
|
| 1656 |
-
$errorMsg = Mage::helper('payment')->__('Incorrect credit card expiration date.');
|
| 1657 |
}
|
| 1658 |
}
|
| 1659 |
|
| 1660 |
if ($errorMsg) {
|
| 1661 |
-
|
|
|
|
| 1662 |
}
|
| 1663 |
|
| 1664 |
return $this;
|
|
@@ -1844,15 +1905,17 @@ class Uecommerce_Mundipagg_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
| 1844 |
*/
|
| 1845 |
private function offlineRetryCancelOrSuccessOrder($orderIncrementId) {
|
| 1846 |
$offlineRetryIsEnabled = Uecommerce_Mundipagg_Model_Offlineretry::offlineRetryIsEnabled();
|
|
|
|
|
|
|
| 1847 |
|
| 1848 |
-
if($offlineRetryIsEnabled == false){
|
|
|
|
| 1849 |
Mage::getSingleton('checkout/session')->setApprovalRequestSuccess('cancel');
|
|
|
|
| 1850 |
return;
|
| 1851 |
}
|
| 1852 |
|
| 1853 |
$api = new Uecommerce_Mundipagg_Model_Api();
|
| 1854 |
-
$helperLog = new Uecommerce_Mundipagg_Helper_Log(__METHOD__);
|
| 1855 |
-
$logLabel = "Order #{$orderIncrementId}";
|
| 1856 |
|
| 1857 |
if ($api->orderIsInOfflineRetry($orderIncrementId)) {
|
| 1858 |
$message = "{$logLabel} | payment not authorized but order is in offline retry yet, not cancel.";
|
|
@@ -1860,10 +1923,10 @@ class Uecommerce_Mundipagg_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
| 1860 |
$helperLog->info($message);
|
| 1861 |
Mage::getSingleton('checkout/session')->setApprovalRequestSuccess('success');
|
| 1862 |
|
| 1863 |
-
} else {
|
| 1864 |
-
$helperLog->info("{$logLabel} | Payment not authorized and
|
| 1865 |
Mage::getSingleton('checkout/session')->setApprovalRequestSuccess('cancel');
|
| 1866 |
-
}
|
| 1867 |
}
|
| 1868 |
|
| 1869 |
}
|
| 219 |
}
|
| 220 |
|
| 221 |
$info = $this->getInfoInstance();
|
|
|
|
| 222 |
$mundipagg = array();
|
| 223 |
$helper = Mage::helper('mundipagg');
|
| 224 |
|
| 225 |
foreach ($data->getData() as $id => $value) {
|
| 226 |
$mundipagg[$id] = $value;
|
| 227 |
|
|
|
|
|
|
|
| 228 |
// We verify if a CPF OR CNPJ is valid
|
| 229 |
$posTaxvat = strpos($id, 'taxvat');
|
| 230 |
|
| 353 |
// Total Installments from token and Credit Card
|
| 354 |
(float)$totalInstallments = $totalInstallmentsToken + $totalInstallmentsNew;
|
| 355 |
|
|
|
|
|
|
|
|
|
|
| 356 |
// If an amount has already been authorized
|
| 357 |
if (isset($mundipagg['multi']) && Mage::getSingleton('checkout/session')->getAuthorizedAmount()) {
|
|
|
|
|
|
|
| 358 |
(float)$totalInstallments += (float)Mage::getSingleton('checkout/session')->getAuthorizedAmount();
|
| 359 |
|
| 360 |
// Unset session
|
| 361 |
Mage::getSingleton('checkout/session')->setAuthorizedAmount();
|
| 362 |
}
|
| 363 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 364 |
$epsilon = 0.00001;
|
| 365 |
|
| 366 |
+
// $helperLog = new Uecommerce_Mundipagg_Helper_Log(__METHOD__);
|
| 367 |
+
// $helperLog->info("totalInstallments: {$totalInstallments}");
|
| 368 |
+
// $helperLog->info("grandTotal: {$grandTotal}");
|
| 369 |
+
// $helperLog->info("getPaymentInterest: {$info->getPaymentInterest()}");
|
| 370 |
+
// $helperLog->info("epsilon: {$epsilon}");
|
| 371 |
+
|
| 372 |
+
// if ($totalInstallments > 0 && ($grandTotal - $totalInstallments - $info->getPaymentInterest())) {
|
| 373 |
+
// Mage::throwException(Mage::helper('payment')->__('Installments does not match with quote.'));
|
| 374 |
+
// }
|
| 375 |
}
|
| 376 |
} else {
|
| 377 |
if (isset($mundipagg['method'])) {
|
| 634 |
if (
|
| 635 |
count($creditCardTransactionResultCollection) > 1 &&
|
| 636 |
$this->getAntiFraud() == 0 &&
|
| 637 |
+
$this->getPaymentAction() == 'order' &&
|
| 638 |
+
$order->getPaymentAuthorizationAmount() == $order->getGrandTotal()
|
| 639 |
) {
|
| 640 |
$this->captureAndcreateInvoice($payment);
|
| 641 |
}
|
| 643 |
}
|
| 644 |
|
| 645 |
return $this;
|
| 646 |
+
|
| 647 |
} catch (Exception $e) {
|
| 648 |
Mage::logException($e);
|
| 649 |
}
|
| 689 |
$TransactionReference = $transaction->getAdditionalInformation('TransactionReference');
|
| 690 |
}
|
| 691 |
|
| 692 |
+
// $data['CreditCardTransactionCollection']['AmountInCents'] = $payment->getOrder()->getBaseGrandTotal() * 100;
|
| 693 |
+
// $data['CreditCardTransactionCollection']['TransactionKey'] = $TransactionKey;
|
| 694 |
+
// $data['CreditCardTransactionCollection']['TransactionReference'] = $TransactionReference;
|
| 695 |
+
$orderkeys = (array) $payment->getAdditionalInformation('OrderKey');
|
|
|
|
| 696 |
|
| 697 |
+
foreach ($orderkeys as $orderkey) {
|
| 698 |
+
$data['OrderKey'] = $orderkey;
|
| 699 |
+
$data['ManageOrderOperationEnum'] = 'Capture';
|
| 700 |
|
| 701 |
+
//Call Gateway Api
|
| 702 |
+
$api = Mage::getModel('mundipagg/api');
|
| 703 |
|
| 704 |
+
$capture = $api->manageOrderRequest($data, $this);
|
|
|
|
|
|
|
| 705 |
|
| 706 |
+
// Xml
|
| 707 |
+
$xml = $capture['result'];
|
| 708 |
+
$json = json_encode($xml);
|
| 709 |
|
| 710 |
+
$capture['result'] = array();
|
| 711 |
+
$capture['result'] = json_decode($json, true);
|
|
|
|
|
|
|
| 712 |
|
| 713 |
+
// Save transactions
|
| 714 |
+
if (isset($capture['result']['CreditCardTransactionResultCollection']['CreditCardTransactionResult'])) {
|
| 715 |
+
if (count($xml->CreditCardTransactionResultCollection->CreditCardTransactionResult) == 1) {
|
| 716 |
+
$trans = $capture['result']['CreditCardTransactionResultCollection']['CreditCardTransactionResult'];
|
| 717 |
|
| 718 |
+
$this->_addTransaction($payment, $trans['TransactionKey'], Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE, $trans);
|
| 719 |
+
} else {
|
| 720 |
+
$CapturedAmountInCents = 0;
|
|
|
|
| 721 |
|
| 722 |
+
foreach ($capture['result']['CreditCardTransactionResultCollection']['CreditCardTransactionResult'] as $key => $trans) {
|
| 723 |
+
$TransactionKey = $trans['TransactionKey'];
|
| 724 |
+
$CapturedAmountInCents += $trans['CapturedAmountInCents'];
|
| 725 |
+
}
|
| 726 |
|
| 727 |
+
$trans = array();
|
| 728 |
+
$trans['CapturedAmountInCents'] = $CapturedAmountInCents;
|
| 729 |
+
$trans['Success'] = true;
|
| 730 |
+
|
| 731 |
+
$this->_addTransaction($payment, $TransactionKey, Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE, $trans);
|
| 732 |
+
}
|
| 733 |
+
} else {
|
| 734 |
+
Mage::getSingleton('checkout/session')->setApprovalRequestSuccess('cancel');
|
| 735 |
|
| 736 |
+
return false;
|
| 737 |
+
}
|
| 738 |
}
|
| 739 |
} else {
|
| 740 |
Mage::throwException(Mage::helper('mundipagg')->__('No OrderKey found.'));
|
| 1004 |
|
| 1005 |
if ($customerId) {
|
| 1006 |
$customer = Mage::getModel('customer/customer')->load($customerId);
|
|
|
|
| 1007 |
$taxvat = $customer->getTaxvat();
|
| 1008 |
}
|
| 1009 |
|
| 1018 |
$data['customer_id'] = $order->getCustomerId();
|
| 1019 |
$data['address_id'] = $order->getBillingAddress()->getCustomerAddressId();
|
| 1020 |
$data['payment_method'] = isset($postData['payment']['method']) ? $postData['payment']['method'] : $mundipaggData['method'];
|
|
|
|
| 1021 |
$type = $data['payment_method'];
|
| 1022 |
|
| 1023 |
// 1 or more Credit Cards Payment
|
| 1024 |
if ($data['payment_method'] != 'mundipagg_boleto' && $data['payment_method'] != 'mundipagg_debit') {
|
| 1025 |
$helper = Mage::helper('mundipagg');
|
|
|
|
| 1026 |
$num = $helper->getCreditCardsNumber($type);
|
|
|
|
| 1027 |
$method = $helper->getPaymentMethod($num);
|
| 1028 |
|
| 1029 |
if ($num == 0) {
|
| 1063 |
}
|
| 1064 |
|
| 1065 |
$data['payment'][$i]['TaxDocumentNumber'] = isset($postData['payment'][$method . '_cc_taxvat_' . $num . '_' . $i]) ? $postData['payment'][$method . '_cc_taxvat_' . $num . '_' . $i] : $taxvat;
|
| 1066 |
+
|
| 1067 |
} else { // Token
|
| 1068 |
$data['payment'][$i]['card_on_file_id'] = isset($postData['payment'][$method . '_token_' . $num . '_' . $i]) ? $postData['payment'][$method . '_token_' . $num . '_' . $i] : $mundipaggData[$method . '_token_' . $num . '_' . $i];
|
| 1069 |
$data['payment'][$i]['InstallmentCount'] = isset($postData['payment'][$method . '_credito_parcelamento_' . $num . '_' . $i]) ? $postData['payment'][$method . '_credito_parcelamento_' . $num . '_' . $i] : 1;
|
| 1147 |
|
| 1148 |
// Api
|
| 1149 |
$api = Mage::getModel('mundipagg/api');
|
| 1150 |
+
$helperLog = new Uecommerce_Mundipagg_Helper_Log(__METHOD__);
|
| 1151 |
|
| 1152 |
// Get approval request from gateway
|
| 1153 |
switch ($type) {
|
| 1166 |
|
| 1167 |
// Set some data from Mundipagg
|
| 1168 |
$payment = $this->setPaymentAdditionalInformation($approvalRequest, $payment);
|
| 1169 |
+
$authorizedAmount = $order->getPaymentAuthorizationAmount();
|
| 1170 |
+
|
| 1171 |
+
if (is_null($authorizedAmount)) {
|
| 1172 |
+
$authorizedAmount = 0;
|
| 1173 |
+
}
|
| 1174 |
|
| 1175 |
// Payment gateway error
|
| 1176 |
if (isset($approvalRequest['error'])) {
|
| 1177 |
+
|
| 1178 |
// Partial payment
|
| 1179 |
if (isset($approvalRequest['ErrorCode']) && $approvalRequest['ErrorCode'] == 'multi') {
|
| 1180 |
+
|
| 1181 |
+
// We set authorized amount
|
| 1182 |
$orderGrandTotal = $order->getGrandTotal();
|
|
|
|
| 1183 |
|
| 1184 |
foreach ($approvalRequest['result']->CreditCardTransactionResultCollection->CreditCardTransactionResult as $key => $result) {
|
| 1185 |
if ($result->Success == true) {
|
| 1199 |
Mage::getSingleton('checkout/session')->setApprovalRequestSuccess('partial');
|
| 1200 |
Mage::getSingleton('checkout/session')->setAuthorizedAmount($authorizedAmount);
|
| 1201 |
}
|
| 1202 |
+
|
| 1203 |
+
$order->setPaymentAuthorizationAmount($authorizedAmount);
|
| 1204 |
+
$order->save();
|
| 1205 |
+
|
| 1206 |
} else {
|
| 1207 |
+
$helperLog->info("TESTE1: cancel");
|
| 1208 |
Mage::getSingleton('checkout/session')->setApprovalRequestSuccess('cancel');
|
| 1209 |
}
|
| 1210 |
} else {
|
| 1211 |
$this->offlineRetryCancelOrSuccessOrder($order->getIncrementId());
|
| 1212 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1213 |
|
| 1214 |
+
return $approvalRequest;
|
| 1215 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1216 |
|
| 1217 |
+
switch ($approvalRequest['message']) {
|
| 1218 |
+
// BoletoBancario
|
| 1219 |
+
case 0:
|
| 1220 |
+
Mage::getSingleton('checkout/session')->setApprovalRequestSuccess('success');
|
| 1221 |
+
break;
|
| 1222 |
|
| 1223 |
+
// 1CreditCards
|
| 1224 |
+
case 1: // AuthAndCapture
|
| 1225 |
+
case 2: // AuthOnly
|
| 1226 |
+
case 3: // AuthAndCaptureWithDelay
|
| 1227 |
+
// We set authorized amount in session
|
| 1228 |
+
$orderGrandTotal = $order->getGrandTotal();
|
| 1229 |
+
$xml = $approvalRequest['result'];
|
| 1230 |
+
|
| 1231 |
+
if (isset($xml->OrderResult)) {
|
| 1232 |
+
$orderResult = $xml->OrderResult;
|
| 1233 |
+
}
|
| 1234 |
+
|
| 1235 |
+
if (count($xml->CreditCardTransactionResultCollection->CreditCardTransactionResult) == 1) {
|
| 1236 |
+
$result = $xml->CreditCardTransactionResultCollection->CreditCardTransactionResult;
|
| 1237 |
|
| 1238 |
+
if ($result->Success == true) {
|
| 1239 |
+
$authorizedAmount += $result->AuthorizedAmountInCents * 0.01;
|
| 1240 |
+
}
|
| 1241 |
+
} else {
|
| 1242 |
+
foreach ($xml->CreditCardTransactionResultCollection->CreditCardTransactionResult as $key => $result) {
|
| 1243 |
if ($result->Success == true) {
|
| 1244 |
$authorizedAmount += $result->AuthorizedAmountInCents * 0.01;
|
| 1245 |
}
|
| 1246 |
+
}
|
| 1247 |
+
}
|
| 1248 |
+
|
| 1249 |
+
// If authorized amount is the same as order grand total we can show success page
|
| 1250 |
+
$epsilon = 0.1;
|
| 1251 |
+
|
| 1252 |
+
if (($orderGrandTotal - $authorizedAmount) <= $epsilon) {
|
| 1253 |
+
Mage::getSingleton('checkout/session')->setApprovalRequestSuccess('success');
|
| 1254 |
+
Mage::getSingleton('checkout/session')->setAuthorizedAmount();
|
| 1255 |
+
|
| 1256 |
+
if ($orderGrandTotal < $authorizedAmount) {
|
| 1257 |
+
$interestInformation = $payment->getAdditionalInformation('mundipagg_interest_information');
|
| 1258 |
+
$newInterestInformation = array();
|
| 1259 |
+
|
| 1260 |
+
if (count($interestInformation)) {
|
| 1261 |
+
$newInterest = 0;
|
| 1262 |
+
|
| 1263 |
+
foreach ($interestInformation as $key => $ii) {
|
| 1264 |
+
if (strpos($key, 'partial') !== false) {
|
| 1265 |
+
if ($ii->hasValue()) {
|
| 1266 |
+
$newInterest += (float)($ii->getInterest());
|
| 1267 |
+
}
|
| 1268 |
+
}
|
| 1269 |
+
|
| 1270 |
}
|
| 1271 |
}
|
| 1272 |
+
$this->addInterestToOrder($order, $newInterest);
|
| 1273 |
}
|
| 1274 |
|
| 1275 |
+
} else {
|
| 1276 |
+
if ($authorizedAmount != 0) {
|
| 1277 |
+
if (($orderGrandTotal - $authorizedAmount) >= $epsilon) {
|
| 1278 |
+
Mage::getSingleton('checkout/session')->setApprovalRequestSuccess('partial');
|
| 1279 |
+
Mage::getSingleton('checkout/session')->setAuthorizedAmount($authorizedAmount);
|
|
|
|
| 1280 |
|
|
|
|
| 1281 |
$interestInformation = $payment->getAdditionalInformation('mundipagg_interest_information');
|
| 1282 |
+
$unauthorizedAmount = (float)($orderGrandTotal - $authorizedAmount);
|
| 1283 |
$newInterestInformation = array();
|
| 1284 |
+
|
| 1285 |
if (count($interestInformation)) {
|
|
|
|
| 1286 |
foreach ($interestInformation as $key => $ii) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1287 |
|
| 1288 |
+
if ($ii->hasValue()) {
|
| 1289 |
+
if ((float)($ii->getValue() + $ii->getInterest()) == (float)trim($unauthorizedAmount)) {
|
| 1290 |
+
$this->removeInterestToOrder($order, $ii->getInterest());
|
| 1291 |
+
} else {
|
| 1292 |
+
$newInterestInformation[$key] = $ii;
|
| 1293 |
+
}
|
| 1294 |
+
} else {
|
| 1295 |
+
if (($order->getGrandTotal() + $order->getMundipaggInterest()) == $unauthorizedAmount) {
|
| 1296 |
+
$this->removeInterestToOrder($order, $ii->getInterest());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1297 |
} else {
|
| 1298 |
+
$newInterestInformation[$key] = $ii;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1299 |
}
|
| 1300 |
}
|
|
|
|
|
|
|
| 1301 |
}
|
| 1302 |
+
|
| 1303 |
+
$payment->setAdditionalInformation('mundipagg_interest_information', $newInterestInformation);
|
| 1304 |
}
|
|
|
|
|
|
|
| 1305 |
}
|
| 1306 |
+
} else {
|
| 1307 |
+
$this->offlineRetryCancelOrSuccessOrder($order->getIncrementId());
|
| 1308 |
}
|
| 1309 |
+
}
|
| 1310 |
|
| 1311 |
+
// Session
|
| 1312 |
+
$xml = simplexml_load_string($approvalRequest['result']);
|
| 1313 |
+
$json = json_encode($xml);
|
| 1314 |
+
$dataR = array();
|
| 1315 |
+
$dataR = json_decode($json, true);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1316 |
|
| 1317 |
+
// Transaction
|
| 1318 |
+
$transactionKey = isset($dataR['CreditCardTransactionResultCollection']['CreditCardTransactionResult']['TransactionKey']) ? $dataR['CreditCardTransactionResultCollection']['CreditCardTransactionResult']['TransactionKey'] : null;
|
| 1319 |
+
$creditCardTransactionStatusEnum = isset($dataR['CreditCardTransactionResultCollection']['CreditCardTransactionResult']['CreditCardTransactionStatus']) ? $dataR['CreditCardTransactionResultCollection']['CreditCardTransactionResult']['CreditCardTransactionStatus'] : null;
|
| 1320 |
|
| 1321 |
+
try {
|
| 1322 |
+
if ($transactionKey != null) {
|
| 1323 |
+
$this->_transactionId = $transactionKey;
|
| 1324 |
|
| 1325 |
+
$payment->setTransactionId($this->_transactionId);
|
| 1326 |
+
$payment->save();
|
|
|
|
|
|
|
| 1327 |
}
|
| 1328 |
+
} catch (Exception $e) {
|
| 1329 |
+
$helperLog->error($e->getMessage());
|
| 1330 |
+
continue;
|
| 1331 |
+
}
|
| 1332 |
+
break;
|
| 1333 |
|
| 1334 |
+
// Debit
|
| 1335 |
+
case 4:
|
| 1336 |
+
Mage::getSingleton('checkout/session')->setApprovalRequestSuccess('debit');
|
| 1337 |
+
Mage::getSingleton('checkout/session')->setBankRedirectUrl($approvalRequest['result']['BankRedirectUrl']);
|
| 1338 |
+
break;
|
| 1339 |
+
}
|
| 1340 |
+
|
| 1341 |
+
if (isset($orderResult)) {
|
| 1342 |
+
$newOrderKey = (string)$orderResult->OrderKey;
|
| 1343 |
+
$orderPayment = $order->getPayment();
|
| 1344 |
+
$orderKeys = (array)$orderPayment->getAdditionalInformation('OrderKey');
|
| 1345 |
+
|
| 1346 |
+
if (is_null($orderKeys) || !is_array($orderKeys)) {
|
| 1347 |
+
$orderKeys = array();
|
| 1348 |
+
}
|
| 1349 |
+
|
| 1350 |
+
if (!in_array($newOrderKey, $orderKeys)) {
|
| 1351 |
+
$orderKeys[] = $newOrderKey;
|
| 1352 |
}
|
| 1353 |
+
|
| 1354 |
+
$orderPayment->setAdditionalInformation('OrderKey', $orderKeys);
|
| 1355 |
+
$orderPayment->save();
|
| 1356 |
+
}
|
| 1357 |
+
|
| 1358 |
+
$order->setPaymentAuthorizationAmount($authorizedAmount);
|
| 1359 |
+
$order->save();
|
| 1360 |
+
|
| 1361 |
+
if ($authorizedAmount == $order->getGrandTotal()) {
|
| 1362 |
+
Mage::getSingleton('checkout/session')->setApprovalRequestSuccess('success');
|
| 1363 |
}
|
| 1364 |
|
| 1365 |
return $approvalRequest;
|
| 1366 |
+
|
| 1367 |
} catch (Exception $e) {
|
| 1368 |
//Api
|
| 1369 |
$api = Mage::getModel('mundipagg/api');
|
| 1475 |
$TransactionReference = $transaction->getAdditionalInformation('TransactionReference');
|
| 1476 |
}
|
| 1477 |
|
| 1478 |
+
// $data['CreditCardTransactionCollection']['AmountInCents'] = $payment->getOrder()->getBaseGrandTotal() * 100;
|
| 1479 |
+
// $data['CreditCardTransactionCollection']['TransactionKey'] = $TransactionKey;
|
| 1480 |
+
// $data['CreditCardTransactionCollection']['TransactionReference'] = $TransactionReference;
|
| 1481 |
+
// $data['OrderKey'] = $payment->getAdditionalInformation('OrderKey');
|
| 1482 |
+
$orderkeys = $payment->getAdditionalInformation('OrderKey');
|
| 1483 |
+
|
| 1484 |
+
if (!is_array($orderkeys)) {
|
| 1485 |
+
// $errMsg = "Impossible to capture: orderkeys must be an array";
|
| 1486 |
+
// $helperLog = new Uecommerce_Mundipagg_Helper_Log(__METHOD__);
|
| 1487 |
+
//
|
| 1488 |
+
// $helperLog->error($errMsg);
|
| 1489 |
+
// Mage::throwException($errMsg);
|
| 1490 |
+
$orderkeys = array($orderkeys);
|
| 1491 |
+
}
|
| 1492 |
|
| 1493 |
+
foreach ($orderkeys as $orderkey) {
|
| 1494 |
+
$data['ManageOrderOperationEnum'] = 'Cancel';
|
| 1495 |
+
$data['OrderKey'] = $orderkey;
|
| 1496 |
|
| 1497 |
+
//Call Gateway Api
|
| 1498 |
+
$api = Mage::getModel('mundipagg/api');
|
| 1499 |
|
| 1500 |
+
$void = $api->manageOrderRequest($data, $this);
|
|
|
|
|
|
|
| 1501 |
|
| 1502 |
+
// Xml
|
| 1503 |
+
$xml = $void['result'];
|
| 1504 |
+
$json = json_encode($xml);
|
| 1505 |
|
| 1506 |
+
$void['result'] = array();
|
| 1507 |
+
$void['result'] = json_decode($json, true);
|
|
|
|
|
|
|
| 1508 |
|
| 1509 |
+
// We record transaction(s)
|
| 1510 |
+
if (count($void['result']['CreditCardTransactionResultCollection']) > 0) {
|
| 1511 |
+
if (count($xml->CreditCardTransactionResultCollection->CreditCardTransactionResult) == 1) {
|
| 1512 |
+
$trans = $void['result']['CreditCardTransactionResultCollection']['CreditCardTransactionResult'];
|
| 1513 |
+
|
| 1514 |
+
$this->_addTransaction($payment, $trans['TransactionKey'], 'void', $trans);
|
| 1515 |
+
} else {
|
| 1516 |
+
foreach ($void['result']['CreditCardTransactionResultCollection']['CreditCardTransactionResult'] as $key => $trans) {
|
| 1517 |
+
$this->_addTransaction($payment, $trans['TransactionKey'], 'void', $trans, $key);
|
| 1518 |
+
}
|
| 1519 |
}
|
| 1520 |
}
|
|
|
|
| 1521 |
|
| 1522 |
+
if (isset($void['result']['CreditCardTransactionResultCollection']['CreditCardTransactionResult'])) {
|
| 1523 |
+
$order = $payment->getOrder();
|
| 1524 |
+
$order->setBaseDiscountRefunded($order->getBaseDiscountInvoiced());
|
| 1525 |
+
$order->setBaseShippingRefunded($order->getBaseShippingAmount());
|
| 1526 |
+
$order->setBaseShippingTaxRefunded($order->getBaseShippingTaxInvoiced());
|
| 1527 |
+
$order->setBaseSubtotalRefunded($order->getBaseSubtotalInvoiced());
|
| 1528 |
+
$order->setBaseTaxRefunded($order->getBaseTaxInvoiced());
|
| 1529 |
+
$order->setBaseTotalOnlineRefunded($order->getBaseGrandTotal());
|
| 1530 |
+
$order->setDiscountRefunded($order->getDiscountInvoiced());
|
| 1531 |
+
$order->setShippinRefunded($order->getShippingInvoiced());
|
| 1532 |
+
$order->setShippinTaxRefunded($order->getShippingTaxAmount());
|
| 1533 |
+
$order->setSubtotalRefunded($order->getSubtotalInvoiced());
|
| 1534 |
+
$order->setTaxRefunded($order->getTaxInvoiced());
|
| 1535 |
+
$order->setTotalOnlineRefunded($order->getBaseGrandTotal());
|
| 1536 |
+
$order->setTotalRefunded($order->getBaseGrandTotal());
|
| 1537 |
+
$order->save();
|
| 1538 |
|
| 1539 |
+
return $this;
|
| 1540 |
+
} else {
|
| 1541 |
+
$error = Mage::helper('mundipagg')->__('Unable to void order.');
|
| 1542 |
|
| 1543 |
+
//Log error
|
| 1544 |
+
Mage::log($error, null, 'Uecommerce_Mundipagg.log');
|
| 1545 |
|
| 1546 |
+
Mage::throwException($error);
|
| 1547 |
+
}
|
| 1548 |
}
|
| 1549 |
} else {
|
| 1550 |
Mage::throwException(Mage::helper('mundipagg')->__('No OrderKey found.'));
|
| 1673 |
|
| 1674 |
$info = $this->getInfoInstance();
|
| 1675 |
|
| 1676 |
+
$errorMsg = array();
|
| 1677 |
|
| 1678 |
// Check if we are dealing with a new Credit Card
|
| 1679 |
$isToken = $info->getAdditionalInformation('mundipagg_creditcard_token_1_1');
|
| 1683 |
|
| 1684 |
$ccNumber = $info->getCcNumber();
|
| 1685 |
|
| 1686 |
+
// refresh quote to remove promotions from others payment methods
|
| 1687 |
+
try {
|
| 1688 |
+
$this->getQuote()->save();
|
| 1689 |
+
|
| 1690 |
+
} catch (Exception $e) {
|
| 1691 |
+
$errorMsg[] = $e->getMessage();
|
| 1692 |
+
|
| 1693 |
+
}
|
| 1694 |
+
|
| 1695 |
// remove credit card number delimiters such as "-" and space
|
| 1696 |
$ccNumber = preg_replace('/[\-\s]+/', '', $ccNumber);
|
| 1697 |
$info->setCcNumber($ccNumber);
|
| 1698 |
|
| 1699 |
if (in_array($info->getCcType(), $availableTypes)) {
|
| 1700 |
if (!Mage::helper('mundipagg')->validateCcNum($ccNumber) && $info->getCcType() != 'HI') {
|
| 1701 |
+
$errorMsg[] = Mage::helper('payment')->__('Invalid Credit Card Number');
|
| 1702 |
}
|
| 1703 |
} else {
|
| 1704 |
+
$errorMsg[] = Mage::helper('payment')->__('Credit card type is not allowed for this payment method.');
|
| 1705 |
}
|
| 1706 |
|
| 1707 |
if (!$info->getCcType()) {
|
| 1708 |
+
$errorMsg[] = Mage::helper('payment')->__('Please select your credit card type.');
|
| 1709 |
}
|
| 1710 |
|
| 1711 |
if (!$info->getCcOwner()) {
|
| 1712 |
+
$errorMsg[] = Mage::helper('payment')->__('Please enter your credit card holder name.');
|
| 1713 |
}
|
| 1714 |
|
| 1715 |
if ($info->getCcType() && $info->getCcType() != 'SS' && !Mage::helper('mundipagg')->validateExpDate('20' . $info->getCcExpYear(), $info->getCcExpMonth())) {
|
| 1716 |
+
$errorMsg[] = Mage::helper('payment')->__('Incorrect credit card expiration date.');
|
| 1717 |
}
|
| 1718 |
}
|
| 1719 |
|
| 1720 |
if ($errorMsg) {
|
| 1721 |
+
$json = json_encode($errorMsg);
|
| 1722 |
+
Mage::throwException($json);
|
| 1723 |
}
|
| 1724 |
|
| 1725 |
return $this;
|
| 1905 |
*/
|
| 1906 |
private function offlineRetryCancelOrSuccessOrder($orderIncrementId) {
|
| 1907 |
$offlineRetryIsEnabled = Uecommerce_Mundipagg_Model_Offlineretry::offlineRetryIsEnabled();
|
| 1908 |
+
$helperLog = new Uecommerce_Mundipagg_Helper_Log(__METHOD__);
|
| 1909 |
+
$logLabel = "Order #{$orderIncrementId}";
|
| 1910 |
|
| 1911 |
+
if ($offlineRetryIsEnabled == false) {
|
| 1912 |
+
$helperLog->info("{$logLabel} | Payment not authorized and store don't have offline retry, order will be canceled.");
|
| 1913 |
Mage::getSingleton('checkout/session')->setApprovalRequestSuccess('cancel');
|
| 1914 |
+
|
| 1915 |
return;
|
| 1916 |
}
|
| 1917 |
|
| 1918 |
$api = new Uecommerce_Mundipagg_Model_Api();
|
|
|
|
|
|
|
| 1919 |
|
| 1920 |
if ($api->orderIsInOfflineRetry($orderIncrementId)) {
|
| 1921 |
$message = "{$logLabel} | payment not authorized but order is in offline retry yet, not cancel.";
|
| 1923 |
$helperLog->info($message);
|
| 1924 |
Mage::getSingleton('checkout/session')->setApprovalRequestSuccess('success');
|
| 1925 |
|
| 1926 |
+
}/* else {
|
| 1927 |
+
$helperLog->info("{$logLabel} | Payment not authorized and order is not on offline retry.");
|
| 1928 |
Mage::getSingleton('checkout/session')->setApprovalRequestSuccess('cancel');
|
| 1929 |
+
}*/
|
| 1930 |
}
|
| 1931 |
|
| 1932 |
}
|
app/code/community/Uecommerce/Mundipagg/Model/Urlvalidation.php
CHANGED
|
@@ -8,7 +8,7 @@ class Uecommerce_Mundipagg_Model_Urlvalidation extends Mage_Core_Model_Config_Da
|
|
| 8 |
$path = null;
|
| 9 |
|
| 10 |
if (isset($parsedUrl['path'])) {
|
| 11 |
-
$path =
|
| 12 |
}
|
| 13 |
|
| 14 |
if (is_null($path) || strtolower($path) != 'sale') {
|
| 8 |
$path = null;
|
| 9 |
|
| 10 |
if (isset($parsedUrl['path'])) {
|
| 11 |
+
$path = str_replace("/","", $parsedUrl['path']);
|
| 12 |
}
|
| 13 |
|
| 14 |
if (is_null($path) || strtolower($path) != 'sale') {
|
app/code/community/Uecommerce/Mundipagg/controllers/StandardController.php
CHANGED
|
@@ -180,9 +180,10 @@ class Uecommerce_Mundipagg_StandardController extends Mage_Core_Controller_Front
|
|
| 180 |
endswitch;
|
| 181 |
|
| 182 |
$resultPayment = $onepage->doPayment($payment, $order);
|
|
|
|
| 183 |
|
| 184 |
// Send new order email when not in admin and payment is success
|
| 185 |
-
if (
|
| 186 |
if (Mage::app()->getStore()->getCode() != 'admin') {
|
| 187 |
$order->sendNewOrderEmail();
|
| 188 |
}
|
|
@@ -199,6 +200,7 @@ class Uecommerce_Mundipagg_StandardController extends Mage_Core_Controller_Front
|
|
| 199 |
$trans = $dataR['CreditCardTransactionResultCollection']['CreditCardTransactionResult'];
|
| 200 |
|
| 201 |
$onepage->_addTransaction($order->getPayment(), $trans['TransactionKey'], Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH, $trans);
|
|
|
|
| 202 |
} else {
|
| 203 |
$transactions = $dataR['CreditCardTransactionResultCollection']['CreditCardTransactionResult'];
|
| 204 |
|
|
@@ -218,12 +220,29 @@ class Uecommerce_Mundipagg_StandardController extends Mage_Core_Controller_Front
|
|
| 218 |
}
|
| 219 |
}
|
| 220 |
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 226 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 227 |
}
|
| 228 |
}
|
| 229 |
} catch (Exception $e) {
|
|
@@ -335,10 +354,12 @@ class Uecommerce_Mundipagg_StandardController extends Mage_Core_Controller_Front
|
|
| 335 |
// Redirect to homepage
|
| 336 |
$this->_redirect('');
|
| 337 |
}
|
|
|
|
|
|
|
|
|
|
| 338 |
} else {
|
| 339 |
// Get posted data
|
| 340 |
$postData = $this->getRequest()->getPost();
|
| 341 |
-
|
| 342 |
$api = Mage::getModel('mundipagg/api');
|
| 343 |
|
| 344 |
// Process order
|
| 180 |
endswitch;
|
| 181 |
|
| 182 |
$resultPayment = $onepage->doPayment($payment, $order);
|
| 183 |
+
$approvalRequestSuccess = Mage::getSingleton('checkout/session')->getApprovalRequestSuccess();
|
| 184 |
|
| 185 |
// Send new order email when not in admin and payment is success
|
| 186 |
+
if ($approvalRequestSuccess == 'success') {
|
| 187 |
if (Mage::app()->getStore()->getCode() != 'admin') {
|
| 188 |
$order->sendNewOrderEmail();
|
| 189 |
}
|
| 200 |
$trans = $dataR['CreditCardTransactionResultCollection']['CreditCardTransactionResult'];
|
| 201 |
|
| 202 |
$onepage->_addTransaction($order->getPayment(), $trans['TransactionKey'], Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH, $trans);
|
| 203 |
+
|
| 204 |
} else {
|
| 205 |
$transactions = $dataR['CreditCardTransactionResultCollection']['CreditCardTransactionResult'];
|
| 206 |
|
| 220 |
}
|
| 221 |
}
|
| 222 |
|
| 223 |
+
switch ($approvalRequestSuccess) {
|
| 224 |
+
case 'success':
|
| 225 |
+
$this->_redirect('mundipagg/standard/success');
|
| 226 |
+
break;
|
| 227 |
+
|
| 228 |
+
case 'partial':
|
| 229 |
+
$this->_redirect('mundipagg/standard/partial');
|
| 230 |
+
break;
|
| 231 |
+
|
| 232 |
+
case 'cancel':
|
| 233 |
+
$this->_redirect('mundipagg/standard/cancel');
|
| 234 |
+
break;
|
| 235 |
+
|
| 236 |
+
default:
|
| 237 |
+
Mage::throwException("Unexpected approvalRequestSuccess: {$approvalRequestSuccess}");
|
| 238 |
}
|
| 239 |
+
|
| 240 |
+
// // Redirect
|
| 241 |
+
// if ($approvalRequestSuccess == 'success') {
|
| 242 |
+
// $this->_redirect('mundipagg/standard/success');
|
| 243 |
+
// } else {
|
| 244 |
+
// $this->_redirect('mundipagg/standard/partial');
|
| 245 |
+
// }
|
| 246 |
}
|
| 247 |
}
|
| 248 |
} catch (Exception $e) {
|
| 354 |
// Redirect to homepage
|
| 355 |
$this->_redirect('');
|
| 356 |
}
|
| 357 |
+
} else if ($approvalRequestSuccess == 'cancel') {
|
| 358 |
+
$this->_redirect('mundipagg/standard/cancel');
|
| 359 |
+
|
| 360 |
} else {
|
| 361 |
// Get posted data
|
| 362 |
$postData = $this->getRequest()->getPost();
|
|
|
|
| 363 |
$api = Mage::getModel('mundipagg/api');
|
| 364 |
|
| 365 |
// Process order
|
app/code/community/Uecommerce/Mundipagg/controllers/TestController.php
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Uecommerce_Mundipagg_TestController extends Uecommerce_Mundipagg_Controller_Abstract {
|
| 4 |
+
|
| 5 |
+
public function indexAction() {
|
| 6 |
+
$model = Mage::getModel('customer/customer');
|
| 7 |
+
|
| 8 |
+
foreach ($model->getCollection() as $i) {
|
| 9 |
+
$customer = $model->load($i->getId());
|
| 10 |
+
|
| 11 |
+
var_dump($customer->getData());
|
| 12 |
+
}
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
public function createCustomerAction() {
|
| 16 |
+
$customer = Mage::getModel('customer/customer');
|
| 17 |
+
|
| 18 |
+
$customer->setWebsiteId(1)
|
| 19 |
+
->setGroupId(1)
|
| 20 |
+
->setEmail('teste@teste.com')
|
| 21 |
+
->setGender(1)
|
| 22 |
+
->setFirstname('Teste')
|
| 23 |
+
->setLastname('Testelastname')
|
| 24 |
+
->setTaxvat('74769331258')
|
| 25 |
+
->setPassword('Teste@123');
|
| 26 |
+
|
| 27 |
+
try {
|
| 28 |
+
$customer->save();
|
| 29 |
+
|
| 30 |
+
echo '<p>customer created</p>';
|
| 31 |
+
|
| 32 |
+
} catch (Exception $e) {
|
| 33 |
+
echo $e->getTraceAsString();
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
$address = Mage::getModel('customer/address');
|
| 37 |
+
|
| 38 |
+
$address->setCustomerId($customer->getId())
|
| 39 |
+
->setFirstname($customer->getFirstname())
|
| 40 |
+
->setLastnmae($customer->getLastname())
|
| 41 |
+
->setCountryId('BR')
|
| 42 |
+
->setPostcode('20021130')
|
| 43 |
+
->setCity('Rio de Janeiro')
|
| 44 |
+
->setTelephone('21988880000')
|
| 45 |
+
->setStreet('Av General Justo 375')
|
| 46 |
+
->setRegionId('RJ')
|
| 47 |
+
->setVatId($customer->getTaxvat())
|
| 48 |
+
->setIsDefaultBilling(1)
|
| 49 |
+
->setIsDefaultShipping(1)
|
| 50 |
+
->setSaveInAddressBook(1);
|
| 51 |
+
|
| 52 |
+
try {
|
| 53 |
+
$address->save();
|
| 54 |
+
echo '<p>address created</p>';
|
| 55 |
+
|
| 56 |
+
} catch (Exception $e) {
|
| 57 |
+
echo $e->getTraceAsString();
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
public function createProductAction() {
|
| 63 |
+
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
|
| 64 |
+
|
| 65 |
+
$product = Mage::getModel('catalog/product');
|
| 66 |
+
|
| 67 |
+
$product->setAttributeSetId(4)
|
| 68 |
+
->setTypeId('simple')
|
| 69 |
+
->setSku('000005')
|
| 70 |
+
->setName('Produto de teste do script')
|
| 71 |
+
->setWeight(10)
|
| 72 |
+
->setStatus(1)
|
| 73 |
+
->setTaxClassId(0)//tax class (0 - none, 1 - default, 2 - taxable, 4 - shipping)
|
| 74 |
+
->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH)
|
| 75 |
+
->setPrice(10.00)
|
| 76 |
+
->setDescription('Produto de teste')
|
| 77 |
+
->setShortDescription('Produto de teste');
|
| 78 |
+
|
| 79 |
+
// ->setStockData(array(
|
| 80 |
+
// 'manage_stock' => 0,
|
| 81 |
+
// 'use_config_manage_stock' => 0,
|
| 82 |
+
// 'use_config_min_sale_qty' => 1,
|
| 83 |
+
// 'use_config_max_sale_qty' => 1,
|
| 84 |
+
// 'use_config_enable_qty_increments' => 1,
|
| 85 |
+
//// 'low_stock_date' => strtotime('now')
|
| 86 |
+
// 'low_stock_date' => '2016-08-11 21:11:38'
|
| 87 |
+
// ));
|
| 88 |
+
|
| 89 |
+
// $stock->setLowStockDate(now())
|
| 90 |
+
// ->setManageStock(0)
|
| 91 |
+
// ->setUseConfigManageStock(0)
|
| 92 |
+
// ->setUseConfigMinSaleQty(1)
|
| 93 |
+
// ->setUseConfigMaxSaleQty(1)
|
| 94 |
+
// ->setUseConfigEnableQtyIncrements(1);
|
| 95 |
+
//
|
| 96 |
+
// $product->setStockData($stock);
|
| 97 |
+
|
| 98 |
+
try {
|
| 99 |
+
$product->save();
|
| 100 |
+
echo '<p>Produto criado</p>';
|
| 101 |
+
|
| 102 |
+
} catch (Exception $e) {
|
| 103 |
+
echo "<p>{$e->getMessage()}</p>";
|
| 104 |
+
echo "<p>{$e->getTraceAsString()}</p>";
|
| 105 |
+
}
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
public function testeProductAction() {
|
| 109 |
+
$id = Mage::getModel('catalog/product')->getCollection()->getLastItem()->getId();
|
| 110 |
+
$product = Mage::getModel('catalog/product')->load($id);
|
| 111 |
+
$stock = $product->getStockItem();
|
| 112 |
+
|
| 113 |
+
var_dump(get_class($stock));
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
// var_dump($product->getData());
|
| 117 |
+
// var_dump(get_class($stock));
|
| 118 |
+
var_dump($stock->getData());
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
public function authorizeAmountAction() {
|
| 122 |
+
$amount = 1;
|
| 123 |
+
$orderId = 100000068;
|
| 124 |
+
|
| 125 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
| 126 |
+
|
| 127 |
+
try{
|
| 128 |
+
$order->setPaymentAuthorizationAmount($amount);
|
| 129 |
+
$order->save();
|
| 130 |
+
|
| 131 |
+
echo 'success';
|
| 132 |
+
|
| 133 |
+
} catch (Exception $e){
|
| 134 |
+
echo "Error {$e->getMessage()}";
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
}
|
app/code/community/Uecommerce/Mundipagg/controllers/TesteController.php
CHANGED
|
@@ -25,12 +25,20 @@ class Uecommerce_Mundipagg_TesteController extends Uecommerce_Mundipagg_Controll
|
|
| 25 |
}
|
| 26 |
|
| 27 |
public function transactionsAction() {
|
| 28 |
-
$
|
| 29 |
-
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
| 34 |
}
|
| 35 |
}
|
| 36 |
|
|
@@ -51,7 +59,58 @@ class Uecommerce_Mundipagg_TesteController extends Uecommerce_Mundipagg_Controll
|
|
| 51 |
// }
|
| 52 |
}
|
| 53 |
|
| 54 |
-
public function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
}
|
| 57 |
|
| 25 |
}
|
| 26 |
|
| 27 |
public function transactionsAction() {
|
| 28 |
+
$resource = Mage::getSingleton('core/resource');
|
| 29 |
+
$conn = $resource->getConnection('core_write');
|
| 30 |
+
$query = '
|
| 31 |
+
UPDATE sales_payment_transaction
|
| 32 |
+
SET is_closed = 0
|
| 33 |
+
WHERE transaction_id = 75
|
| 34 |
+
';
|
| 35 |
+
|
| 36 |
+
try {
|
| 37 |
+
$conn->query($query);
|
| 38 |
+
echo 'success';
|
| 39 |
|
| 40 |
+
} catch (Exception $e) {
|
| 41 |
+
echo "Error: " . $e->getMessage();
|
| 42 |
}
|
| 43 |
}
|
| 44 |
|
| 59 |
// }
|
| 60 |
}
|
| 61 |
|
| 62 |
+
public function notificationsAction() {
|
| 63 |
+
$model = Mage::getModel('adminnotification/inbox')
|
| 64 |
+
->getCollection()
|
| 65 |
+
->addFilter('url', 'https://www.magentocommerce.com/magento-connect/mundipagg-payment-gateway.html')
|
| 66 |
+
->setOrder('date_added', 'desc')
|
| 67 |
+
->getLastItem();
|
| 68 |
+
|
| 69 |
+
var_dump($model->getData());
|
| 70 |
+
|
| 71 |
+
// foreach ($model->getCollection() as $item) {
|
| 72 |
+
// var_dump($item->getData());
|
| 73 |
+
// }
|
| 74 |
+
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
public function lastNotifAction() {
|
| 78 |
+
$model = new Uecommerce_Mundipagg_Model_Admin_Notification();
|
| 79 |
+
$data = $model->getLastSavedNotification();
|
| 80 |
+
|
| 81 |
+
var_dump($data->getData());
|
| 82 |
+
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
public function testeRedirectAction() {
|
| 86 |
+
$this->_redirect('mundipagg/standard/cancel');
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
public function attributeAction() {
|
| 90 |
+
$attributeCodes = array('mundipagg_frequency_enum', 'mundipagg_recurrences');
|
| 91 |
+
|
| 92 |
+
foreach ($attributeCodes as $attributeCode) {
|
| 93 |
+
try {
|
| 94 |
+
$attribute = new Mage_Eav_Model_Entity_Attribute();
|
| 95 |
+
$attribute->loadByCode(Mage_Catalog_Model_Product::ENTITY, $attributeCode);
|
| 96 |
+
|
| 97 |
+
$attribute->setIsRequired(false);
|
| 98 |
+
$attribute->save();
|
| 99 |
+
|
| 100 |
+
var_dump($attribute->getData());
|
| 101 |
+
|
| 102 |
+
} catch (Exception $e) {
|
| 103 |
+
echo $e->getMessage();
|
| 104 |
+
|
| 105 |
+
return;
|
| 106 |
+
}
|
| 107 |
+
}
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
public function invoiceAction() {
|
| 111 |
+
$invoice = Mage::getModel('sales/order_invoice')->loadByIncrementId(100000003);
|
| 112 |
+
|
| 113 |
+
var_dump($invoice->getData());
|
| 114 |
|
| 115 |
}
|
| 116 |
|
app/code/community/Uecommerce/Mundipagg/etc/config.xml
CHANGED
|
@@ -32,7 +32,7 @@
|
|
| 32 |
<config>
|
| 33 |
<modules>
|
| 34 |
<Uecommerce_Mundipagg>
|
| 35 |
-
<version>2.7.
|
| 36 |
</Uecommerce_Mundipagg>
|
| 37 |
</modules>
|
| 38 |
|
| 32 |
<config>
|
| 33 |
<modules>
|
| 34 |
<Uecommerce_Mundipagg>
|
| 35 |
+
<version>2.7.1</version>
|
| 36 |
</Uecommerce_Mundipagg>
|
| 37 |
</modules>
|
| 38 |
|
app/design/adminhtml/default/default/template/mundipagg/payment/info/mundipagg.phtml
CHANGED
|
@@ -30,22 +30,22 @@
|
|
| 30 |
|
| 31 |
$helper = Mage::helper('mundipagg');
|
| 32 |
|
| 33 |
-
if(Mage::registry('current_order')):
|
| 34 |
-
|
| 35 |
endif;
|
| 36 |
|
| 37 |
-
if(Mage::registry('current_invoice')):
|
| 38 |
-
|
| 39 |
endif;
|
| 40 |
|
| 41 |
-
if(Mage::registry('current_shipment')):
|
| 42 |
-
|
| 43 |
endif;
|
| 44 |
|
| 45 |
-
if(Mage::registry('current_creditmemo')):
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
endif;
|
| 50 |
|
| 51 |
$standard = Mage::getModel('mundipagg/standard');
|
|
@@ -53,182 +53,194 @@ $standard = Mage::getModel('mundipagg/standard');
|
|
| 53 |
$paymentAction = $standard->getPaymentAction();
|
| 54 |
|
| 55 |
if ($paymentAction == 'authorize') {
|
| 56 |
-
|
| 57 |
}
|
| 58 |
?>
|
| 59 |
<div>
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 234 |
</div>
|
| 30 |
|
| 31 |
$helper = Mage::helper('mundipagg');
|
| 32 |
|
| 33 |
+
if (Mage::registry('current_order')):
|
| 34 |
+
$_order = $this->getOrder();
|
| 35 |
endif;
|
| 36 |
|
| 37 |
+
if (Mage::registry('current_invoice')):
|
| 38 |
+
$_order = $this->getInvoice()->getOrder();
|
| 39 |
endif;
|
| 40 |
|
| 41 |
+
if (Mage::registry('current_shipment')):
|
| 42 |
+
$_order = $this->getShipment()->getOrder();
|
| 43 |
endif;
|
| 44 |
|
| 45 |
+
if (Mage::registry('current_creditmemo')):
|
| 46 |
+
$data = Mage::registry('current_creditmemo')->getData();
|
| 47 |
+
|
| 48 |
+
$_order = Mage::getModel('sales/order')->load($data['order_id']);
|
| 49 |
endif;
|
| 50 |
|
| 51 |
$standard = Mage::getModel('mundipagg/standard');
|
| 53 |
$paymentAction = $standard->getPaymentAction();
|
| 54 |
|
| 55 |
if ($paymentAction == 'authorize') {
|
| 56 |
+
$paymentAction = 'authorization';
|
| 57 |
}
|
| 58 |
?>
|
| 59 |
<div>
|
| 60 |
+
<p>
|
| 61 |
+
<?php
|
| 62 |
+
$PaymentMethod = $_order->getPayment()->getAdditionalInformation('PaymentMethod');
|
| 63 |
+
|
| 64 |
+
echo $helper->__('Method') . ': ' . $helper->__($PaymentMethod) . '<br/>';
|
| 65 |
+
|
| 66 |
+
$orderKeys = (array)$orderKeys = $_order->getPayment()->getAdditionalInformation('OrderKey');
|
| 67 |
+
$orderKeysQty = count($orderKeys);
|
| 68 |
+
|
| 69 |
+
if ($orderKeysQty > 0):
|
| 70 |
+
if ($orderKeysQty == 1):
|
| 71 |
+
echo "{$helper->__('OrderKey')}: {$orderKeys[0]}<br>";
|
| 72 |
+
else:
|
| 73 |
+
echo "{$helper->__('OrderKeys')}:<br>";
|
| 74 |
+
|
| 75 |
+
foreach ($orderKeys as $orderKey):
|
| 76 |
+
echo "$orderKey<br>";
|
| 77 |
+
endforeach;
|
| 78 |
+
|
| 79 |
+
endif;
|
| 80 |
+
|
| 81 |
+
if ($OrderReference = $_order->getPayment()->getAdditionalInformation('OrderReference')):
|
| 82 |
+
echo $helper->__('OrderReference') . ': ' . $OrderReference . '<br/>';
|
| 83 |
+
endif;
|
| 84 |
+
endif;
|
| 85 |
+
|
| 86 |
+
// Informations about transaction
|
| 87 |
+
$transaction = Mage::getModel('sales/order_payment_transaction')->getCollection()
|
| 88 |
+
->addAttributeToFilter('order_id', array('eq' => $_order->getEntityId()))
|
| 89 |
+
->addAttributeToFilter('txn_type', array('eq' => $paymentAction));
|
| 90 |
+
$authCode = '';
|
| 91 |
+
$tid = '';
|
| 92 |
+
$ccNumber = '';
|
| 93 |
+
$message = '';
|
| 94 |
+
|
| 95 |
+
foreach ($transaction as $t) :
|
| 96 |
+
$t = $t->getData();
|
| 97 |
+
$txDetail = $t['additional_information'];
|
| 98 |
+
|
| 99 |
+
if (!empty($txDetail)):
|
| 100 |
+
$authCode = isset($txDetail['AuthorizationCode']) ? $txDetail['AuthorizationCode'] : null;
|
| 101 |
+
$tid = isset($txDetail['TransactionIdentifier']) ? $txDetail['TransactionIdentifier'] : null;
|
| 102 |
+
$ccNumber = isset($txDetail['MaskedCreditCardNumber']) ? $txDetail['MaskedCreditCardNumber'] : null;
|
| 103 |
+
|
| 104 |
+
if (isset($txDetail['CreditCardNumber'])) {
|
| 105 |
+
$ccNumber = $txDetail['CreditCardNumber'];
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
$message = isset($txDetail['AcquirerMessage']) ? $txDetail['AcquirerMessage'] : null;
|
| 109 |
+
endif;
|
| 110 |
+
endforeach;
|
| 111 |
+
|
| 112 |
+
if ($PaymentMethod == '1CreditCards' || $PaymentMethod == 'mundipagg_creditcard'):
|
| 113 |
+
// Token
|
| 114 |
+
$token = $this->getInfo()->getAdditionalInformation('mundipagg_creditcard_token_1_1');
|
| 115 |
+
|
| 116 |
+
if ($token && $token != 'new'):
|
| 117 |
+
echo $helper->__('Credit Card Issuer') . ': ';
|
| 118 |
+
echo $this->getInfo()->getAdditionalInformation('CreditCardBrandEnum_mundipagg_creditcard_token_1_1');
|
| 119 |
+
echo '<br/>';
|
| 120 |
+
if ($ccNumber) echo 'Numeração: ' . $ccNumber . '<br>';
|
| 121 |
+
|
| 122 |
+
if ($this->getInfo()->getAdditionalInformation('mundipagg_creditcard_credito_parcelamento_1_1')):
|
| 123 |
+
echo $helper->__('InstallmentsCount') . ': ';
|
| 124 |
+
echo $this->getInfo()->getAdditionalInformation('mundipagg_creditcard_credito_parcelamento_1_1');
|
| 125 |
+
echo 'x<br/>';
|
| 126 |
+
endif;
|
| 127 |
+
else:
|
| 128 |
+
echo $helper->__('Credit Card Issuer') . ': ';
|
| 129 |
+
echo $this->getInfo()->getAdditionalInformation('mundipagg_creditcard_1_1_cc_type');
|
| 130 |
+
echo '<br/>';
|
| 131 |
+
if ($ccNumber) echo 'Numeração: ' . $ccNumber . '<br>';
|
| 132 |
+
|
| 133 |
+
if ($this->getInfo()->getAdditionalInformation('mundipagg_creditcard_new_credito_parcelamento_1_1')):
|
| 134 |
+
echo $helper->__('InstallmentsCount') . ': ';
|
| 135 |
+
echo $this->getInfo()->getAdditionalInformation('mundipagg_creditcard_new_credito_parcelamento_1_1');
|
| 136 |
+
echo 'x<br/>';
|
| 137 |
+
endif;
|
| 138 |
+
endif;
|
| 139 |
+
|
| 140 |
+
if ($authCode):
|
| 141 |
+
echo 'Autorização: <b>' . $authCode . '</b><br/>';
|
| 142 |
+
endif;
|
| 143 |
+
|
| 144 |
+
if ($tid):
|
| 145 |
+
echo 'ID da Transação: ' . $tid . '<br/>';
|
| 146 |
+
endif;
|
| 147 |
+
|
| 148 |
+
if ($message):
|
| 149 |
+
echo 'Retorno adquirente: ' . $message . '<br/>';
|
| 150 |
+
endif;
|
| 151 |
+
|
| 152 |
+
if ($CreditCardTransactionStatusEnum = $_order->getPayment()->getAdditionalInformation('1_CreditCardTransactionStatusEnum')):
|
| 153 |
+
echo $helper->__('Transaction Status') . ': ' . $CreditCardTransactionStatusEnum . '<br/>';
|
| 154 |
+
else:
|
| 155 |
+
if ($CreditCardTransactionStatusEnum = $_order->getPayment()->getAdditionalInformation('CreditCardTransactionStatusEnum')):
|
| 156 |
+
echo $helper->__('Transaction Status') . ': ' . $CreditCardTransactionStatusEnum . '<br/>';
|
| 157 |
+
endif;
|
| 158 |
+
endif;
|
| 159 |
+
endif;
|
| 160 |
+
|
| 161 |
+
if ($PaymentMethod == 'mundipagg_creditcardoneinstallment'):
|
| 162 |
+
// Token
|
| 163 |
+
$token = $this->getInfo()->getAdditionalInformation('mundipagg_creditcardoneinstallment_token_1_1');
|
| 164 |
+
|
| 165 |
+
if ($token && $token != 'new'):
|
| 166 |
+
echo $helper->__('Credit Card Issuer') . ': ';
|
| 167 |
+
echo $this->getInfo()->getAdditionalInformation('CreditCardBrandEnum_mundipagg_creditcardoneinstallment_token_1_1');
|
| 168 |
+
echo '<br/>';
|
| 169 |
+
?>
|
| 170 |
+
<?php
|
| 171 |
+
else:
|
| 172 |
+
echo $helper->__('Credit Card Issuer') . ': ';
|
| 173 |
+
echo $this->getInfo()->getAdditionalInformation('mundipagg_creditcardoneinstallment_1_1_cc_type');
|
| 174 |
+
echo '<br/>';
|
| 175 |
+
endif;
|
| 176 |
+
|
| 177 |
+
if ($authCode):
|
| 178 |
+
echo $helper->__('Autorização') . ': ' . $authCode . '<br/>';
|
| 179 |
+
endif;
|
| 180 |
+
|
| 181 |
+
if ($tid):
|
| 182 |
+
echo $helper->__('Nosso Número') . ': ' . $tid . '<br/>';
|
| 183 |
+
endif;
|
| 184 |
+
|
| 185 |
+
if ($message):
|
| 186 |
+
echo 'Retorno adquirente: ' . $message . '<br/>';
|
| 187 |
+
endif;
|
| 188 |
+
|
| 189 |
+
if ($CreditCardTransactionStatusEnum = $_order->getPayment()->getAdditionalInformation('1_CreditCardTransactionStatusEnum')):
|
| 190 |
+
echo $helper->__('Transaction Status') . ': ' . $CreditCardTransactionStatusEnum . '<br/>';
|
| 191 |
+
else:
|
| 192 |
+
if ($CreditCardTransactionStatusEnum = $_order->getPayment()->getAdditionalInformation('CreditCardTransactionStatusEnum')):
|
| 193 |
+
echo $helper->__('Transaction Status') . ': ' . $CreditCardTransactionStatusEnum . '<br/>';
|
| 194 |
+
endif;
|
| 195 |
+
endif;
|
| 196 |
+
endif;
|
| 197 |
+
|
| 198 |
+
if (($PaymentMethod == 'BoletoBancario' || $PaymentMethod == 'mundipagg_boleto') && $boletoUrl = $_order->getPayment()->getAdditionalInformation('BoletoUrl')):
|
| 199 |
+
|
| 200 |
+
// Informations about transaction
|
| 201 |
+
if (version_compare(Mage::getVersion(), '1.5.0', '<')) {
|
| 202 |
+
$transactionType = 'payment';
|
| 203 |
+
} else {
|
| 204 |
+
$transactionType = Mage_Sales_Model_Order_Payment_Transaction::TYPE_ORDER;
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
$transaction = Mage::getModel('sales/order_payment_transaction')->getCollection()
|
| 208 |
+
->addAttributeToFilter('order_id', array('eq' => $_order->getEntityId()))
|
| 209 |
+
->addAttributeToFilter('txn_type', array('eq' => $transactionType))
|
| 210 |
+
->addAttributeToFilter('is_closed', array('eq' => '1'));
|
| 211 |
+
$nossoNumero = '';
|
| 212 |
+
$barcode = '';
|
| 213 |
+
|
| 214 |
+
foreach ($transaction as $t):
|
| 215 |
+
$t = $t->getData();
|
| 216 |
+
$txDetail = $t['additional_information'];
|
| 217 |
+
|
| 218 |
+
if (!empty($txDetail)):
|
| 219 |
+
$nossoNumero = $txDetail['NossoNumero'];
|
| 220 |
+
$barcode = $txDetail['Barcode'];
|
| 221 |
+
endif;
|
| 222 |
+
endforeach;
|
| 223 |
+
?>
|
| 224 |
+
<p>
|
| 225 |
+
<?php echo $helper->__('Nosso Número'); ?>: <b><?php echo $nossoNumero; ?></b>
|
| 226 |
+
</p>
|
| 227 |
+
<p>
|
| 228 |
+
<?php echo $helper->__('Código de Barras'); ?>: <?php echo $barcode; ?>
|
| 229 |
+
</p>
|
| 230 |
+
<p>
|
| 231 |
+
<a href="<?php echo $boletoUrl; ?>" target="_blank"><?php echo $helper->__('Print boleto'); ?></a>
|
| 232 |
+
</p>
|
| 233 |
+
<?php
|
| 234 |
+
endif;
|
| 235 |
+
|
| 236 |
+
if ($PaymentMethod == 'mundipagg_debit'):
|
| 237 |
+
$bankName = $this->getInfo()->getAdditionalInformation('BankName');
|
| 238 |
+
$bankPaymentDate = $this->getInfo()->getAdditionalInformation('BankPaymentDate');
|
| 239 |
+
?>
|
| 240 |
+
<?php if ($bankName): echo $helper->__('Banco'); ?>: <?php echo $bankName; endif; ?>
|
| 241 |
+
<?php if ($bankPaymentDate): echo $helper->__('Data de pagamento'); ?>: <?php echo $bankPaymentDate; endif; ?>
|
| 242 |
+
<?php
|
| 243 |
+
endif;
|
| 244 |
+
?>
|
| 245 |
+
</p>
|
| 246 |
</div>
|
app/design/frontend/base/default/template/mundipagg/partial.phtml
CHANGED
|
@@ -33,11 +33,12 @@
|
|
| 33 |
</div>
|
| 34 |
<?php
|
| 35 |
$_coreHelper = $this->helper('core');
|
| 36 |
-
$
|
|
|
|
| 37 |
$restToPay = 0;
|
| 38 |
|
| 39 |
// Session
|
| 40 |
-
$authorizedAmount =
|
| 41 |
|
| 42 |
$restToPay = $orderGrandTotal - $authorizedAmount;
|
| 43 |
|
| 33 |
</div>
|
| 34 |
<?php
|
| 35 |
$_coreHelper = $this->helper('core');
|
| 36 |
+
$order = $this->getOrder();
|
| 37 |
+
$orderGrandTotal = $order->getGrandTotal();
|
| 38 |
$restToPay = 0;
|
| 39 |
|
| 40 |
// Session
|
| 41 |
+
$authorizedAmount = $order->getPaymentAuthorizationAmount();
|
| 42 |
|
| 43 |
$restToPay = $orderGrandTotal - $authorizedAmount;
|
| 44 |
|
app/locale/pt_BR/Uecommerce_Mundipagg.csv
CHANGED
|
@@ -89,6 +89,7 @@
|
|
| 89 |
"Method","Método"
|
| 90 |
"Payment Method","Método de pagamento"
|
| 91 |
"OrderKey","Chave do pedido"
|
|
|
|
| 92 |
"Credit Card Issuer","Bandeira"
|
| 93 |
"Transaction Status","Status da transação"
|
| 94 |
"AuthorizedPendingCapture","AuthorizedPendingCapture"
|
| 89 |
"Method","Método"
|
| 90 |
"Payment Method","Método de pagamento"
|
| 91 |
"OrderKey","Chave do pedido"
|
| 92 |
+
"OrderKeys","Chaves do pedido"
|
| 93 |
"Credit Card Issuer","Bandeira"
|
| 94 |
"Transaction Status","Status da transação"
|
| 95 |
"AuthorizedPendingCapture","AuthorizedPendingCapture"
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Mundipagg_Integracao</name>
|
| 4 |
-
<version>2.7.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>MIT</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -12,12 +12,13 @@ Mundipagg payment gateway integration.</summary>
|
|
| 12 |
<description>Com esta extensão você poderá integrar sua loja Magento com o gateway de pagamentos MundiPagg.
|
| 13 |

|
| 14 |
With this extension you can process payments through brazilian payment gateway Mundipagg</description>
|
| 15 |
-
<notes
|
| 16 |
-
|
|
|
|
| 17 |
<authors><author><name>MundiPagg</name><user>MundiPagg</user><email>mundi@mundipagg.com</email></author></authors>
|
| 18 |
-
<date>2016-08-
|
| 19 |
-
<time>
|
| 20 |
-
<contents><target name="magecommunity"><dir name="Uecommerce"><dir name="Mundipagg"><dir name="Block"><dir name="Adminhtml"><dir name="Form"><dir name="Field"><file name="Installments.php" hash="ec8343e197cb194d978400bbdf64d446"/></dir></dir><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><file name="Totals.php" hash="2140a7836eaa57e03727433ccddf93d6"/></dir><dir name="Invoice"><file name="Totals.php" hash="ee304d9034ae0763e5db464f933b8c27"/><file name="View.php" hash="b0e3c170cd0184a5dfbe4fa7a486b471"/></dir><file name="Totals.php" hash="71b20a4c0022c14a5f7f8d008aabe1da"/></dir><dir name="Transactions"><dir name="Detail"><file name="Grid.php" hash="d67911c431587e4327eec95540cf548a"/></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><file name="Button.php" hash="aa40a974b89c92ea9652c42e093d16f9"/></dir></dir></dir><file name="Version.php" hash="e3a89823e48e7a526a3afe8ce8c0d0ee"/></dir><dir name="Checkout"><dir name="Onepage"><dir name="Payment"><file name="Methods.php" hash="c903e413c47e3dea87ec09d609543a27"/></dir></dir></dir><file name="Info.php" hash="c5743b8887caffc12ee2b502d7256101"/><file name="Parcelamento.php" hash="bbfad3557dd7c29e2a21a213cf915e0c"/><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><file name="Totals.php" hash="be3e89b0e2f008fcc0293286d44df7da"/></dir><dir name="Invoice"><file name="Totals.php" hash="a39c41f45ef44b72d15cfd12fea4e9c6"/></dir><file name="Totals.php" hash="6f56aa360f48c715b30afd4e5cd4ddfa"/></dir></dir><dir name="Standard"><file name="Boleto.php" hash="4471015b8a82311f84e52e774460bf38"/><file name="Cancel.php" hash="095eaf31c6567fad440279aeb2994caa"/><file name="Debit.php" hash="c707d9572b6079457b9265cc09c920c6"/><file name="Fcancel.php" hash="4bc5b0fb68fb7fd11159788eafe958af"/><file name="Form.php" hash="0f7f97654c5e819ac178e5d888fae6ee"/><file name="Partial.php" hash="fb5877a8f6c56ac1d6fc48eb864d8e60"/><file name="Redirect.php" hash="70f576c8d64c25e3ce627f6c36b2ff41"/><file name="Success.php" hash="b1b0bef88ed350d703da0e314ffad565"/></dir></dir><dir name="Controller"><file name="Abstract.php" hash="91d5069c18069fcb2a0a436fb768a194"/></dir><dir name="Helper"><file name="Data.php" hash="230133453d65c7e7a7681ba095e5942c"/><file name="Installments.php" hash="3d34c4b9432d09a99e13c7f6b3f657ae"/><file name="Log.php" hash="a95575e22743a7b823ec3f088844f18f"/><file name="Util.php" hash="8d76ffdc3e7ace2598d373f1aef20228"/><file name="Version.php" hash="00066d5bf31a7c49db004f2bd0d5c462"/></dir><dir name="Model"><file name="Api.php" hash="509cdc4f6e35ab0ed7e4f0d734df9b90"/><file name="Boleto.php" hash="a7da1d58eb0fccb53eae51ba97d93dc5"/><file name="Cardonfile.php" hash="98395928a16313f8b4127e4e210cf953"/><file name="Creditcard.php" hash="007a43e7530ea5471b6a9aaa5405ce21"/><file name="Creditcardoneinstallment.php" hash="2e4222fd04dbc4f5ee116d4d7f4eae04"/><dir name="Customer"><file name="Session.php" hash="7f15498648de23cf4feb5143071ec260"/></dir><file name="Customers.php" hash="a779e96a969b83d1b38df351eb4670d0"/><file name="Debit.php" hash="8a3387bf74b1f03b9614fbdb64ab9dd5"/><dir name="Enum"><file name="BoletoTransactionStatusEnum.php" hash="3fed0a36bb76497b85c50016af34d47a"/><file name="CreditCardTransactionStatusEnum.php" hash="4546716f63e6df57061b222002157ccd"/><file name="OrderStatusEnum.php" hash="fd42020aab9d5507b5e0c26957cd1abb"/><file name="TransactionTypeEnum.php" hash="52fc4049a9f2b120ad3ed99e296268f9"/></dir><file name="Fivecreditcards.php" hash="6975e6170345bb3f20fde79ae40b81fe"/><file name="Fourcreditcards.php" hash="2da3d901173c19e53a96adb197b1533a"/><file name="Observer.php" hash="31cb523cdaff0aa82bbc4eff02d1e45c"/><file name="Offlineretry.php" hash="394849df4873908dd43d3c15f75dc9d0"/><dir name="Order"><dir name="Invoice"><file name="Interest.php" hash="6bba5e87bae1a7ee94a827819b2ea4ce"/></dir></dir><file name="Providervalidation.php" hash="4906944bae20e3f683d6e5c4ba5304e3"/><dir name="Quote"><dir name="Address"><file name="Interest.php" hash="93aa0189a8556597697dbb239dbf3be7"/></dir></dir><file name="Recurrency.php" hash="76bb429ac4c849e27c8fabdd96bb9654"/><dir name="Resource"><dir name="Cardonfile"><file name="Collection.php" hash="7b7d13bc6d7be8e5e1c5f945d59117f6"/></dir><file name="Cardonfile.php" hash="47d0107a9b1c3415aaf8784298361e84"/><dir name="Customers"><file name="Collection.php" hash="6caadd817abbcda527ba6d102585f2ff"/></dir><file name="Customers.php" hash="f50289a4c8362ddf7a79e4aa7c8a6387"/><dir name="Offlineretry"><file name="Collection.php" hash="80f0689c66a30110e68c2fdafb3014a8"/></dir><file name="Offlineretry.php" hash="08c804fd3b001f4f3ac19ebbcfca59fb"/><file name="Setup.php" hash="42bda31d8497e1b0983775e17f7325a5"/></dir><dir name="Source"><file name="Antifraud.php" hash="8362e0bb2209bbf904a7f9b2edd59cee"/><file name="Banks.php" hash="b5d456a807cdf750a6458144e955cf2c"/><file name="CctypeProductInstallments.php" hash="7837f6865c905ba8f5393d080ebc1b3d"/><file name="Cctypes.php" hash="b55eb988a6a09f24b1088f15644961d0"/><file name="Debit.php" hash="9366bc3b900cf96ad5d2bce7e8d93ba7"/><file name="Environment.php" hash="099a28ea462481333437a6479276e8b0"/><file name="FControlEnvironment.php" hash="5159f6e4d86ee9d280285b7198fa01e9"/><file name="Frequency.php" hash="7864991042d0ec3fd5920d9047127b14"/><file name="Installments.php" hash="b04c05b92f7b8b5c025f23aad4457917"/><file name="PaymentAction.php" hash="c16639be23fd85c285f474922fd528a7"/><file name="PaymentMethods.php" hash="e12514ad00bf3fe3fb4e569b11da2c10"/></dir><file name="Standard.php" hash="f1c096a26841a0d05cc20926742e5c71"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="Installments.php" hash="f0901bf05acd0b2c3fda41965f949583"/></dir></dir></dir><file name="Threecreditcards.php" hash="73fcdc4ef1dd38128b60454f90184ff5"/><file name="Twocreditcards.php" hash="c010f631d556a08d2d1aa65dc6b60703"/><file name="Urlvalidation.php" hash="5cd63e613625e76f3b2f1efe78657c5d"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="Test"><dir name="Selenium"><file name="Abstract.php" hash="caf0cd5ca47b13fb00be4230d1bb9132"/><file name="BoletoTest.php" hash="0718dc551376686dc6daaa3b57ddd1f9"/><dir name="CcTypes"><file name="CreditcardTest.php" hash="fde35369e57eb70f29f8defe1d7f06af"/><file name="CreditcardoneinstallmentTest.php" hash="cabcf9a3f56497e32679c1d2d063a6d7"/><file name="FivecreditcardsTest.php" hash="a903b89e20b9e754df7ed22dc9e8eecf"/><file name="FourcheditcardsTest.php" hash="3619a03b24af1a768cbc87be430b4323"/><file name="ThreecreditcardsTest.php" hash="d59c7b8a7de6320cff170e435fbe6e9e"/><file name="TwocreditcardsTest.php" hash="58db59f790aa7c65a324e6a552c2e05c"/></dir><file name="CcTypes.php" hash="de1d2e73a74e4b9fcde14adce60c0f82"/><file name="DebitTest.php" hash="1409a8f2de15e13792dcba2099a887cc"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="e5a51c9660f704bcbfb302d34493a5a6"/></dir><file name="ClearsaleController.php" hash="bc06365f0d577d66228d9f0c3e471089"/><file name="FcontrolController.php" hash="1af534f1cdadbfdbe702aed12c7a2e1d"/><file name="StandardController.php" hash="b295ebeef3718926839cff25f63ccbd4"/><file name="StoneController.php" hash="80c6f59a868ac82fc22bcf586bbecfdd"/><file name="TesteController.php" hash="f55896ceaef8d059b97a99662ce4b5ab"/></dir><dir name="etc"><file name="config.xml" hash="a91003cb9df881c26df880d5ff835285"/><file name="jstranslator.xml" hash="8b1ea10d9b3072a795567dba6dae938c"/><file name="system.xml" hash="ccb863e06b6b1c7c279b3edfd4992184"/><file name="wsdl.xml" hash="a59b87019a8bdb03d97191e2d06be325"/><file name="xtest.xml" hash="b34ee3b6e37a890b73374b5ea3a1c40f"/></dir><dir name="sql"><dir name="mundipagg_setup"><file name="install-0.3.0.php" hash="ede73bb07d71fec55340c4249ff4a258"/><file name="mysql4-upgrade-0.3.0-0.3.5.php" hash="d3c200cce4a814feaa0858c0c8abd928"/><file name="mysql4-upgrade-0.3.5-0.4.0.php" hash="297f1b37b7703f7a0d621d227c8cbeb9"/><file name="mysql4-upgrade-0.3.5-1.0.1.php" hash="d22a0a81e392885433ca58dc196c2a86"/><file name="mysql4-upgrade-0.4.0-1.0.1.php" hash="297f1b37b7703f7a0d621d227c8cbeb9"/><file name="mysql4-upgrade-0.4.1-0.4.2.php" hash="4a2962a1eb974c75e153f48cc77f00d4"/><file name="mysql4-upgrade-0.4.1-1.0.1.php" hash="d22a0a81e392885433ca58dc196c2a86"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="297f1b37b7703f7a0d621d227c8cbeb9"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-1.0.10-1.0.11.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-1.0.11-2.0.0.php" hash="83c95c6060bb8678be3b8944a6823fd9"/><file name="mysql4-upgrade-1.0.2-1.0.3.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-1.0.3-1.0.4.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-1.0.4-1.0.5.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-1.0.5-1.0.6.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-1.0.6-1.0.7.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-1.0.7-1.0.8.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-1.0.8-1.0.9.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-1.0.9-1.0.10.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-2.0.0-2.0.1.php" hash="a437df63647a52381ed5e056ccbb0cff"/><file name="mysql4-upgrade-2.0.0-2.1.0.php" hash="30dc2c3c763893d3bac6b9fde0c56477"/><file name="mysql4-upgrade-2.0.1-2.0.2.php" hash="4959ae51e69913d8ac642bc2ab848464"/><file name="mysql4-upgrade-2.0.2-2.0.3.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-2.0.3-2.0.4.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-2.0.4-2.0.5.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-2.0.5-2.0.6.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-2.0.6-2.0.7.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-2.0.7-2.0.8.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-2.0.8-2.0.9.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-2.0.9-2.1.0.php" hash="3488f42f3d9e6a57ce4176c0a7954171"/><file name="mysql4-upgrade-2.1.2-2.1.3.php" hash="7d7823cb555a32295d179a96e2bf987a"/><file name="mysql4-upgrade-2.5.7-2.5.8.php" hash="45c4f1fd5336b7ce578c672e8f1d57b0"/><file name="mysql4-upgrade-2.5.8-2.6.0.php" hash="bf06e3d6ab5fa0c89629385db4231006"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mundipagg.xml" hash="b6677c25d67015f895a72afbca87041c"/></dir><dir name="template"><dir name="mundipagg"><file name="boleto.phtml" hash="11cc5b254644727d6bdded8a834965c7"/><file name="form.phtml" hash="566e1838cab471ce41a1f74156e3b3bf"/><dir name="payment"><dir name="info"><file name="mundipagg.phtml" hash="608c6f547291d4d2d703615784f44403"/></dir></dir><dir name="system"><dir name="config"><file name="button.phtml" hash="6a7f6c88cf156d31d34a818ac37bd158"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="mundipagg.xml" hash="c2ebd0374a3c6a6a4d8c3db84c8abf5a"/></dir><dir name="template"><dir name="mundipagg"><dir name="antifraud"><file name="clearsale.phtml" hash="088a189dd94401f39c90ad0a1471994f"/><file name="fcontrol.phtml" hash="1c84a81343591e6afec7a7d8d2549410"/><file name="stone.phtml" hash="681ddf22694c725bb6e84e79681936fa"/></dir><file name="boleto.phtml" hash="dc31735a2753812d36e3080bf5b01ac2"/><file name="cancel.phtml" hash="540639b1ccd698397286f668bbf23746"/><file name="debit.phtml" hash="78f60f0227e99ff0c1d7dbf6bd5aa202"/><file name="extras.phtml" hash="f3eba84e971e890922141d90f6bdd53f"/><file name="fcancel.phtml" hash="9ce1d7634acf519669e21978b41aa277"/><file name="form.phtml" hash="faff82dad9768f016f81648aa8b9b800"/><file name="parcelamento.phtml" hash="56a89503637e5ad753b0d410f2f5c7ad"/><file name="partial.phtml" hash="6f01f6950ca176748939559e0e4ec487"/><dir name="payment"><dir name="info"><file name="mundipagg.phtml" hash="c110a21db08013d38add1b79977350e4"/></dir></dir><file name="redirect.phtml" hash="a8a1123eab776934c64f57b4f9cfd517"/><file name="success.phtml" hash="7afd82f246fdf50f9a72ebb15086a2b6"/><file name="totals.phtml" hash="5a78aa3fe60d4b13bf8451f23bb9edd9"/></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="template"><dir name="mundipagg"><file name="debit.phtml" hash="4d2ae58447d3893499556ae068f800f8"/><file name="form.phtml" hash="dd83f04f33982e17fdea1713a3eb1b3a"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Uecommerce_Mundipagg.xml" hash="b292eeabde8e2cd06db0c31aff54fd98"/></dir></target><target name="mage"><dir name="js"><dir name="uecommerce"><file name="mundipagg.js" hash="c887a21c210250da640bafce773e43ab"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="mundipagg"><file name="ajax-loader.gif" hash="7b9776076d5fceef4993b55c9383dedd"/><file name="boleto.jpg" hash="237570c55c811b4b13f73ab92f28e599"/><file name="mundipagg-avatar-blue.png" hash="9e81f9c54ac7ce3de570d7065f4b4c07"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="mundipagg.css" hash="90c32001f3a9b858c9506f5135c04972"/></dir><dir name="images"><dir name="mundipagg"><file name="001.png" hash="25d10d6fee7fc3e5dc48021a15de8fb0"/><file name="237.png" hash="cbea9caff342edd9b9b9509bbbbae6fb"/><file name="341.png" hash="3645161fc56322ec34ebfcc006390e5d"/><file name="AE.png" hash="40ea216476033961d50f452bf4bca4df"/><file name="DI.png" hash="0f4264379e7b8ba6b1a30a3d69240ae2"/><file name="EL.png" hash="ad180c308d285f73fc044121cb6aeac0"/><file name="HI.png" hash="c25430ddd8e441cc2fc3ef68219e7668"/><file name="MC.png" hash="836466c092121163320e9e6279f11f8b"/><file name="VBV.jpg" hash="1a7db765956829e80715a299b799f580"/><file name="VBV.png" hash="d6fb7de65fda842f03e2b9fc89d5e6aa"/><file name="VI.png" hash="cc0709d50773fa2815f7bfeb741a4219"/><file name="ajax-loader.gif" hash="7b9776076d5fceef4993b55c9383dedd"/><file name="boleto.jpg" hash="237570c55c811b4b13f73ab92f28e599"/><file name="cc_types.png" hash="fdae60f96ee668354161b5a865b8e7ef"/><file name="cielo_mastercard.png" hash="e2c2af12ea24f1b82490fdcc62fbb871"/><file name="cielo_visa.png" hash="d2f0c660714dc319b73c0dac9c9108d0"/></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="images"><dir name="mundipagg"><file name="EL.png" hash="ad180c308d285f73fc044121cb6aeac0"/><file name="HI.png" hash="c25430ddd8e441cc2fc3ef68219e7668"/><file name="ae.png" hash="40ea216476033961d50f452bf4bca4df"/><file name="boleto.jpg" hash="237570c55c811b4b13f73ab92f28e599"/><file name="cielo_mastercard.png" hash="e2c2af12ea24f1b82490fdcc62fbb871"/><file name="cielo_visa.png" hash="d2f0c660714dc319b73c0dac9c9108d0"/><file name="di.png" hash="0f4264379e7b8ba6b1a30a3d69240ae2"/><file name="mc.png" hash="836466c092121163320e9e6279f11f8b"/><file name="vi.png" hash="cc0709d50773fa2815f7bfeb741a4219"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Uecommerce_Mundipagg.csv" hash="ae581dc54ea4ada4a9a3c9f4c51f09c7"/></dir><dir name="pt_BR"><file name="Uecommerce_Mundipagg.csv" hash="a9e68878dcac2b008a7e46350952a8a1"/></dir></target></contents>
|
| 21 |
<compatible/>
|
| 22 |
<dependencies><required><php><min>5.1.0</min><max>7.9.99</max></php></required></dependencies>
|
| 23 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Mundipagg_Integracao</name>
|
| 4 |
+
<version>2.7.1</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>MIT</license>
|
| 7 |
<channel>community</channel>
|
| 12 |
<description>Com esta extensão você poderá integrar sua loja Magento com o gateway de pagamentos MundiPagg.
|
| 13 |

|
| 14 |
With this extension you can process payments through brazilian payment gateway Mundipagg</description>
|
| 15 |
+
<notes>Multi creditcards fix;
|
| 16 |
+

|
| 17 |
+
Installments fix.</notes>
|
| 18 |
<authors><author><name>MundiPagg</name><user>MundiPagg</user><email>mundi@mundipagg.com</email></author></authors>
|
| 19 |
+
<date>2016-08-31</date>
|
| 20 |
+
<time>23:29:21</time>
|
| 21 |
+
<contents><target name="magecommunity"><dir name="Uecommerce"><dir name="Mundipagg"><dir name="Block"><dir name="Adminhtml"><dir name="Form"><dir name="Field"><file name="Installments.php" hash="ec8343e197cb194d978400bbdf64d446"/></dir></dir><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><file name="Totals.php" hash="2140a7836eaa57e03727433ccddf93d6"/></dir><dir name="Invoice"><file name="Totals.php" hash="ee304d9034ae0763e5db464f933b8c27"/><file name="View.php" hash="b0e3c170cd0184a5dfbe4fa7a486b471"/></dir><file name="Totals.php" hash="71b20a4c0022c14a5f7f8d008aabe1da"/></dir><dir name="Transactions"><dir name="Detail"><file name="Grid.php" hash="d67911c431587e4327eec95540cf548a"/></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><file name="Button.php" hash="aa40a974b89c92ea9652c42e093d16f9"/></dir></dir></dir><file name="Version.php" hash="e3a89823e48e7a526a3afe8ce8c0d0ee"/></dir><dir name="Checkout"><dir name="Onepage"><dir name="Payment"><file name="Methods.php" hash="c903e413c47e3dea87ec09d609543a27"/></dir></dir></dir><file name="Info.php" hash="c5743b8887caffc12ee2b502d7256101"/><file name="Parcelamento.php" hash="bbfad3557dd7c29e2a21a213cf915e0c"/><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><file name="Totals.php" hash="be3e89b0e2f008fcc0293286d44df7da"/></dir><dir name="Invoice"><file name="Totals.php" hash="a39c41f45ef44b72d15cfd12fea4e9c6"/></dir><file name="Totals.php" hash="6f56aa360f48c715b30afd4e5cd4ddfa"/></dir></dir><dir name="Standard"><file name="Boleto.php" hash="4471015b8a82311f84e52e774460bf38"/><file name="Cancel.php" hash="095eaf31c6567fad440279aeb2994caa"/><file name="Debit.php" hash="c707d9572b6079457b9265cc09c920c6"/><file name="Fcancel.php" hash="4bc5b0fb68fb7fd11159788eafe958af"/><file name="Form.php" hash="0f7f97654c5e819ac178e5d888fae6ee"/><file name="Partial.php" hash="fb5877a8f6c56ac1d6fc48eb864d8e60"/><file name="Redirect.php" hash="70f576c8d64c25e3ce627f6c36b2ff41"/><file name="Success.php" hash="b1b0bef88ed350d703da0e314ffad565"/></dir></dir><dir name="Controller"><file name="Abstract.php" hash="91d5069c18069fcb2a0a436fb768a194"/></dir><dir name="Helper"><file name="Data.php" hash="230133453d65c7e7a7681ba095e5942c"/><file name="Installments.php" hash="d95d76587b1af78b0925bbbaf9fc9765"/><file name="Log.php" hash="9f2f3be3c0b86fdee5582bc665a365b5"/><file name="Util.php" hash="8d76ffdc3e7ace2598d373f1aef20228"/><file name="Version.php" hash="00066d5bf31a7c49db004f2bd0d5c462"/></dir><dir name="Model"><file name="Api.php" hash="464ff7622f80eb240a036a6300fc3adc"/><file name="Boleto.php" hash="a7da1d58eb0fccb53eae51ba97d93dc5"/><file name="Cardonfile.php" hash="98395928a16313f8b4127e4e210cf953"/><file name="Creditcard.php" hash="007a43e7530ea5471b6a9aaa5405ce21"/><file name="Creditcardoneinstallment.php" hash="2e4222fd04dbc4f5ee116d4d7f4eae04"/><dir name="Customer"><file name="Session.php" hash="7f15498648de23cf4feb5143071ec260"/></dir><file name="Customers.php" hash="a779e96a969b83d1b38df351eb4670d0"/><file name="Debit.php" hash="8a3387bf74b1f03b9614fbdb64ab9dd5"/><dir name="Enum"><file name="BoletoTransactionStatusEnum.php" hash="3fed0a36bb76497b85c50016af34d47a"/><file name="CreditCardTransactionStatusEnum.php" hash="4546716f63e6df57061b222002157ccd"/><file name="OrderStatusEnum.php" hash="fd42020aab9d5507b5e0c26957cd1abb"/><file name="TransactionTypeEnum.php" hash="52fc4049a9f2b120ad3ed99e296268f9"/></dir><file name="Fivecreditcards.php" hash="6975e6170345bb3f20fde79ae40b81fe"/><file name="Fourcreditcards.php" hash="2da3d901173c19e53a96adb197b1533a"/><file name="Observer.php" hash="710332aab656724765981e9684eecf54"/><file name="Offlineretry.php" hash="394849df4873908dd43d3c15f75dc9d0"/><dir name="Order"><dir name="Invoice"><file name="Interest.php" hash="6bba5e87bae1a7ee94a827819b2ea4ce"/></dir><file name="Payment.php" hash="b1ab4478ab967cb6fb04b380e609cf4d"/></dir><file name="Providervalidation.php" hash="4906944bae20e3f683d6e5c4ba5304e3"/><dir name="Quote"><dir name="Address"><file name="Interest.php" hash="93aa0189a8556597697dbb239dbf3be7"/></dir></dir><file name="Recurrency.php" hash="76bb429ac4c849e27c8fabdd96bb9654"/><dir name="Resource"><dir name="Cardonfile"><file name="Collection.php" hash="7b7d13bc6d7be8e5e1c5f945d59117f6"/></dir><file name="Cardonfile.php" hash="47d0107a9b1c3415aaf8784298361e84"/><dir name="Customers"><file name="Collection.php" hash="6caadd817abbcda527ba6d102585f2ff"/></dir><file name="Customers.php" hash="f50289a4c8362ddf7a79e4aa7c8a6387"/><dir name="Offlineretry"><file name="Collection.php" hash="80f0689c66a30110e68c2fdafb3014a8"/></dir><file name="Offlineretry.php" hash="08c804fd3b001f4f3ac19ebbcfca59fb"/><file name="Setup.php" hash="42bda31d8497e1b0983775e17f7325a5"/></dir><dir name="Source"><file name="Antifraud.php" hash="8362e0bb2209bbf904a7f9b2edd59cee"/><file name="Banks.php" hash="b5d456a807cdf750a6458144e955cf2c"/><file name="CctypeProductInstallments.php" hash="7837f6865c905ba8f5393d080ebc1b3d"/><file name="Cctypes.php" hash="b55eb988a6a09f24b1088f15644961d0"/><file name="Debit.php" hash="9366bc3b900cf96ad5d2bce7e8d93ba7"/><file name="Environment.php" hash="099a28ea462481333437a6479276e8b0"/><file name="FControlEnvironment.php" hash="5159f6e4d86ee9d280285b7198fa01e9"/><file name="Frequency.php" hash="7864991042d0ec3fd5920d9047127b14"/><file name="Installments.php" hash="b04c05b92f7b8b5c025f23aad4457917"/><file name="PaymentAction.php" hash="c16639be23fd85c285f474922fd528a7"/><file name="PaymentMethods.php" hash="e12514ad00bf3fe3fb4e569b11da2c10"/></dir><file name="Standard.php" hash="28b9cee31223de104c701be7e4c360fa"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="Installments.php" hash="f0901bf05acd0b2c3fda41965f949583"/></dir></dir></dir><file name="Threecreditcards.php" hash="73fcdc4ef1dd38128b60454f90184ff5"/><file name="Twocreditcards.php" hash="c010f631d556a08d2d1aa65dc6b60703"/><file name="Urlvalidation.php" hash="5856b46f0c3d7c08a45035914087f74d"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="Test"><dir name="Selenium"><file name="Abstract.php" hash="caf0cd5ca47b13fb00be4230d1bb9132"/><file name="BoletoTest.php" hash="0718dc551376686dc6daaa3b57ddd1f9"/><dir name="CcTypes"><file name="CreditcardTest.php" hash="fde35369e57eb70f29f8defe1d7f06af"/><file name="CreditcardoneinstallmentTest.php" hash="cabcf9a3f56497e32679c1d2d063a6d7"/><file name="FivecreditcardsTest.php" hash="a903b89e20b9e754df7ed22dc9e8eecf"/><file name="FourcheditcardsTest.php" hash="3619a03b24af1a768cbc87be430b4323"/><file name="ThreecreditcardsTest.php" hash="d59c7b8a7de6320cff170e435fbe6e9e"/><file name="TwocreditcardsTest.php" hash="58db59f790aa7c65a324e6a552c2e05c"/></dir><file name="CcTypes.php" hash="de1d2e73a74e4b9fcde14adce60c0f82"/><file name="DebitTest.php" hash="1409a8f2de15e13792dcba2099a887cc"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="e5a51c9660f704bcbfb302d34493a5a6"/></dir><file name="ClearsaleController.php" hash="bc06365f0d577d66228d9f0c3e471089"/><file name="FcontrolController.php" hash="1af534f1cdadbfdbe702aed12c7a2e1d"/><file name="StandardController.php" hash="0a8c479368b3aa4d0fcedad44a5f36b5"/><file name="StoneController.php" hash="80c6f59a868ac82fc22bcf586bbecfdd"/><file name="TestController.php" hash="da51385fb260fc0135b83a446d8a2f5f"/><file name="TesteController.php" hash="5cc1b9cc40d098963a0e883cd7b8a194"/></dir><dir name="etc"><file name="config.xml" hash="c0e3416b9fbedf945ac069226ea77652"/><file name="jstranslator.xml" hash="8b1ea10d9b3072a795567dba6dae938c"/><file name="system.xml" hash="ccb863e06b6b1c7c279b3edfd4992184"/><file name="wsdl.xml" hash="a59b87019a8bdb03d97191e2d06be325"/><file name="xtest.xml" hash="b34ee3b6e37a890b73374b5ea3a1c40f"/></dir><dir name="sql"><dir name="mundipagg_setup"><file name="install-0.3.0.php" hash="ede73bb07d71fec55340c4249ff4a258"/><file name="mysql4-upgrade-0.3.0-0.3.5.php" hash="d3c200cce4a814feaa0858c0c8abd928"/><file name="mysql4-upgrade-0.3.5-0.4.0.php" hash="297f1b37b7703f7a0d621d227c8cbeb9"/><file name="mysql4-upgrade-0.3.5-1.0.1.php" hash="d22a0a81e392885433ca58dc196c2a86"/><file name="mysql4-upgrade-0.4.0-1.0.1.php" hash="297f1b37b7703f7a0d621d227c8cbeb9"/><file name="mysql4-upgrade-0.4.1-0.4.2.php" hash="4a2962a1eb974c75e153f48cc77f00d4"/><file name="mysql4-upgrade-0.4.1-1.0.1.php" hash="d22a0a81e392885433ca58dc196c2a86"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="297f1b37b7703f7a0d621d227c8cbeb9"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-1.0.10-1.0.11.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-1.0.11-2.0.0.php" hash="83c95c6060bb8678be3b8944a6823fd9"/><file name="mysql4-upgrade-1.0.2-1.0.3.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-1.0.3-1.0.4.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-1.0.4-1.0.5.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-1.0.5-1.0.6.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-1.0.6-1.0.7.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-1.0.7-1.0.8.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-1.0.8-1.0.9.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-1.0.9-1.0.10.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-2.0.0-2.0.1.php" hash="a437df63647a52381ed5e056ccbb0cff"/><file name="mysql4-upgrade-2.0.0-2.1.0.php" hash="30dc2c3c763893d3bac6b9fde0c56477"/><file name="mysql4-upgrade-2.0.1-2.0.2.php" hash="4959ae51e69913d8ac642bc2ab848464"/><file name="mysql4-upgrade-2.0.2-2.0.3.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-2.0.3-2.0.4.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-2.0.4-2.0.5.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-2.0.5-2.0.6.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-2.0.6-2.0.7.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-2.0.7-2.0.8.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-2.0.8-2.0.9.php" hash="4c18b9eb1e0a08d858dde48280eed2c0"/><file name="mysql4-upgrade-2.0.9-2.1.0.php" hash="3488f42f3d9e6a57ce4176c0a7954171"/><file name="mysql4-upgrade-2.1.2-2.1.3.php" hash="7d7823cb555a32295d179a96e2bf987a"/><file name="mysql4-upgrade-2.5.7-2.5.8.php" hash="45c4f1fd5336b7ce578c672e8f1d57b0"/><file name="mysql4-upgrade-2.5.8-2.6.0.php" hash="bf06e3d6ab5fa0c89629385db4231006"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mundipagg.xml" hash="b6677c25d67015f895a72afbca87041c"/></dir><dir name="template"><dir name="mundipagg"><file name="boleto.phtml" hash="11cc5b254644727d6bdded8a834965c7"/><file name="form.phtml" hash="566e1838cab471ce41a1f74156e3b3bf"/><dir name="payment"><dir name="info"><file name="mundipagg.phtml" hash="bd5b27bef9e968794b50aa2543cd3d6a"/></dir></dir><dir name="system"><dir name="config"><file name="button.phtml" hash="6a7f6c88cf156d31d34a818ac37bd158"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="mundipagg.xml" hash="c2ebd0374a3c6a6a4d8c3db84c8abf5a"/></dir><dir name="template"><dir name="mundipagg"><dir name="antifraud"><file name="clearsale.phtml" hash="088a189dd94401f39c90ad0a1471994f"/><file name="fcontrol.phtml" hash="1c84a81343591e6afec7a7d8d2549410"/><file name="stone.phtml" hash="681ddf22694c725bb6e84e79681936fa"/></dir><file name="boleto.phtml" hash="dc31735a2753812d36e3080bf5b01ac2"/><file name="cancel.phtml" hash="540639b1ccd698397286f668bbf23746"/><file name="debit.phtml" hash="78f60f0227e99ff0c1d7dbf6bd5aa202"/><file name="extras.phtml" hash="f3eba84e971e890922141d90f6bdd53f"/><file name="fcancel.phtml" hash="9ce1d7634acf519669e21978b41aa277"/><file name="form.phtml" hash="faff82dad9768f016f81648aa8b9b800"/><file name="parcelamento.phtml" hash="56a89503637e5ad753b0d410f2f5c7ad"/><file name="partial.phtml" hash="65b07a14ff67c7413405117a6f95c2be"/><dir name="payment"><dir name="info"><file name="mundipagg.phtml" hash="c110a21db08013d38add1b79977350e4"/></dir></dir><file name="redirect.phtml" hash="a8a1123eab776934c64f57b4f9cfd517"/><file name="success.phtml" hash="7afd82f246fdf50f9a72ebb15086a2b6"/><file name="totals.phtml" hash="5a78aa3fe60d4b13bf8451f23bb9edd9"/></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="template"><dir name="mundipagg"><file name="debit.phtml" hash="4d2ae58447d3893499556ae068f800f8"/><file name="form.phtml" hash="dd83f04f33982e17fdea1713a3eb1b3a"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Uecommerce_Mundipagg.xml" hash="b292eeabde8e2cd06db0c31aff54fd98"/></dir></target><target name="mage"><dir name="js"><dir name="uecommerce"><file name="mundipagg.js" hash="c887a21c210250da640bafce773e43ab"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="mundipagg"><file name="ajax-loader.gif" hash="7b9776076d5fceef4993b55c9383dedd"/><file name="boleto.jpg" hash="237570c55c811b4b13f73ab92f28e599"/><file name="mundipagg-avatar-blue.png" hash="9e81f9c54ac7ce3de570d7065f4b4c07"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="mundipagg.css" hash="90c32001f3a9b858c9506f5135c04972"/></dir><dir name="images"><dir name="mundipagg"><file name="001.png" hash="25d10d6fee7fc3e5dc48021a15de8fb0"/><file name="237.png" hash="cbea9caff342edd9b9b9509bbbbae6fb"/><file name="341.png" hash="3645161fc56322ec34ebfcc006390e5d"/><file name="AE.png" hash="40ea216476033961d50f452bf4bca4df"/><file name="DI.png" hash="0f4264379e7b8ba6b1a30a3d69240ae2"/><file name="EL.png" hash="ad180c308d285f73fc044121cb6aeac0"/><file name="HI.png" hash="c25430ddd8e441cc2fc3ef68219e7668"/><file name="MC.png" hash="836466c092121163320e9e6279f11f8b"/><file name="VBV.jpg" hash="1a7db765956829e80715a299b799f580"/><file name="VBV.png" hash="d6fb7de65fda842f03e2b9fc89d5e6aa"/><file name="VI.png" hash="cc0709d50773fa2815f7bfeb741a4219"/><file name="ajax-loader.gif" hash="7b9776076d5fceef4993b55c9383dedd"/><file name="boleto.jpg" hash="237570c55c811b4b13f73ab92f28e599"/><file name="cc_types.png" hash="fdae60f96ee668354161b5a865b8e7ef"/><file name="cielo_mastercard.png" hash="e2c2af12ea24f1b82490fdcc62fbb871"/><file name="cielo_visa.png" hash="d2f0c660714dc319b73c0dac9c9108d0"/></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="images"><dir name="mundipagg"><file name="EL.png" hash="ad180c308d285f73fc044121cb6aeac0"/><file name="HI.png" hash="c25430ddd8e441cc2fc3ef68219e7668"/><file name="ae.png" hash="40ea216476033961d50f452bf4bca4df"/><file name="boleto.jpg" hash="237570c55c811b4b13f73ab92f28e599"/><file name="cielo_mastercard.png" hash="e2c2af12ea24f1b82490fdcc62fbb871"/><file name="cielo_visa.png" hash="d2f0c660714dc319b73c0dac9c9108d0"/><file name="di.png" hash="0f4264379e7b8ba6b1a30a3d69240ae2"/><file name="mc.png" hash="836466c092121163320e9e6279f11f8b"/><file name="vi.png" hash="cc0709d50773fa2815f7bfeb741a4219"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Uecommerce_Mundipagg.csv" hash="ae581dc54ea4ada4a9a3c9f4c51f09c7"/></dir><dir name="pt_BR"><file name="Uecommerce_Mundipagg.csv" hash="239e42f3f065f13aad24567ab81319a5"/></dir></target></contents>
|
| 22 |
<compatible/>
|
| 23 |
<dependencies><required><php><min>5.1.0</min><max>7.9.99</max></php></required></dependencies>
|
| 24 |
</package>
|
