Version Notes
This module adds the wide range of different alternative payment methods.
Download this release
Release Info
Developer | Alternative Payments Inc |
Extension | AlternativePaymentsInc_AlternativePayments |
Version | 1.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.0.1
- app/code/community/AlternativePaymentsInc/AlternativePayments/Block/Redirect.php +0 -0
- app/code/community/AlternativePaymentsInc/AlternativePayments/Model/Standard.php +31 -62
- app/code/community/AlternativePaymentsInc/AlternativePayments/etc/config.xml +2 -12
- app/code/community/AlternativePaymentsInc/AlternativePayments/etc/system.xml +12 -16
- app/code/community/AlternativePaymentsInc/AlternativePayments/sql/alternativepayments_setup/mysql4-install-0.1.0.php +45 -14
- app/code/community/AlternativePaymentsInc/AlternativePayments/sql/alternativepayments_setup/{mysql4-upgrade-0.2.2-0.2.3.php → mysql4-upgrade-0.2.2-1.0.0.php} +2 -1
- app/code/community/AlternativePaymentsInc/AlternativePayments/sql/alternativepayments_setup/{mysql4-upgrade-0.2.3-1.0.0.php → mysql4-upgrade-1.0.0-1.0.1.php} +35 -3
- app/design/frontend/base/default/layout/alternativepayments.xml +4 -4
- app/{code/community/AlternativePaymentsInc/AlternativePayments/Block/Postback.php → design/frontend/base/default/template/alternativepayments/form/telepay.phtml} +8 -14
- app/design/frontend/base/default/template/alternativepayments/postback.phtml +0 -130
- app/design/frontend/base/default/template/alternativepayments/redirect.phtml +21 -11
- app/design/frontend/base/default/template/alternativepayments/response.phtml +0 -44
- package.xml +5 -5
app/code/community/AlternativePaymentsInc/AlternativePayments/Block/Redirect.php
CHANGED
File without changes
|
app/code/community/AlternativePaymentsInc/AlternativePayments/Model/Standard.php
CHANGED
@@ -230,7 +230,7 @@ class AlternativePaymentsInc_AlternativePayments_Model_Standard extends Mage_Pay
|
|
230 |
|
231 |
/**
|
232 |
* methode for prepere and send infroramtion on service, checking and info client if all ok before place order
|
233 |
-
* only for "EPS", "IDEAL", "GIROPAY", "PAYSAFE", "POLI", "PRZELEWY", "QIWI", "TELEINGRESO", "YELLOWPAY" - special request
|
234 |
*
|
235 |
* @param Varien_Object $data
|
236 |
* @return
|
@@ -241,9 +241,12 @@ class AlternativePaymentsInc_AlternativePayments_Model_Standard extends Mage_Pay
|
|
241 |
$payment = $order -> getPayment();
|
242 |
$incrementId = $order -> getEntityId();
|
243 |
|
|
|
244 |
// filter for payment gateway
|
245 |
if (in_array($order->getAlternativepaymentsTypeName(), array("YELLOWPAY", "EPS", "IDEAL", "GIROPAY", "PAYSAFE",
|
246 |
-
"POLI", "PRZELEWY", "QIWI", "TELEINGRESO"
|
|
|
|
|
247 |
$amount = $order -> getGrandTotal();
|
248 |
|
249 |
//build request list
|
@@ -266,7 +269,6 @@ class AlternativePaymentsInc_AlternativePayments_Model_Standard extends Mage_Pay
|
|
266 |
|
267 |
return -1;
|
268 |
}
|
269 |
-
|
270 |
}
|
271 |
|
272 |
/**
|
@@ -282,13 +284,9 @@ class AlternativePaymentsInc_AlternativePayments_Model_Standard extends Mage_Pay
|
|
282 |
$payment = $order -> getPayment();
|
283 |
$incrementId = $order -> getEntityId();
|
284 |
|
285 |
-
// $order->setPricePoint($this->getConfigData('pricepoint'));
|
286 |
-
|
287 |
-
|
288 |
-
// ---- direct pay gateway method - START !!!!!! -------
|
289 |
if (in_array($order->getAlternativepaymentsTypeName(), array("SEPA", "EuroDebit", "ACH", "CreditCard", "BARPAY"))) {
|
290 |
|
291 |
-
|
292 |
|
293 |
|
294 |
$check = $this -> _getOrderDirectPay($order);
|
@@ -296,51 +294,12 @@ class AlternativePaymentsInc_AlternativePayments_Model_Standard extends Mage_Pay
|
|
296 |
|
297 |
return Mage::getUrl('checkout/onepage/failure', array('_secure' => true));
|
298 |
}
|
299 |
-
|
300 |
-
// ---- direct pay gateway method - END !!!!!! -----------------------------
|
301 |
-
// ---- redirect pay gateway method - START !!!!!! -------------------------
|
302 |
-
} elseif (in_array($order->getAlternativepaymentsTypeName(), array("DIRECTPAY", "CHINADEBIT",
|
303 |
-
"BrazilPay", "DIRECTPAYMAX" ))) {
|
304 |
-
|
305 |
-
// Mage::log(var_export($order->debug(), TRUE), null,'$cart3.log');
|
306 |
-
|
307 |
-
$amount = $order -> getGrandTotal();
|
308 |
-
$cartValues = $this -> _buildRequest($order, $amount);
|
309 |
-
|
310 |
-
list($content, $response) = $this -> _postRequest($order, $cartValues);
|
311 |
-
list($isPaymentAccepted, $message) = $this->_formatPostResult($content);
|
312 |
-
|
313 |
-
$responseURL = $response['url'];
|
314 |
|
315 |
-
// ---- redirect pay gateway method - DIRECTPAY and DIRECTPAYMAX only !!!!!! (specific) --------
|
316 |
-
if (in_array($order->getAlternativepaymentsTypeName(), array("DIRECTPAY", "DIRECTPAYMAX"))) {
|
317 |
-
|
318 |
-
if ($isPaymentAccepted == self::RESPONSE_CODE_DECLINED || $isPaymentAccepted == self::RESPONSE_CODE_ERROR) {
|
319 |
-
|
320 |
-
$order->setStatus(self::STATUS_ERROR);
|
321 |
-
$order->save();
|
322 |
-
$orderId = $order-> getReservedOrderId();
|
323 |
-
$orderOBJ = Mage::getModel('sales/order')->loadByIncrementId("$orderId");
|
324 |
-
$orderOBJ->setState(Mage_Sales_Model_Order::STATE_CANCELED, true);
|
325 |
-
$orderOBJ->save();
|
326 |
-
Mage::throwException(Mage::helper('paygate')->__('Unexpected error: '. $message));
|
327 |
-
} else {
|
328 |
-
|
329 |
-
Mage::getSingleton('alternativepayments/session')->setPostBack(serialize($content));
|
330 |
-
Mage::getSingleton('alternativepayments/session')->setBackFlag(serialize('TRUE'));
|
331 |
-
|
332 |
-
return Mage::getUrl('alternativepayments/', array('_secure' => true));
|
333 |
-
|
334 |
-
}
|
335 |
-
} else {
|
336 |
-
|
337 |
-
return $responseURL;
|
338 |
-
|
339 |
-
}
|
340 |
-
|
341 |
// filter for specific payment gateway
|
342 |
} elseif (in_array($order->getAlternativepaymentsTypeName(), array("YELLOWPAY", "EPS", "IDEAL", "GIROPAY", "PAYSAFE",
|
343 |
-
"POLI", "PRZELEWY", "QIWI", "TELEINGRESO"
|
|
|
|
|
344 |
|
345 |
$responseURL = Mage::getSingleton('checkout/session')->getResponseTestField();
|
346 |
|
@@ -350,15 +309,13 @@ class AlternativePaymentsInc_AlternativePayments_Model_Standard extends Mage_Pay
|
|
350 |
|
351 |
$order->setStatus(self::STATUS_ERROR);
|
352 |
$order->save();
|
353 |
-
$orderId = $order-> getReservedOrderId();
|
354 |
$orderOBJ = Mage::getModel('sales/order')->loadByIncrementId("$orderId");
|
355 |
$orderOBJ->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, 'Unexpected error' );
|
356 |
$orderOBJ->save();
|
357 |
Mage::throwException(Mage::helper('paygate')->__('Unexpected error'));
|
358 |
}
|
359 |
|
360 |
-
// return Mage::getUrl(Mage::getSingleton('checkout/session')->getTestField(), array('_secure' => true));
|
361 |
-
|
362 |
}
|
363 |
|
364 |
/**
|
@@ -440,7 +397,7 @@ class AlternativePaymentsInc_AlternativePayments_Model_Standard extends Mage_Pay
|
|
440 |
$cart->setStatus(self::STATUS_ERROR);
|
441 |
$cart->save();
|
442 |
$orderId = $cart-> getReservedOrderId();
|
443 |
-
$orderOBJ = Mage::getModel('sales/order')->loadByIncrementId("$orderId");
|
444 |
$orderOBJ->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, "Unexpected error - $message !" );
|
445 |
$orderOBJ->save();
|
446 |
Mage::throwException(Mage::helper('paygate')->__('Unexpected error'));
|
@@ -572,21 +529,33 @@ class AlternativePaymentsInc_AlternativePayments_Model_Standard extends Mage_Pay
|
|
572 |
"bankcode" => $cart->getIdealBankcode(),
|
573 |
"resultredirecturl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."alternativepayments/payment/redirect/",
|
574 |
"postbackurl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."alternativepayments/payment/redirect/",
|
575 |
-
);
|
576 |
-
|
577 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
578 |
|
579 |
$fields_tmp = array(
|
580 |
|
|
|
581 |
"pricepoint" => $cart->getPricePoint(),
|
582 |
"paymenttype" => $cart->getAlternativepaymentsTypeName(),
|
583 |
"postbackurl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."alternativepayments/payment/redirect/",
|
584 |
-
);
|
585 |
|
586 |
} elseif ($cart->getAlternativepaymentsTypeName() == 'DIRECTPAYMAX') {
|
587 |
|
588 |
$fields_tmp = array(
|
589 |
|
|
|
590 |
"pricepoint" => $cart->getPricePoint(),
|
591 |
"paymenttype" => $cart->getAlternativepaymentsTypeName(),
|
592 |
"bankCode" => $cart->getDirectpaymaxBankcode(),
|
@@ -624,7 +593,7 @@ class AlternativePaymentsInc_AlternativePayments_Model_Standard extends Mage_Pay
|
|
624 |
}
|
625 |
|
626 |
$fields = $fields + $fields_tmp;
|
627 |
-
|
628 |
return $fields;
|
629 |
}
|
630 |
}
|
@@ -645,7 +614,7 @@ class AlternativePaymentsInc_AlternativePayments_Model_Standard extends Mage_Pay
|
|
645 |
$postData = http_build_query($cartValues);
|
646 |
|
647 |
|
648 |
-
//
|
649 |
|
650 |
$urlToPost = $cart->getUrlcode();
|
651 |
// Create a curl request and send the values
|
@@ -662,9 +631,9 @@ class AlternativePaymentsInc_AlternativePayments_Model_Standard extends Mage_Pay
|
|
662 |
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
|
663 |
|
664 |
$content = curl_exec($ch); //The string returned
|
665 |
-
|
666 |
$response = curl_getinfo($ch);
|
667 |
-
|
668 |
curl_close ($ch);
|
669 |
|
670 |
if ($response['http_code'] == 301 || $response['http_code'] == 302)
|
230 |
|
231 |
/**
|
232 |
* methode for prepere and send infroramtion on service, checking and info client if all ok before place order
|
233 |
+
* only for "EPS", "IDEAL", "GIROPAY", "PAYSAFE", "POLI", "PRZELEWY", "QIWI", "TELEINGRESO", "YELLOWPAY" , "DIRECTPAY", "DIRECTPAYMAX", "TELEPAY" - special request
|
234 |
*
|
235 |
* @param Varien_Object $data
|
236 |
* @return
|
241 |
$payment = $order -> getPayment();
|
242 |
$incrementId = $order -> getEntityId();
|
243 |
|
244 |
+
|
245 |
// filter for payment gateway
|
246 |
if (in_array($order->getAlternativepaymentsTypeName(), array("YELLOWPAY", "EPS", "IDEAL", "GIROPAY", "PAYSAFE",
|
247 |
+
"POLI", "PRZELEWY", "QIWI", "TELEINGRESO"
|
248 |
+
, "DIRECTPAY", "DIRECTPAYMAX", "TELEPAY"
|
249 |
+
))) {
|
250 |
$amount = $order -> getGrandTotal();
|
251 |
|
252 |
//build request list
|
269 |
|
270 |
return -1;
|
271 |
}
|
|
|
272 |
}
|
273 |
|
274 |
/**
|
284 |
$payment = $order -> getPayment();
|
285 |
$incrementId = $order -> getEntityId();
|
286 |
|
|
|
|
|
|
|
|
|
287 |
if (in_array($order->getAlternativepaymentsTypeName(), array("SEPA", "EuroDebit", "ACH", "CreditCard", "BARPAY"))) {
|
288 |
|
289 |
+
Mage::log(var_export($order->debug(), TRUE), null,'$cart3.log');
|
290 |
|
291 |
|
292 |
$check = $this -> _getOrderDirectPay($order);
|
294 |
|
295 |
return Mage::getUrl('checkout/onepage/failure', array('_secure' => true));
|
296 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
// filter for specific payment gateway
|
299 |
} elseif (in_array($order->getAlternativepaymentsTypeName(), array("YELLOWPAY", "EPS", "IDEAL", "GIROPAY", "PAYSAFE",
|
300 |
+
"POLI", "PRZELEWY", "QIWI", "TELEINGRESO"
|
301 |
+
, "DIRECTPAY", "DIRECTPAYMAX", "TELEPAY"
|
302 |
+
))) {
|
303 |
|
304 |
$responseURL = Mage::getSingleton('checkout/session')->getResponseTestField();
|
305 |
|
309 |
|
310 |
$order->setStatus(self::STATUS_ERROR);
|
311 |
$order->save();
|
312 |
+
$orderId = $order-> getReservedOrderId();
|
313 |
$orderOBJ = Mage::getModel('sales/order')->loadByIncrementId("$orderId");
|
314 |
$orderOBJ->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, 'Unexpected error' );
|
315 |
$orderOBJ->save();
|
316 |
Mage::throwException(Mage::helper('paygate')->__('Unexpected error'));
|
317 |
}
|
318 |
|
|
|
|
|
319 |
}
|
320 |
|
321 |
/**
|
397 |
$cart->setStatus(self::STATUS_ERROR);
|
398 |
$cart->save();
|
399 |
$orderId = $cart-> getReservedOrderId();
|
400 |
+
$orderOBJ = Mage::getModel(', "TELEPAY"sales/order')->loadByIncrementId("$orderId");
|
401 |
$orderOBJ->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, "Unexpected error - $message !" );
|
402 |
$orderOBJ->save();
|
403 |
Mage::throwException(Mage::helper('paygate')->__('Unexpected error'));
|
529 |
"bankcode" => $cart->getIdealBankcode(),
|
530 |
"resultredirecturl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."alternativepayments/payment/redirect/",
|
531 |
"postbackurl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."alternativepayments/payment/redirect/",
|
532 |
+
);
|
533 |
+
|
534 |
+
|
535 |
+
} elseif (in_array($cart->getAlternativepaymentsTypeName(), array( "BARPAY" ))) {
|
536 |
+
|
537 |
+
$fields_tmp = array(
|
538 |
+
|
539 |
+
"pricepoint" => $cart->getPricePoint(),
|
540 |
+
"paymenttype" => $cart->getAlternativepaymentsTypeName(),
|
541 |
+
"postbackurl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."alternativepayments/payment/redirect/",
|
542 |
+
);
|
543 |
+
|
544 |
+
} elseif (in_array($cart->getAlternativepaymentsTypeName(), array("DIRECTPAY", "TELEPAY"))) {
|
545 |
|
546 |
$fields_tmp = array(
|
547 |
|
548 |
+
"authredirectmode" => 'H',
|
549 |
"pricepoint" => $cart->getPricePoint(),
|
550 |
"paymenttype" => $cart->getAlternativepaymentsTypeName(),
|
551 |
"postbackurl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."alternativepayments/payment/redirect/",
|
552 |
+
);
|
553 |
|
554 |
} elseif ($cart->getAlternativepaymentsTypeName() == 'DIRECTPAYMAX') {
|
555 |
|
556 |
$fields_tmp = array(
|
557 |
|
558 |
+
"authredirectmode" => 'H',
|
559 |
"pricepoint" => $cart->getPricePoint(),
|
560 |
"paymenttype" => $cart->getAlternativepaymentsTypeName(),
|
561 |
"bankCode" => $cart->getDirectpaymaxBankcode(),
|
593 |
}
|
594 |
|
595 |
$fields = $fields + $fields_tmp;
|
596 |
+
// file_put_contents(Mage::getBaseDir('base')."/var/log/fields$$$.txt", print_r($fields, true), FILE_APPEND);
|
597 |
return $fields;
|
598 |
}
|
599 |
}
|
614 |
$postData = http_build_query($cartValues);
|
615 |
|
616 |
|
617 |
+
// file_put_contents(Mage::getBaseDir('base')."/var/log/cartValues$$$.txt", print_r($cartValues, true), FILE_APPEND);
|
618 |
|
619 |
$urlToPost = $cart->getUrlcode();
|
620 |
// Create a curl request and send the values
|
631 |
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
|
632 |
|
633 |
$content = curl_exec($ch); //The string returned
|
634 |
+
// file_put_contents(Mage::getBaseDir('base')."/var/log/content$$$.txt", $content, FILE_APPEND);
|
635 |
$response = curl_getinfo($ch);
|
636 |
+
// file_put_contents(Mage::getBaseDir('base')."/var/log/response$$$.txt", print_r($response, true), FILE_APPEND);
|
637 |
curl_close ($ch);
|
638 |
|
639 |
if ($response['http_code'] == 301 || $response['http_code'] == 302)
|
app/code/community/AlternativePaymentsInc/AlternativePayments/etc/config.xml
CHANGED
@@ -22,7 +22,7 @@
|
|
22 |
<config>
|
23 |
<modules>
|
24 |
<AlternativePaymentsInc_AlternativePayments>
|
25 |
-
<version>1.0.
|
26 |
</AlternativePaymentsInc_AlternativePayments>
|
27 |
</modules>
|
28 |
|
@@ -89,17 +89,7 @@
|
|
89 |
<title>Alternative Payments</title>
|
90 |
<payment_action>sale</payment_action>
|
91 |
<allowspecific>0</allowspecific>
|
92 |
-
<sort_order>33</sort_order>
|
93 |
-
|
94 |
-
|
95 |
-
<!--
|
96 |
-
<ppach>defaultvalue1</ppach>
|
97 |
-
<ppbarpay>defaultvalue2</ppbarpay>
|
98 |
-
<ppdirectpay>defaultvalue3</ppdirectpay>
|
99 |
-
<ppdirectpaymax>defaultvalue4</ppdirectpaymax>
|
100 |
-
-->
|
101 |
-
|
102 |
-
|
103 |
</alternativepayments>
|
104 |
</payment>
|
105 |
</default>
|
22 |
<config>
|
23 |
<modules>
|
24 |
<AlternativePaymentsInc_AlternativePayments>
|
25 |
+
<version>1.0.1</version>
|
26 |
</AlternativePaymentsInc_AlternativePayments>
|
27 |
</modules>
|
28 |
|
89 |
<title>Alternative Payments</title>
|
90 |
<payment_action>sale</payment_action>
|
91 |
<allowspecific>0</allowspecific>
|
92 |
+
<sort_order>33</sort_order>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
</alternativepayments>
|
94 |
</payment>
|
95 |
</default>
|
app/code/community/AlternativePaymentsInc/AlternativePayments/etc/system.xml
CHANGED
@@ -58,12 +58,11 @@
|
|
58 |
<show_in_website>1</show_in_website>
|
59 |
<show_in_store>0</show_in_store>
|
60 |
</urlcode>
|
61 |
-
|
62 |
<websiteid translate="label">
|
63 |
<label>Website ID</label>
|
64 |
<comment>Website ID given by Alternative Payments</comment>
|
65 |
<frontend_type>text</frontend_type>
|
66 |
-
<sort_order>
|
67 |
<show_in_default>1</show_in_default>
|
68 |
<show_in_website>1</show_in_website>
|
69 |
<show_in_store>0</show_in_store>
|
@@ -72,7 +71,7 @@
|
|
72 |
<label>Client Account</label>
|
73 |
<comment>Client Account given by Alternative Payments</comment>
|
74 |
<frontend_type>text</frontend_type>
|
75 |
-
<sort_order>
|
76 |
<show_in_default>1</show_in_default>
|
77 |
<show_in_website>1</show_in_website>
|
78 |
<show_in_store>0</show_in_store>
|
@@ -81,7 +80,7 @@
|
|
81 |
<label>Account key</label>
|
82 |
<comment>Account key given by Alternative Payments</comment>
|
83 |
<frontend_type>text</frontend_type>
|
84 |
-
<sort_order>
|
85 |
<show_in_default>1</show_in_default>
|
86 |
<show_in_website>1</show_in_website>
|
87 |
<show_in_store>0</show_in_store>
|
@@ -223,25 +222,22 @@
|
|
223 |
<show_in_website>1</show_in_website>
|
224 |
<show_in_store>0</show_in_store>
|
225 |
</pp_teleingreso>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
<pp_yellowpay translate="label">
|
227 |
<label>Price Point for "YellowPay"</label>
|
228 |
<frontend_type>text</frontend_type>
|
229 |
-
<sort_order>
|
230 |
<show_in_default>1</show_in_default>
|
231 |
<show_in_website>1</show_in_website>
|
232 |
<show_in_store>0</show_in_store>
|
233 |
</pp_yellowpay>
|
234 |
-
<!--
|
235 |
-
<order_status translate="label">
|
236 |
-
<label>New Order Status</label>
|
237 |
-
<frontend_type>select</frontend_type>
|
238 |
-
<source_model>adminhtml/system_config_source_order_status</source_model>
|
239 |
-
<sort_order>50</sort_order>
|
240 |
-
<show_in_default>1</show_in_default>
|
241 |
-
<show_in_website>1</show_in_website>
|
242 |
-
<show_in_store>0</show_in_store>
|
243 |
-
</order_status>
|
244 |
-
-->
|
245 |
<allowspecific translate="label">
|
246 |
<label>Payment Applicable From</label>
|
247 |
<frontend_type>select</frontend_type>
|
58 |
<show_in_website>1</show_in_website>
|
59 |
<show_in_store>0</show_in_store>
|
60 |
</urlcode>
|
|
|
61 |
<websiteid translate="label">
|
62 |
<label>Website ID</label>
|
63 |
<comment>Website ID given by Alternative Payments</comment>
|
64 |
<frontend_type>text</frontend_type>
|
65 |
+
<sort_order>13</sort_order>
|
66 |
<show_in_default>1</show_in_default>
|
67 |
<show_in_website>1</show_in_website>
|
68 |
<show_in_store>0</show_in_store>
|
71 |
<label>Client Account</label>
|
72 |
<comment>Client Account given by Alternative Payments</comment>
|
73 |
<frontend_type>text</frontend_type>
|
74 |
+
<sort_order>14</sort_order>
|
75 |
<show_in_default>1</show_in_default>
|
76 |
<show_in_website>1</show_in_website>
|
77 |
<show_in_store>0</show_in_store>
|
80 |
<label>Account key</label>
|
81 |
<comment>Account key given by Alternative Payments</comment>
|
82 |
<frontend_type>text</frontend_type>
|
83 |
+
<sort_order>15</sort_order>
|
84 |
<show_in_default>1</show_in_default>
|
85 |
<show_in_website>1</show_in_website>
|
86 |
<show_in_store>0</show_in_store>
|
222 |
<show_in_website>1</show_in_website>
|
223 |
<show_in_store>0</show_in_store>
|
224 |
</pp_teleingreso>
|
225 |
+
<pp_telepay translate="label">
|
226 |
+
<label>Price Point for "TelePay"</label>
|
227 |
+
<frontend_type>text</frontend_type>
|
228 |
+
<sort_order>45</sort_order>
|
229 |
+
<show_in_default>1</show_in_default>
|
230 |
+
<show_in_website>1</show_in_website>
|
231 |
+
<show_in_store>0</show_in_store>
|
232 |
+
</pp_telepay>
|
233 |
<pp_yellowpay translate="label">
|
234 |
<label>Price Point for "YellowPay"</label>
|
235 |
<frontend_type>text</frontend_type>
|
236 |
+
<sort_order>46</sort_order>
|
237 |
<show_in_default>1</show_in_default>
|
238 |
<show_in_website>1</show_in_website>
|
239 |
<show_in_store>0</show_in_store>
|
240 |
</pp_yellowpay>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
<allowspecific translate="label">
|
242 |
<label>Payment Applicable From</label>
|
243 |
<frontend_type>select</frontend_type>
|
app/code/community/AlternativePaymentsInc/AlternativePayments/sql/alternativepayments_setup/mysql4-install-0.1.0.php
CHANGED
@@ -31,20 +31,51 @@ $installer = $this;
|
|
31 |
|
32 |
$installer->startSetup();
|
33 |
|
34 |
-
$installer->
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
)
|
39 |
-
|
40 |
-
);
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
$installer->endSetup();
|
50 |
|
31 |
|
32 |
$installer->startSetup();
|
33 |
|
34 |
+
$conn = $installer->getConnection();
|
35 |
+
$prod = 'processing_paid';
|
36 |
+
|
37 |
+
$select = $conn
|
38 |
+
->select()
|
39 |
+
->from($this->getTable('sales/order_status'))
|
40 |
+
->where('status = ?', $prod );
|
41 |
+
$data1 = $conn->fetchAll($select);
|
42 |
+
|
43 |
+
if ($data1) {
|
44 |
+
echo 'In database jet - sales/order_status';
|
45 |
+
} else {
|
46 |
+
//echo 'Insert in db - sales/order_status';
|
47 |
+
|
48 |
+
$installer->run("
|
49 |
+
INSERT INTO `{$this->getTable('sales/order_status')}` (
|
50 |
+
`status`, `label`
|
51 |
+
) VALUES (
|
52 |
+
'processing_paid', 'Processing (Successfully Paid)'
|
53 |
+
);
|
54 |
+
");
|
55 |
+
}
|
56 |
+
|
57 |
+
$select = $conn
|
58 |
+
->select()
|
59 |
+
->from($this->getTable('sales/order_status_state'))
|
60 |
+
->where('status = ?', $prod );
|
61 |
+
$data2 = $conn->fetchAll($select);
|
62 |
+
|
63 |
+
if ($data2) {
|
64 |
+
echo 'In database jet - sales/order_status_state';
|
65 |
+
} else {
|
66 |
+
//echo 'Insert in db - sales/order_status_state';
|
67 |
+
|
68 |
+
$installer->run("
|
69 |
+
|
70 |
+
INSERT INTO `{$this->getTable('sales/order_status_state')}` (
|
71 |
+
`status`, `state`, `is_default`
|
72 |
+
) VALUES (
|
73 |
+
'processing_paid', 'processing', '1'
|
74 |
+
);
|
75 |
+
|
76 |
+
");
|
77 |
+
|
78 |
+
}
|
79 |
|
80 |
$installer->endSetup();
|
81 |
|
app/code/community/AlternativePaymentsInc/AlternativePayments/sql/alternativepayments_setup/{mysql4-upgrade-0.2.2-0.2.3.php → mysql4-upgrade-0.2.2-1.0.0.php}
RENAMED
@@ -25,7 +25,7 @@
|
|
25 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
26 |
*/
|
27 |
|
28 |
-
echo 'Running Upgrade script (mysql4-upgrade-0.2.2-0.
|
29 |
|
30 |
$installer = $this;
|
31 |
|
@@ -59,6 +59,7 @@ $installer->run("
|
|
59 |
( 'PRZELEWY', 'Przelewy24', 'PL', 'emptyValidation' ),
|
60 |
( 'TELEINGRESO', 'Teleingreso', 'ES', 'emptyValidation' ),
|
61 |
( 'SEPA', 'EuroDebit SEPA', 'BE|BG|CH|CY|CZ|DK|ES|FI|FR|GB|GR|HU|IE|IS|IT|LI|LT|LU|LV|MC|MT|NO|PL|PT|RO|SE|SI|SK', 'sepaValidation' ),
|
|
|
62 |
( 'QIWI', 'QIWI', 'RU', 'emptyValidation' );
|
63 |
|
64 |
");
|
25 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
26 |
*/
|
27 |
|
28 |
+
echo 'Running Upgrade script (mysql4-upgrade-0.2.2-1.0.0.php) for AlternativePaymentsInc_AlternativePayments<br />';
|
29 |
|
30 |
$installer = $this;
|
31 |
|
59 |
( 'PRZELEWY', 'Przelewy24', 'PL', 'emptyValidation' ),
|
60 |
( 'TELEINGRESO', 'Teleingreso', 'ES', 'emptyValidation' ),
|
61 |
( 'SEPA', 'EuroDebit SEPA', 'BE|BG|CH|CY|CZ|DK|ES|FI|FR|GB|GR|HU|IE|IS|IT|LI|LT|LU|LV|MC|MT|NO|PL|PT|RO|SE|SI|SK', 'sepaValidation' ),
|
62 |
+
( 'TELEPAY', 'TelePay', 'MX', 'emptyValidation' ),
|
63 |
( 'QIWI', 'QIWI', 'RU', 'emptyValidation' );
|
64 |
|
65 |
");
|
app/code/community/AlternativePaymentsInc/AlternativePayments/sql/alternativepayments_setup/{mysql4-upgrade-0.2.3-1.0.0.php → mysql4-upgrade-1.0.0-1.0.1.php}
RENAMED
@@ -25,13 +25,45 @@
|
|
25 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
26 |
*/
|
27 |
|
28 |
-
echo 'Running Upgrade script (mysql4-upgrade-0.
|
29 |
|
30 |
-
/*
|
31 |
$installer = $this;
|
32 |
|
33 |
$installer->startSetup();
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
// ( 'CreditCard', 'Credit Card', 'AD|AE|AF|AG|AI|AL|AM|AN|AO|AQ|AR|AS|AT|AU|AW|AZ|BA|BB|BD|BE|BF|BG|BH|BI|BJ|BM|BN|BO|BR|BS|BT|BW|BY|BZ|CA|CD|CH|CI|CK|CL|CM|CN|CO|CR|RS|CU|CV|CY|CZ|DE|DJ|DK|DM|DO|DZ|EC|EE|EG|ES|ET|FI|FJ|FK|FM|FO|FR|GA|GB|GD|GE|GF|GH|GI|GL|GM|GN|GP|GQ|GR|GT|GU|GW|GY|HK|HN|HR|HT|HU|ID|IE|IL|IN|IQ|IR|IS|IT|JM|JO|JP|KE|KG|KH|KI|KM|KN|KR|KW|KY|KZ|LA|LB|LC|LI|LK|LR|LS|LT|LU|LV|LY|MA|MC|MG|ML|MM|MN|MO|MR|MS|MT|MU|MV|MW|MX|MY|MZ|NA|NC|NE|NG|NI|NL|NO|NP|NR|NZ|OM|PA|PE|PF|PG|PH|PK|PL|PM|PR|PT|PY|QA|RO|RU|RW|SA|SB|SC|SE|SG|SH|SI|SK|SL|SM|SN|SO|SR|ST|SV|SY|SZ|TC|TD|TG|TH|TJ|TM|TN|TO|TR|TT|TW|TZ|UA|UG|US|UY|UZ|VA|VC|VE|VG|VN|VU|WF|WS|YE|YT|YU|ZA|ZM|ZR|ZW', 'creditcardValidation' ),
|
37 |
// ( 'BrazilPay', 'BrazilPay', 'BR', 'brazilpayValidation' ),
|
@@ -39,6 +71,6 @@ $installer->startSetup();
|
|
39 |
// ( 'FASTERPAY', 'FasterPay', 'GB' ),
|
40 |
|
41 |
$installer->endSetup();
|
42 |
-
|
43 |
|
44 |
|
25 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
26 |
*/
|
27 |
|
28 |
+
echo 'Running Upgrade script (mysql4-upgrade-1.0.0-1.0.1.php) for AlternativePaymentsInc_AlternativePayments<br />';
|
29 |
|
|
|
30 |
$installer = $this;
|
31 |
|
32 |
$installer->startSetup();
|
33 |
|
34 |
+
$installer->run("
|
35 |
+
|
36 |
+
DROP TABLE IF EXISTS {$this->getTable('alternativepayments_resource')};
|
37 |
+
CREATE TABLE `{$this->getTable('alternativepayments_resource')}`
|
38 |
+
(
|
39 |
+
type_name VARCHAR(255) NOT NULL UNIQUE,
|
40 |
+
type_label VARCHAR(255) NOT NULL,
|
41 |
+
allow_country TEXT NOT NULL,
|
42 |
+
validation VARCHAR(255) NOT NULL
|
43 |
+
) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
|
44 |
+
|
45 |
+
INSERT INTO `{$this->getTable('alternativepayments_resource')}`
|
46 |
+
(`type_name`, `type_label`, `allow_country`, `validation` )
|
47 |
+
VALUES
|
48 |
+
( 'ACH', 'ACH - Online Check', 'US|CA', 'achValidation' ),
|
49 |
+
( 'BARPAY', 'BARPAY', 'DE', 'emptyValidation' ),
|
50 |
+
( 'EPS', 'EPS', 'AT', 'emptyValidation' ),
|
51 |
+
( 'IDEAL', 'iDEAL', 'NL', 'idealValidation' ),
|
52 |
+
( 'GIROPAY', 'GiroPay', 'DE', 'giropayValidation' ),
|
53 |
+
( 'YELLOWPAY', 'YellowPay', 'CH', 'emptyValidation' ),
|
54 |
+
( 'EuroDebit', 'EuroDebit', 'DE|AT|NL', 'eurodebitValidation' ),
|
55 |
+
( 'DIRECTPAYMAX', 'Pay by Bank', 'DE|US', 'directpaymaxValidation' ),
|
56 |
+
( 'DIRECTPAY', 'Directpay', 'AD|AT|BE|CH|CY|CZ|DE|DK|EE|ES|FI|FR|GB|GI|GR|HR|HU|IE|IS|IT|LT|LU|LV|MK|MT|NL|NO|PL|PT|RO|RS|SE|SI|SK|TN|TR|US', 'emptyValidation' ),
|
57 |
+
( 'PAYSAFE', 'Paysafecard', 'AR|AT|BE|CH|CS|CY|CZ|DE|DK|ES|FI|FR|GB|GR|IE|IT|LU|LV|MX|NL|NO|PL|PT|RO|SE|SI|US', 'emptyValidation' ),
|
58 |
+
( 'POLI', 'POLi', 'AU|NZ', 'emptyValidation' ),
|
59 |
+
( 'PRZELEWY', 'Przelewy24', 'PL', 'emptyValidation' ),
|
60 |
+
( 'TELEINGRESO', 'Teleingreso', 'ES', 'emptyValidation' ),
|
61 |
+
( 'SEPA', 'EuroDebit SEPA', 'BE|BG|CH|CY|CZ|DK|ES|FI|FR|GB|GR|HU|IE|IS|IT|LI|LT|LU|LV|MC|MT|NO|PL|PT|RO|SE|SI|SK', 'sepaValidation' ),
|
62 |
+
( 'TELEPAY', 'TelePay', 'MX', 'emptyValidation' ),
|
63 |
+
( 'QIWI', 'QIWI', 'RU', 'emptyValidation' );
|
64 |
+
|
65 |
+
|
66 |
+
");
|
67 |
|
68 |
// ( 'CreditCard', 'Credit Card', 'AD|AE|AF|AG|AI|AL|AM|AN|AO|AQ|AR|AS|AT|AU|AW|AZ|BA|BB|BD|BE|BF|BG|BH|BI|BJ|BM|BN|BO|BR|BS|BT|BW|BY|BZ|CA|CD|CH|CI|CK|CL|CM|CN|CO|CR|RS|CU|CV|CY|CZ|DE|DJ|DK|DM|DO|DZ|EC|EE|EG|ES|ET|FI|FJ|FK|FM|FO|FR|GA|GB|GD|GE|GF|GH|GI|GL|GM|GN|GP|GQ|GR|GT|GU|GW|GY|HK|HN|HR|HT|HU|ID|IE|IL|IN|IQ|IR|IS|IT|JM|JO|JP|KE|KG|KH|KI|KM|KN|KR|KW|KY|KZ|LA|LB|LC|LI|LK|LR|LS|LT|LU|LV|LY|MA|MC|MG|ML|MM|MN|MO|MR|MS|MT|MU|MV|MW|MX|MY|MZ|NA|NC|NE|NG|NI|NL|NO|NP|NR|NZ|OM|PA|PE|PF|PG|PH|PK|PL|PM|PR|PT|PY|QA|RO|RU|RW|SA|SB|SC|SE|SG|SH|SI|SK|SL|SM|SN|SO|SR|ST|SV|SY|SZ|TC|TD|TG|TH|TJ|TM|TN|TO|TR|TT|TW|TZ|UA|UG|US|UY|UZ|VA|VC|VE|VG|VN|VU|WF|WS|YE|YT|YU|ZA|ZM|ZR|ZW', 'creditcardValidation' ),
|
69 |
// ( 'BrazilPay', 'BrazilPay', 'BR', 'brazilpayValidation' ),
|
71 |
// ( 'FASTERPAY', 'FasterPay', 'GB' ),
|
72 |
|
73 |
$installer->endSetup();
|
74 |
+
|
75 |
|
76 |
|
app/design/frontend/base/default/layout/alternativepayments.xml
CHANGED
@@ -21,16 +21,16 @@
|
|
21 |
|
22 |
-->
|
23 |
<layout version="0.1.0">
|
24 |
-
|
25 |
<alternativepayments_processing_payment>
|
26 |
<reference name="head">
|
27 |
-
|
28 |
<action method="addItem"><type>skin_js</type><name>alternativepayments/jquery-1.8.3.min.js</name></action>
|
29 |
<action method="addItem"><type>skin_js</type><name>alternativepayments/jquery.easing.1.3.js</name></action>
|
30 |
-
|
31 |
</reference>
|
32 |
</alternativepayments_processing_payment>
|
33 |
-
|
34 |
<default>
|
35 |
<reference name="head">
|
36 |
<action method="addItem"><type>skin_css</type><file>alternativepayments/css/styles.css</file></action>
|
21 |
|
22 |
-->
|
23 |
<layout version="0.1.0">
|
24 |
+
<!--
|
25 |
<alternativepayments_processing_payment>
|
26 |
<reference name="head">
|
27 |
+
|
28 |
<action method="addItem"><type>skin_js</type><name>alternativepayments/jquery-1.8.3.min.js</name></action>
|
29 |
<action method="addItem"><type>skin_js</type><name>alternativepayments/jquery.easing.1.3.js</name></action>
|
30 |
+
|
31 |
</reference>
|
32 |
</alternativepayments_processing_payment>
|
33 |
+
-->
|
34 |
<default>
|
35 |
<reference name="head">
|
36 |
<action method="addItem"><type>skin_css</type><file>alternativepayments/css/styles.css</file></action>
|
app/{code/community/AlternativePaymentsInc/AlternativePayments/Block/Postback.php → design/frontend/base/default/template/alternativepayments/form/telepay.phtml}
RENAMED
@@ -4,10 +4,10 @@
|
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
7 |
-
* This source file is subject to the
|
8 |
-
* that is bundled with this package in the file
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/
|
11 |
* If you did not receive a copy of the license and are unable to
|
12 |
* obtain it through the world-wide-web, please send an email
|
13 |
* to license@magentocommerce.com so we can send you a copy immediately.
|
@@ -18,17 +18,11 @@
|
|
18 |
* versions in the future. If you wish to customize Magento for your
|
19 |
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
*
|
21 |
-
* @category
|
22 |
-
* @package
|
23 |
* @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
protected function _construct()
|
30 |
-
{
|
31 |
-
parent::_construct();
|
32 |
-
$this->setTemplate('alternativepayments/postback.phtml');
|
33 |
-
}
|
34 |
-
}
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
* If you did not receive a copy of the license and are unable to
|
12 |
* obtain it through the world-wide-web, please send an email
|
13 |
* to license@magentocommerce.com so we can send you a copy immediately.
|
18 |
* versions in the future. If you wish to customize Magento for your
|
19 |
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
* @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
+
?>
|
27 |
+
|
28 |
+
<?php echo $this->__('Proceed to SUBMIT ORDER for payment instructions') ?>
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/alternativepayments/postback.phtml
DELETED
@@ -1,130 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/afl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
* DISCLAIMER
|
16 |
-
*
|
17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
-
* versions in the future. If you wish to customize Magento for your
|
19 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
-
*
|
21 |
-
* @category design
|
22 |
-
* @package base_default
|
23 |
-
* @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
|
24 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
-
*/
|
26 |
-
?>
|
27 |
-
<?php
|
28 |
-
|
29 |
-
// Retrieve order
|
30 |
-
|
31 |
-
/*
|
32 |
-
if ($_SERVER['REQUEST_METHOD'] == "POST" && isset($_POST["transactionNumber"]) ) {
|
33 |
-
|
34 |
-
$validated = $_POST['status'];
|
35 |
-
|
36 |
-
if ($_POST['account'] == $_POST['pricepoint']) {
|
37 |
-
|
38 |
-
if ($_POST['error'] == "" && $validated == "APPROVED") {
|
39 |
-
|
40 |
-
$orderId = $_POST["passthru"];
|
41 |
-
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
42 |
-
|
43 |
-
Mage::log(var_export($order->debug(), TRUE), null,'$orderOBJ_post.log');
|
44 |
-
|
45 |
-
// $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Gateway has authorized the payment.');
|
46 |
-
// $order->setStatus('processing_paid');
|
47 |
-
// $order->sendNewOrderEmail();
|
48 |
-
// $order->setEmailSent(true);
|
49 |
-
// $order->save();
|
50 |
-
|
51 |
-
// Mage::getSingleton('checkout/session')->unsQuoteId();
|
52 |
-
|
53 |
-
return Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('checkout/onepage/success'));
|
54 |
-
|
55 |
-
} else if ($_POST['error'] != "" && $validated == "DECLINED") {
|
56 |
-
|
57 |
-
// $err_msg = $_POST['error'];
|
58 |
-
// $orderId = $_POST["passthru"];
|
59 |
-
// $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
60 |
-
|
61 |
-
// $order->cancel()->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, "Gateway has declined the payment. Error: $err_msg")->save();
|
62 |
-
|
63 |
-
// Mage::getSingleton('checkout/session')->unsQuoteId();
|
64 |
-
|
65 |
-
return Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('checkout/onepage/failure'));
|
66 |
-
|
67 |
-
}
|
68 |
-
}
|
69 |
-
else
|
70 |
-
Mage_Core_Controller_Varien_Action::_redirect('../..');
|
71 |
-
|
72 |
-
} else
|
73 |
-
*/
|
74 |
-
|
75 |
-
if ($_SERVER['REQUEST_METHOD'] == "GET" && isset($_GET["transactionNumber"]) ) {
|
76 |
-
|
77 |
-
$validated = $_GET['status'];
|
78 |
-
|
79 |
-
if ($_GET['account'] == $_GET['pricepoint']) {
|
80 |
-
|
81 |
-
if ( $_GET['error'] == "" && $validated == "APPROVED")
|
82 |
-
{
|
83 |
-
|
84 |
-
$orderId = $_GET["passthru"];
|
85 |
-
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
86 |
-
|
87 |
-
Mage::log(var_export($order->debug(), TRUE), null,'$orderOBJ_get_postback.log');
|
88 |
-
|
89 |
-
if ($order->getState() == "new") {
|
90 |
-
|
91 |
-
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Gateway has authorized the payment.');
|
92 |
-
$order->setStatus('processing_paid');
|
93 |
-
$order->sendNewOrderEmail();
|
94 |
-
$order->setEmailSent(true);
|
95 |
-
$order->save();
|
96 |
-
|
97 |
-
Mage::getSingleton('checkout/session')->unsQuoteId();
|
98 |
-
return Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('alternativepayments/index/success'));
|
99 |
-
|
100 |
-
}
|
101 |
-
|
102 |
-
Mage::getSingleton('checkout/session')->unsQuoteId();
|
103 |
-
return Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('alternativepayments/index/isapprove'));
|
104 |
-
|
105 |
-
} else if ($_GET['error'] != "" && $validated == "DECLINED") {
|
106 |
-
|
107 |
-
$err_msg = $_GET['error'];
|
108 |
-
$orderId = $_GET["passthru"];
|
109 |
-
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
110 |
-
|
111 |
-
$order->cancel()->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, "Gateway has declined the payment. Error: $err_msg")->save();
|
112 |
-
|
113 |
-
Mage::getSingleton('checkout/session')->unsQuoteId();
|
114 |
-
|
115 |
-
return Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('alternativepayments/index/failure'));
|
116 |
-
|
117 |
-
}
|
118 |
-
}
|
119 |
-
else
|
120 |
-
Mage_Core_Controller_Varien_Action::_redirect('../..');
|
121 |
-
}
|
122 |
-
|
123 |
-
?>
|
124 |
-
|
125 |
-
<html><body>
|
126 |
-
</body></html>
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/alternativepayments/redirect.phtml
CHANGED
@@ -28,19 +28,28 @@
|
|
28 |
|
29 |
// Retrieve order
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
if ($_SERVER['REQUEST_METHOD'] == "POST" && isset($_POST["transactionNumber"]) ) {
|
33 |
|
34 |
$validated = $_POST['status'];
|
35 |
|
36 |
if ($_POST['account'] == $_POST['pricepoint']) {
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
$orderId = $_POST["passthru"];
|
41 |
-
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
42 |
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
// $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Gateway has authorized the payment.');
|
46 |
// $order->setStatus('processing_paid');
|
@@ -75,12 +84,13 @@
|
|
75 |
|
76 |
if ($_GET['account'] == $_GET['pricepoint']) {
|
77 |
|
78 |
-
|
|
|
|
|
|
|
|
|
79 |
{
|
80 |
-
|
81 |
-
$orderId = $_GET["passthru"];
|
82 |
-
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
83 |
-
|
84 |
// Mage::log(var_export($order->debug(), TRUE), null,'$orderOBJ_get_postback.log');
|
85 |
|
86 |
if ($order->getState() == "new") {
|
28 |
|
29 |
// Retrieve order
|
30 |
|
31 |
+
/*
|
32 |
+
$req_dump = print_r($_POST, TRUE);
|
33 |
+
$fp = fopen(Mage::getBaseDir('base')."/var/log/post!!!.txt", 'a');
|
34 |
+
fwrite($fp, $req_dump);
|
35 |
+
fclose($fp);
|
36 |
+
*/
|
37 |
|
38 |
if ($_SERVER['REQUEST_METHOD'] == "POST" && isset($_POST["transactionNumber"]) ) {
|
39 |
|
40 |
$validated = $_POST['status'];
|
41 |
|
42 |
if ($_POST['account'] == $_POST['pricepoint']) {
|
43 |
+
|
44 |
+
$orderId = $_POST["passthru"];
|
45 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
|
|
|
|
46 |
|
47 |
+
if ($_POST['error'] == "" && $validated == "APPROVED" && $_POST["ip"] == $order->getRemoteIp()) {
|
48 |
+
|
49 |
+
// $orderId = $_POST["passthru"];
|
50 |
+
// $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
51 |
+
|
52 |
+
// Mage::log(var_export($order->debug(), TRUE), null,'$orderOBJ_post.log');
|
53 |
|
54 |
// $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Gateway has authorized the payment.');
|
55 |
// $order->setStatus('processing_paid');
|
84 |
|
85 |
if ($_GET['account'] == $_GET['pricepoint']) {
|
86 |
|
87 |
+
$orderId = $_GET["passthru"];
|
88 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
89 |
+
|
90 |
+
|
91 |
+
if ( $_GET['error'] == "" && $validated == "APPROVED" && $_GET["ip"] == $order->getRemoteIp() )
|
92 |
{
|
93 |
+
|
|
|
|
|
|
|
94 |
// Mage::log(var_export($order->debug(), TRUE), null,'$orderOBJ_get_postback.log');
|
95 |
|
96 |
if ($order->getState() == "new") {
|
app/design/frontend/base/default/template/alternativepayments/response.phtml
DELETED
@@ -1,44 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/afl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
* DISCLAIMER
|
16 |
-
*
|
17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
-
* versions in the future. If you wish to customize Magento for your
|
19 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
-
*
|
21 |
-
* @category design
|
22 |
-
* @package base_default
|
23 |
-
* @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
|
24 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
-
*/
|
26 |
-
?>
|
27 |
-
<?php
|
28 |
-
// Retrieve order
|
29 |
-
//if(Mage::getSingleton('customer/session')->isLoggedIn()):
|
30 |
-
$value1 = Mage::getSingleton('alternativepayments/session')->getYYY();
|
31 |
-
$value2 = unserialize(Mage::getSingleton('alternativepayments/session')->getPostBack());
|
32 |
-
$val2 = unserialize(Mage::getSingleton('alternativepayments/session')->getBackFlag());
|
33 |
-
//endif;
|
34 |
-
if ($val2 == 'TRUE') {
|
35 |
-
echo $this->__('Redirect to payment service...');
|
36 |
-
$val2 = unserialize(Mage::getSingleton('alternativepayments/session')->setBackFlag(serialize('FALSE')));
|
37 |
-
echo $value2;
|
38 |
-
} else {
|
39 |
-
Mage::app()->getFrontController()->getResponse()->setRedirect('../checkout/cart/');
|
40 |
-
}
|
41 |
-
|
42 |
-
|
43 |
-
?>
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>AlternativePaymentsInc_AlternativePayments</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/OSL-3.0">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
@@ -26,10 +26,10 @@ Teleingreso
|
|
26 |
EuroDebit SEPA
|
27 |
QIWI</description>
|
28 |
<notes>This module adds the wide range of different alternative payment methods.</notes>
|
29 |
-
<authors><author><name>Alternative Payments Inc</name><user>
|
30 |
-
<date>2013-
|
31 |
-
<time>
|
32 |
-
<contents><target name="magecommunity"><dir name="AlternativePaymentsInc"><dir name="AlternativePayments"><dir name="Block"><file name="Form.php" hash="7872bc7c6373e95cd6baa62308c761e8"/><file name="PaymentInfo.php" hash="f9fd55ba85bf393b477e8349ce111189"/><file name="
|
33 |
<compatible/>
|
34 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Mygento_JQueryLib</name><channel>community</channel><min>1.8.1.0</min><max></max></package></required></dependencies>
|
35 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>AlternativePaymentsInc_AlternativePayments</name>
|
4 |
+
<version>1.0.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/OSL-3.0">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
26 |
EuroDebit SEPA
|
27 |
QIWI</description>
|
28 |
<notes>This module adds the wide range of different alternative payment methods.</notes>
|
29 |
+
<authors><author><name>Alternative Payments Inc</name><user>alternativepayments</user><email>magento@alternativepayments.com</email></author></authors>
|
30 |
+
<date>2013-02-04</date>
|
31 |
+
<time>10:12:07</time>
|
32 |
+
<contents><target name="magecommunity"><dir name="AlternativePaymentsInc"><dir name="AlternativePayments"><dir name="Block"><file name="Form.php" hash="7872bc7c6373e95cd6baa62308c761e8"/><file name="PaymentInfo.php" hash="f9fd55ba85bf393b477e8349ce111189"/><file name="Redirect.php" hash="6da455eed980c9cc81dc6faba3fb07c5"/></dir><dir name="Helper"><file name="Data.php" hash="a34b1fde4d3fd9f7fe3c1c9cd466735a"/></dir><dir name="Model"><file name="Dbiban.php" hash="77570789806b0777dd080aff5297b36f"/><file name="Dbsource.php" hash="0901fcf408b616e3dece942c36466ebd"/><dir name="Mysql4"><dir name="Dbiban"><file name="Collection.php" hash="3308f64b6eb00f45f11f14f15e6bd455"/></dir><file name="Dbiban.php" hash="27488a50bffc0283cf7d9ca7bf1100f9"/><dir name="Dbsource"><file name="Collection.php" hash="cf58c8f838e9a60bc9df251fa79813ce"/></dir><file name="Dbsource.php" hash="cb7421422905d1b71aab74bc6a0657c6"/></dir><dir name="Resource"><file name="Setup.php" hash="c895acc6ccdd12f3f1dc656fa0075c9a"/></dir><file name="Session.php" hash="935ad9754dd2be70455bb77dde200056"/><file name="Standard.php" hash="463a166d1b14d47918b847a34f2519a9"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Allowtypeall.php" hash="5e8a9672c445a9ea959863d10bf01581"/><dir name="Payment"><file name="Alternativepaymenttype.php" hash="f46c88e5b2185f11a4c97ea7b9e65d34"/></dir><file name="Testmode.php" hash="ea23e270155e949398963977a3281bf4"/></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="3f140638fb6a07b14594783784fff77a"/><file name="PaymentController.php" hash="762ba0744fd3c4f5ee4bfa85033f27eb"/></dir><dir name="etc"><file name="config.xml" hash="e226e38324c2be5ecac9825553a01d25"/><file name="system.xml" hash="1cac30c10c888f3e62e79147c3fe6e2a"/></dir><dir name="sql"><dir name="alternativepayments_setup"><file name="mysql4-install-0.1.0.php" hash="55837bbfa25529cbbf463ed6775951a0"/><file name="mysql4-upgrade-0.1.0-0.1.4.php" hash="d29e5b80d189e99601ef34de81297067"/><file name="mysql4-upgrade-0.1.4-0.2.0.php" hash="67731c22b9017e2988e037f5f2a6ec09"/><file name="mysql4-upgrade-0.2.0-0.2.2.php" hash="28e1ed22715f799d2ae785d12553ba34"/><file name="mysql4-upgrade-0.2.2-1.0.0.php" hash="e02d2be64400e4aef70a9f67b6242ca3"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="737de6352262b4dac5dcb374d5db64cf"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="AlternativePaymentsInc_AlternativePayments.xml" hash="c95eef35957a05ed40dbc8f038432c6a"/></dir></target><target name="magelocale"><dir name="en_US"><file name="AlternativePaymentsInc_AlternativePayments.csv" hash="8ddcaf54ac93ec7b5af8b5f9c4df350a"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="alternativepayments"><file name="failure.phtml" hash="9a6181d271abaa1250857a8f26394afe"/><dir name="form"><file name="ach.phtml" hash="3ab3dce8e907f6a26a58e2fc74010c7f"/><file name="barpay.phtml" hash="d2bb7cad795645f5b0ed3d32c933cec3"/><file name="brazilpay.phtml" hash="1ebcedd34b5bb07188a928f748172846"/><file name="chinadebit.phtml" hash="56bbeed4548aad597a9784dc1ed5deba"/><file name="creditcard.phtml" hash="a6ee16f20da3e30f5e69b842733d735d"/><file name="directpay.phtml" hash="ad1411f184341fca5db6a4835604fcd1"/><file name="directpaymax.phtml" hash="c2ffc0a97df4342de20039634af4e2f0"/><file name="eps.phtml" hash="d2bb7cad795645f5b0ed3d32c933cec3"/><file name="eurodebit.phtml" hash="862e8f92191801bd180a3b9ea231f3e7"/><file name="giropay.phtml" hash="dee7411000671a92ec6566d056ff64a6"/><file name="ideal.phtml" hash="9fa3d535b9dcffe76d31b10b4dee18f7"/><file name="paysafe.phtml" hash="d2bb7cad795645f5b0ed3d32c933cec3"/><file name="poli.phtml" hash="d2bb7cad795645f5b0ed3d32c933cec3"/><file name="przelewy.phtml" hash="d2bb7cad795645f5b0ed3d32c933cec3"/><file name="qiwi.phtml" hash="d2bb7cad795645f5b0ed3d32c933cec3"/><file name="sepa.phtml" hash="fb93dbf3d6efad1f29de17eb7554c43e"/><file name="teleingreso.phtml" hash="07d2fb74b92b506fd5c94700d288d66d"/><file name="telepay.phtml" hash="d2bb7cad795645f5b0ed3d32c933cec3"/><file name="yellowpay.phtml" hash="092ff9792b4ab8a1f1cee1cce9c5c96b"/></dir><file name="form.phtml" hash="a2714b2ac583cc595a9afa63f93df2e7"/><file name="isapprove.phtml" hash="c527d3e50ca91452420cccb3053a90cf"/><file name="redirect.phtml" hash="ed106333c9638351b909d409abe5dfd0"/><file name="success.phtml" hash="5b505b11de29af9fa3e587e5c54af25e"/></dir></dir><dir name="layout"><file name="alternativepayments.xml" hash="9281d6239a2dc92c05ff040d4272df9b"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="alternativepayments"><dir name="css"><file name="styles.css" hash="fb7201cf0a6971e2a6815448b4f5c194"/></dir><dir name="images"><file name="cvv22.gif" hash="83cdd38bf110b0f9c52fe84b56f45298"/><file name="information.png" hash="db8ec00f3807b9c6a4f83f860507473c"/><file name="phoneverf1.jpg" hash="e767327aeb2ac74f63dab481102963ab"/><file name="phoneverf2.jpg" hash="8a2b8e54fcc8ed9e9d374798b9a151df"/><file name="phoneverf3.jpg" hash="6e01da6a98e7416993974867e155350a"/><file name="phoneverf4.jpg" hash="c2d41b2e90ff26d1cd5b25c104bd14e5"/><file name="qm.gif" hash="90db9e3e88dbd76eaf7c1f902262ddc6"/></dir></dir></dir></dir></dir></target></contents>
|
33 |
<compatible/>
|
34 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Mygento_JQueryLib</name><channel>community</channel><min>1.8.1.0</min><max></max></package></required></dependencies>
|
35 |
</package>
|