Version Notes
This is first release.
Download this release
Release Info
Developer | Unicode Systems |
Extension | Payhub_Payment |
Version | 0.1.0 |
Comparing to | |
See all releases |
Version 0.1.0
- app/code/community/Uni/Payhub/Block/Form/Payhub.php +15 -0
- app/code/community/Uni/Payhub/Block/Info/Payhub.php +43 -0
- app/code/community/Uni/Payhub/Helper/Data.php +96 -0
- app/code/community/Uni/Payhub/Model/Standard.php +39 -0
- app/code/community/Uni/Payhub/controllers/PaymentController.php +51 -0
- app/code/community/Uni/Payhub/etc/adminhtml.xml +31 -0
- app/code/community/Uni/Payhub/etc/config.xml +126 -0
- app/code/community/Uni/Payhub/etc/system.xml +139 -0
- app/design/frontend/base/default/layout/payhub.xml +18 -0
- app/design/frontend/base/default/template/payhub/processing.phtml +17 -0
- app/design/frontend/base/default/template/payhub/redirect.phtml +23 -0
- app/etc/modules/Uni_Payhub.xml +10 -0
- package.xml +20 -0
app/code/community/Uni/Payhub/Block/Form/Payhub.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Unicode Systems
|
5 |
+
* @category Uni
|
6 |
+
* @package Uni_Payhub
|
7 |
+
* @copyright Copyright (c) 2010-2011 Unicode Systems. (http://www.unicodesystems.in)
|
8 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
9 |
+
*/
|
10 |
+
?>
|
11 |
+
|
12 |
+
<?php
|
13 |
+
|
14 |
+
class Uni_Payhub_Block_Form_Payhub extends Mage_Payment_Block_Form_Ccsave{
|
15 |
+
}
|
app/code/community/Uni/Payhub/Block/Info/Payhub.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Unicode Systems
|
5 |
+
* @category Uni
|
6 |
+
* @package Uni_Payhub
|
7 |
+
* @copyright Copyright (c) 2010-2011 Unicode Systems. (http://www.unicodesystems.in)
|
8 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
9 |
+
*/
|
10 |
+
?>
|
11 |
+
|
12 |
+
<?php
|
13 |
+
|
14 |
+
class Uni_Payhub_Block_Info_Payhub extends Mage_Payment_Block_Info {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Payment info block
|
18 |
+
* @param type $transport
|
19 |
+
* @return type
|
20 |
+
*/
|
21 |
+
protected function _prepareSpecificInformation($transport = null) {
|
22 |
+
if (null !== $this->_paymentSpecificInformation) {
|
23 |
+
return $this->_paymentSpecificInformation;
|
24 |
+
}
|
25 |
+
$info = $this->getInfo();
|
26 |
+
$ccname = Mage::getConfig()->getNode('global/payment/cc/types/' . $info->getCcType() . '/name');
|
27 |
+
if (Mage::app()->getStore()->isAdmin()):
|
28 |
+
$ccnum = $info->getCcNumber();
|
29 |
+
else:
|
30 |
+
$ccnum = 'xxxx-' . $info->getCcLast4();
|
31 |
+
endif;
|
32 |
+
$transport = new Varien_Object();
|
33 |
+
$transport = parent::_prepareSpecificInformation($transport);
|
34 |
+
$transport->addData(array(
|
35 |
+
Mage::helper('payment')->__('Credit Card Type') => $ccname,
|
36 |
+
Mage::helper('payment')->__('Credit Card Number') => $ccnum,
|
37 |
+
Mage::helper('payment')->__('Name on the Card') => $info->getCcOwner(),
|
38 |
+
Mage::helper('payment')->__('Expiration Date') => $info->getCcExpMonth() . ' / ' . $info->getCcExpYear(),
|
39 |
+
));
|
40 |
+
return $transport;
|
41 |
+
}
|
42 |
+
|
43 |
+
}
|
app/code/community/Uni/Payhub/Helper/Data.php
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Unicode Systems
|
5 |
+
* @category Uni
|
6 |
+
* @package Uni_Payhub
|
7 |
+
* @copyright Copyright (c) 2010-2011 Unicode Systems. (http://www.unicodesystems.in)
|
8 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
9 |
+
*/
|
10 |
+
?>
|
11 |
+
|
12 |
+
<?php
|
13 |
+
|
14 |
+
class Uni_Payhub_Helper_Data extends Mage_Core_Helper_Abstract {
|
15 |
+
/**
|
16 |
+
* payhubGateway send response on transaction process
|
17 |
+
* @return boolean
|
18 |
+
*/
|
19 |
+
public function payhubGateway() {
|
20 |
+
$orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
|
21 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
22 |
+
$checkout = Mage::getSingleton('checkout/session');
|
23 |
+
$data = $checkout->getPayhubPaymentDetail();
|
24 |
+
$checkout->unsetData('payhub_payment_detail');
|
25 |
+
$api_endpoint = "https://checkout.payhub.com/transaction/api";
|
26 |
+
if(Mage::getStoreConfig('payment/payhub/demo')):
|
27 |
+
$mode='demo';
|
28 |
+
else:
|
29 |
+
$mode='live';
|
30 |
+
endif;
|
31 |
+
$debug = true; #boolean
|
32 |
+
$sale_data = array("mode" => $mode,
|
33 |
+
//*********Merchant Account Details*************//
|
34 |
+
"orgid" => Mage::getStoreConfig('payment/payhub/orgid'),
|
35 |
+
"username" => Mage::getStoreConfig('payment/payhub/username'),
|
36 |
+
"password" => Mage::getStoreConfig('payment/payhub/password'),
|
37 |
+
"tid" => Mage::getStoreConfig('payment/payhub/tid'),
|
38 |
+
//*********Merchant Account Details*************//
|
39 |
+
"trans_type" => "sale",
|
40 |
+
"first_name" => $order->getCustomerFirstname(),
|
41 |
+
"last_name" => $order->getCustomerLastname(),
|
42 |
+
"phone" => $order->getBillingAddress()->getTelephone(),
|
43 |
+
"email" => $order->getCustomerEmail(),
|
44 |
+
"address1" => $order->getBillingAddress()->getStreet(),
|
45 |
+
"city" => $order->getBillingAddress()->getCity(),
|
46 |
+
"state" => $order->getBillingAddress()->getRegion(),
|
47 |
+
"zip" => $order->getBillingAddress()->getPostCode(),
|
48 |
+
"cc" => $data['cc_number'],
|
49 |
+
"month" => $data['cc_exp_month'],
|
50 |
+
"year" => $data['cc_exp_year'],
|
51 |
+
"cvv" => $data['cc_cid'],
|
52 |
+
"amount" => $order->getGrandTotal()
|
53 |
+
);
|
54 |
+
|
55 |
+
$json_payload = json_encode($sale_data);
|
56 |
+
|
57 |
+
$ch = curl_init();
|
58 |
+
|
59 |
+
$c_opts = array(CURLOPT_URL => $api_endpoint,
|
60 |
+
CURLOPT_VERBOSE => $debug,
|
61 |
+
CURLOPT_SSL_VERIFYHOST => 0,
|
62 |
+
CURLOPT_SSL_VERIFYPEER => true,
|
63 |
+
CURLOPT_HTTPHEADER => array('Content-Type: application/json'),
|
64 |
+
CURLOPT_RETURNTRANSFER => true,
|
65 |
+
CURLOPT_POST => true,
|
66 |
+
CURLOPT_POSTFIELDS => $json_payload);
|
67 |
+
|
68 |
+
curl_setopt_array($ch, $c_opts);
|
69 |
+
|
70 |
+
$result = curl_exec($ch);
|
71 |
+
|
72 |
+
curl_close($ch);
|
73 |
+
|
74 |
+
$result = json_decode($result);
|
75 |
+
|
76 |
+
if($debug) var_dump($result);
|
77 |
+
|
78 |
+
zend_debug::dump($sale_data);
|
79 |
+
|
80 |
+
if($result->RESPONSE_CODE == "00" || $result->RESPONSE_CODE == "08" || $result->RESPONSE_CODE == "11"|| $result->RESPONSE_CODE == "85")
|
81 |
+
{
|
82 |
+
#Success
|
83 |
+
Mage::getSingleton('core/session')->addSuccess($result->RESPONSE_TEXT);
|
84 |
+
Mage::getSingleton('core/session')->addSuccess('Your order has been received.');
|
85 |
+
return true;
|
86 |
+
}
|
87 |
+
else
|
88 |
+
{
|
89 |
+
#Fail
|
90 |
+
Mage::getSingleton('core/session')->addError($result->RESPONSE_TEXT);
|
91 |
+
return false;
|
92 |
+
}
|
93 |
+
|
94 |
+
}
|
95 |
+
|
96 |
+
}
|
app/code/community/Uni/Payhub/Model/Standard.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Unicode Systems
|
5 |
+
* @category Uni
|
6 |
+
* @package Uni_Payhub
|
7 |
+
* @copyright Copyright (c) 2010-2011 Unicode Systems. (http://www.unicodesystems.in)
|
8 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
9 |
+
*/
|
10 |
+
?>
|
11 |
+
<?php
|
12 |
+
|
13 |
+
class Uni_Payhub_Model_Standard extends Mage_Payment_Model_Method_Cc {
|
14 |
+
|
15 |
+
protected $_code = 'payhub';
|
16 |
+
protected $_formBlockType = 'payhub/form_payhub';
|
17 |
+
protected $_infoBlockType = 'payhub/info_payhub';
|
18 |
+
protected $_canSaveCc = true;
|
19 |
+
/**
|
20 |
+
* Process payment gateway
|
21 |
+
* @return type
|
22 |
+
*/
|
23 |
+
public function getOrderPlaceRedirectUrl() {
|
24 |
+
return Mage::getUrl('payhub/payment/redirect', array('_secure' => true));
|
25 |
+
}
|
26 |
+
/**
|
27 |
+
* Post data to use for payment
|
28 |
+
* @param type $observer
|
29 |
+
*/
|
30 |
+
public function beforeSavePaymentCustom($observer){
|
31 |
+
if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'checkout_onepage_savePayment')
|
32 |
+
{
|
33 |
+
$data = Mage::app()->getRequest()->getPost('payment', array());
|
34 |
+
$checkout = Mage::getSingleton('checkout/session');
|
35 |
+
$checkout->setPayhubPaymentDetail($data);
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
}
|
app/code/community/Uni/Payhub/controllers/PaymentController.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Unicode Systems
|
5 |
+
* @category Uni
|
6 |
+
* @package Uni_Payhub
|
7 |
+
* @copyright Copyright (c) 2010-2011 Unicode Systems. (http://www.unicodesystems.in)
|
8 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
9 |
+
*/
|
10 |
+
?>
|
11 |
+
<?php
|
12 |
+
class Uni_Payhub_PaymentController extends Mage_Core_Controller_Front_Action {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* The redirect action used to trigger when someone places an order.
|
16 |
+
*/
|
17 |
+
public function redirectAction() {
|
18 |
+
$this->loadLayout();
|
19 |
+
$block = $this->getLayout()->createBlock('Mage_Core_Block_Template', 'payhub', array('template' => 'payhub/redirect.phtml'));
|
20 |
+
echo $block;
|
21 |
+
$this->getLayout()->getBlock('content')->append($block);
|
22 |
+
$this->renderLayout();
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* The response action used to trigger when your gateway sends back a response after processing the customer's payment.
|
27 |
+
*/
|
28 |
+
public function responseAction() {
|
29 |
+
|
30 |
+
$model = Mage::helper('payhub');
|
31 |
+
if ($model->payhubGateway()) {
|
32 |
+
Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/success', array('_secure' => true));
|
33 |
+
} else {
|
34 |
+
$this->cancelAction();
|
35 |
+
Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/failure', array('_secure' => true));
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* The cancel action used to trigger when an order is to be cancelled.
|
41 |
+
*/
|
42 |
+
public function cancelAction() {
|
43 |
+
if (Mage::getSingleton('checkout/session')->getLastRealOrderId()) {
|
44 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());
|
45 |
+
if ($order->getId()) {
|
46 |
+
$order->cancel()->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, 'Gateway has declined the payment.')->save();
|
47 |
+
}
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
}
|
app/code/community/Uni/Payhub/etc/adminhtml.xml
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Unicode Systems
|
5 |
+
* @category Uni
|
6 |
+
* @package Uni_Payhub
|
7 |
+
* @copyright Copyright (c) 2010-2011 Unicode Systems. (http://www.unicodesystems.in)
|
8 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<config>
|
12 |
+
<acl>
|
13 |
+
<resources>
|
14 |
+
<admin>
|
15 |
+
<children>
|
16 |
+
<system>
|
17 |
+
<children>
|
18 |
+
<config>
|
19 |
+
<children>
|
20 |
+
<payhub translate="title" module="payhub">
|
21 |
+
<title>Payment Methods Section</title>
|
22 |
+
</payhub>
|
23 |
+
</children>
|
24 |
+
</config>
|
25 |
+
</children>
|
26 |
+
</system>
|
27 |
+
</children>
|
28 |
+
</admin>
|
29 |
+
</resources>
|
30 |
+
</acl>
|
31 |
+
</config>
|
app/code/community/Uni/Payhub/etc/config.xml
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Unicode Systems
|
5 |
+
* @category Uni
|
6 |
+
* @package Uni_Payhub
|
7 |
+
* @copyright Copyright (c) 2010-2011 Unicode Systems. (http://www.unicodesystems.in)
|
8 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
|
12 |
+
<config>
|
13 |
+
<modules>
|
14 |
+
<Uni_Payhub>
|
15 |
+
<version>0.1.0</version>
|
16 |
+
</Uni_Payhub>
|
17 |
+
</modules>
|
18 |
+
<frontend>
|
19 |
+
<routers>
|
20 |
+
<payhub>
|
21 |
+
<use>standard</use>
|
22 |
+
<args>
|
23 |
+
<module>Uni_Payhub</module>
|
24 |
+
<frontName>payhub</frontName>
|
25 |
+
</args>
|
26 |
+
</payhub>
|
27 |
+
</routers>
|
28 |
+
<events>
|
29 |
+
<controller_action_predispatch>
|
30 |
+
<observers>
|
31 |
+
<before_save_payment_custom>
|
32 |
+
<class>payhub/standard</class>
|
33 |
+
<method>beforeSavePaymentCustom</method>
|
34 |
+
</before_save_payment_custom>
|
35 |
+
</observers>
|
36 |
+
</controller_action_predispatch>
|
37 |
+
</events>
|
38 |
+
<layout>
|
39 |
+
<updates>
|
40 |
+
<payhub>
|
41 |
+
<file>payhub.xml</file>
|
42 |
+
</payhub>
|
43 |
+
</updates>
|
44 |
+
</layout>
|
45 |
+
</frontend>
|
46 |
+
<global>
|
47 |
+
<models>
|
48 |
+
<payhub>
|
49 |
+
<class>Uni_Payhub_Model</class>
|
50 |
+
</payhub>
|
51 |
+
</models>
|
52 |
+
<helpers>
|
53 |
+
<payhub>
|
54 |
+
<class>Uni_Payhub_Helper</class>
|
55 |
+
</payhub>
|
56 |
+
</helpers>
|
57 |
+
<blocks>
|
58 |
+
<payhub>
|
59 |
+
<class>Uni_Payhub_Block</class>
|
60 |
+
</payhub>
|
61 |
+
</blocks>
|
62 |
+
<payment>
|
63 |
+
<cc>
|
64 |
+
<types>
|
65 |
+
<AE>
|
66 |
+
<code>AE</code>
|
67 |
+
<name>American Express</name>
|
68 |
+
<order>0</order>
|
69 |
+
</AE>
|
70 |
+
<VI>
|
71 |
+
<code>VI</code>
|
72 |
+
<name>Visa</name>
|
73 |
+
<order>10</order>
|
74 |
+
</VI>
|
75 |
+
<MC>
|
76 |
+
<code>MC</code>
|
77 |
+
<name>Master Card</name>
|
78 |
+
<order>20</order>
|
79 |
+
</MC>
|
80 |
+
<DI>
|
81 |
+
<code>DI</code>
|
82 |
+
<name>Discover</name>
|
83 |
+
<order>30</order>
|
84 |
+
</DI>
|
85 |
+
<SM>
|
86 |
+
<code>SM</code>
|
87 |
+
<name>Maestro/Switch</name>
|
88 |
+
<order>40</order>
|
89 |
+
</SM>
|
90 |
+
<SO>
|
91 |
+
<code>SO</code>
|
92 |
+
<name>Solo</name>
|
93 |
+
<order>45</order>
|
94 |
+
</SO>
|
95 |
+
<JCB>
|
96 |
+
<code>JCB</code>
|
97 |
+
<name>JCB</name>
|
98 |
+
<order>50</order>
|
99 |
+
</JCB>
|
100 |
+
<OT>
|
101 |
+
<code>OT</code>
|
102 |
+
<name>Other</name>
|
103 |
+
<order>1000</order>
|
104 |
+
</OT>
|
105 |
+
</types>
|
106 |
+
</cc>
|
107 |
+
</payment>
|
108 |
+
</global>
|
109 |
+
<default>
|
110 |
+
<payment>
|
111 |
+
<payhub>
|
112 |
+
<model>payhub/standard</model>
|
113 |
+
<active>1</active>
|
114 |
+
<demo>1</demo>
|
115 |
+
<orgid><![CDATA[1234]]></orgid>
|
116 |
+
<order_status><![CDATA[pending]]></order_status>
|
117 |
+
<title><![CDATA[Payhub]]></title>
|
118 |
+
<allowspecific>0</allowspecific>
|
119 |
+
<cctypes><![CDATA[AE,VI,MC,DI]]></cctypes>
|
120 |
+
<payment_action>sale</payment_action>
|
121 |
+
<allowspecific>0</allowspecific>
|
122 |
+
<sort_order></sort_order>
|
123 |
+
</payhub>
|
124 |
+
</payment>
|
125 |
+
</default>
|
126 |
+
</config>
|
app/code/community/Uni/Payhub/etc/system.xml
ADDED
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Unicode Systems
|
5 |
+
* @category Uni
|
6 |
+
* @package Uni_Payhub
|
7 |
+
* @copyright Copyright (c) 2010-2011 Unicode Systems. (http://www.unicodesystems.in)
|
8 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
|
12 |
+
<config>
|
13 |
+
<sections>
|
14 |
+
<payment>
|
15 |
+
<groups>
|
16 |
+
<payhub translate="label comment" module="payhub">
|
17 |
+
<label>Payhub</label>
|
18 |
+
<frontend_type>text</frontend_type>
|
19 |
+
<sort_order>10</sort_order>
|
20 |
+
<show_in_default>1</show_in_default>
|
21 |
+
<show_in_website>1</show_in_website>
|
22 |
+
<show_in_store>1</show_in_store>
|
23 |
+
<fields>
|
24 |
+
<active translate="label">
|
25 |
+
<label>Enabled</label>
|
26 |
+
<frontend_type>select</frontend_type>
|
27 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
28 |
+
<sort_order>10</sort_order>
|
29 |
+
<show_in_default>1</show_in_default>
|
30 |
+
<show_in_website>1</show_in_website>
|
31 |
+
<show_in_store>0</show_in_store>
|
32 |
+
</active>
|
33 |
+
<demo translate="label">
|
34 |
+
<label>Demo mode</label>
|
35 |
+
<frontend_type>select</frontend_type>
|
36 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
37 |
+
<sort_order>11</sort_order>
|
38 |
+
<show_in_default>1</show_in_default>
|
39 |
+
<show_in_website>1</show_in_website>
|
40 |
+
<show_in_store>1</show_in_store>
|
41 |
+
</demo>
|
42 |
+
<title translate="label">
|
43 |
+
<label>Title</label>
|
44 |
+
<frontend_type>text</frontend_type>
|
45 |
+
<sort_order>20</sort_order>
|
46 |
+
<show_in_default>1</show_in_default>
|
47 |
+
<show_in_website>1</show_in_website>
|
48 |
+
<show_in_store>1</show_in_store>
|
49 |
+
</title>
|
50 |
+
<orgid translate="label">
|
51 |
+
<label>Organization ID</label>
|
52 |
+
<comment>Your PayHub Organization ID. This is assigned to you when you setup an account with PayHub.</comment>
|
53 |
+
<frontend_type>text</frontend_type>
|
54 |
+
<sort_order>21</sort_order>
|
55 |
+
<show_in_default>1</show_in_default>
|
56 |
+
<show_in_website>1</show_in_website>
|
57 |
+
<show_in_store>1</show_in_store>
|
58 |
+
</orgid>
|
59 |
+
<username translate="label">
|
60 |
+
<label>API username</label>
|
61 |
+
<comment>Your API username. This can be found in the Admin section in Virtual Hub.</comment>
|
62 |
+
<frontend_type>text</frontend_type>
|
63 |
+
<sort_order>22</sort_order>
|
64 |
+
<show_in_default>1</show_in_default>
|
65 |
+
<show_in_website>1</show_in_website>
|
66 |
+
<show_in_store>1</show_in_store>
|
67 |
+
</username>
|
68 |
+
<password translate="label">
|
69 |
+
<label>API password</label>
|
70 |
+
<comment>Your API password. This can be found in the Admin section in Virtual Hub.</comment>
|
71 |
+
<frontend_type>password</frontend_type>
|
72 |
+
<sort_order>23</sort_order>
|
73 |
+
<show_in_default>1</show_in_default>
|
74 |
+
<show_in_website>1</show_in_website>
|
75 |
+
<show_in_store>1</show_in_store>
|
76 |
+
</password>
|
77 |
+
<tid translate="label">
|
78 |
+
<label>API Terminal ID</label>
|
79 |
+
<comment>Your API terminal ID. This can be found in the Admin section in Virtual Hub.</comment>
|
80 |
+
<frontend_type>password</frontend_type>
|
81 |
+
<sort_order>24</sort_order>
|
82 |
+
<show_in_default>1</show_in_default>
|
83 |
+
<show_in_website>1</show_in_website>
|
84 |
+
<show_in_store>1</show_in_store>
|
85 |
+
</tid>
|
86 |
+
<cctypes translate="label">
|
87 |
+
<label>Credit Card Types</label>
|
88 |
+
<frontend_type>multiselect</frontend_type>
|
89 |
+
<source_model>adminhtml/system_config_source_payment_cctype</source_model>
|
90 |
+
<sort_order>25</sort_order>
|
91 |
+
<show_in_default>1</show_in_default>
|
92 |
+
<show_in_website>1</show_in_website>
|
93 |
+
<show_in_store>0</show_in_store>
|
94 |
+
<can_be_empty>1</can_be_empty>
|
95 |
+
</cctypes>
|
96 |
+
<order_status translate="label">
|
97 |
+
<label>New Order Status</label>
|
98 |
+
<frontend_type>select</frontend_type>
|
99 |
+
<source_model>adminhtml/system_config_source_order_status</source_model>
|
100 |
+
<sort_order>50</sort_order>
|
101 |
+
<show_in_default>1</show_in_default>
|
102 |
+
<show_in_website>1</show_in_website>
|
103 |
+
<show_in_store>0</show_in_store>
|
104 |
+
</order_status>
|
105 |
+
<allowspecific translate="label">
|
106 |
+
<label>Payment Applicable From</label>
|
107 |
+
<frontend_type>select</frontend_type>
|
108 |
+
<sort_order>61</sort_order>
|
109 |
+
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
110 |
+
<show_in_default>1</show_in_default>
|
111 |
+
<show_in_website>1</show_in_website>
|
112 |
+
<show_in_store>0</show_in_store>
|
113 |
+
</allowspecific>
|
114 |
+
<specificcountry translate="label">
|
115 |
+
<label>Countries Payment Applicable From</label>
|
116 |
+
<frontend_type>multiselect</frontend_type>
|
117 |
+
<sort_order>70</sort_order>
|
118 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
119 |
+
<show_in_default>1</show_in_default>
|
120 |
+
<show_in_website>1</show_in_website>
|
121 |
+
<show_in_store>0</show_in_store>
|
122 |
+
<depends>
|
123 |
+
<allowspecific>1</allowspecific>
|
124 |
+
</depends>
|
125 |
+
</specificcountry>
|
126 |
+
<sort_order translate="label">
|
127 |
+
<label>Sort Order</label>
|
128 |
+
<frontend_type>text</frontend_type>
|
129 |
+
<sort_order>100</sort_order>
|
130 |
+
<show_in_default>1</show_in_default>
|
131 |
+
<show_in_website>1</show_in_website>
|
132 |
+
<show_in_store>0</show_in_store>
|
133 |
+
</sort_order>
|
134 |
+
</fields>
|
135 |
+
</payhub>
|
136 |
+
</groups>
|
137 |
+
</payment>
|
138 |
+
</sections>
|
139 |
+
</config>
|
app/design/frontend/base/default/layout/payhub.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Unicode Systems
|
5 |
+
* @category Uni
|
6 |
+
* @package Uni_Payhub
|
7 |
+
* @copyright Copyright (c) 2010-2011 Unicode Systems. (http://www.unicodesystems.in)
|
8 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
|
12 |
+
<layout version="0.1.0">
|
13 |
+
<payhub_payment_redirect>
|
14 |
+
<reference name="content">
|
15 |
+
<block type="core/template" template="payhub/processing.phtml"></block>
|
16 |
+
</reference>
|
17 |
+
</payhub_payment_redirect>
|
18 |
+
</layout>
|
app/design/frontend/base/default/template/payhub/processing.phtml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Unicode Systems
|
5 |
+
* @category Uni
|
6 |
+
* @package Uni_Payhub
|
7 |
+
* @copyright Copyright (c) 2010-2011 Unicode Systems. (http://www.unicodesystems.in)
|
8 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
9 |
+
*/
|
10 |
+
?>
|
11 |
+
|
12 |
+
<?php
|
13 |
+
|
14 |
+
?>
|
15 |
+
<div class='porocessing-payhub'>
|
16 |
+
<?php echo '<b>Please wait while your payment is being processed...</b>'?>
|
17 |
+
</div>
|
app/design/frontend/base/default/template/payhub/redirect.phtml
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Unicode Systems
|
5 |
+
* @category Uni
|
6 |
+
* @package Uni_Payhub
|
7 |
+
* @copyright Copyright (c) 2010-2011 Unicode Systems. (http://www.unicodesystems.in)
|
8 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
9 |
+
*/
|
10 |
+
?>
|
11 |
+
|
12 |
+
<?php
|
13 |
+
$_order = new Mage_Sales_Model_Order();
|
14 |
+
$orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
|
15 |
+
$_order->loadByIncrementId($orderId);
|
16 |
+
?>
|
17 |
+
<form name="payhubform" method="post" action="<?php echo $this->getUrl('payhub/payment/response'); ?>">
|
18 |
+
<input type="hidden" name="orderid" value="<?php echo $orderId; ?>">
|
19 |
+
<input type="hidden" name="grandtotal" value="<?php echo $_order->getBaseGrandTotal(); ?>">
|
20 |
+
</form>
|
21 |
+
<script type="text/javascript">
|
22 |
+
document.payhubform.submit();
|
23 |
+
</script>
|
app/etc/modules/Uni_Payhub.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Uni_Payhub>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
<version>0.1.0</version>
|
8 |
+
</Uni_Payhub>
|
9 |
+
</modules>
|
10 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Payhub_Payment</name>
|
4 |
+
<version>0.1.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>This extension allows merchant to receive payment through payhub payment gateway.</summary>
|
10 |
+
<description>This extension allows merchant to receive payment through payhub payment gateway.
|
11 |
+

|
12 |
+
Demo mode also available. In this extension.</description>
|
13 |
+
<notes>This is first release.</notes>
|
14 |
+
<authors><author><name>Unicode Systems</name><user>Unicode_Systems</user><email>magento@unicodesystems.in</email></author></authors>
|
15 |
+
<date>2014-10-20</date>
|
16 |
+
<time>06:43:00</time>
|
17 |
+
<contents><target name="magecommunity"><dir name="Uni"><dir name="Payhub"><dir name="Block"><dir name="Form"><file name="Payhub.php" hash="e8305c2d2344e63856478d808c9f5b8d"/></dir><dir name="Info"><file name="Payhub.php" hash="362613b04d7a474dda40d2474727155c"/></dir></dir><dir name="Helper"><file name="Data.php" hash="3dec2186251649b659f9a1dd0258b729"/></dir><dir name="Model"><file name="Standard.php" hash="15fa03c8295c2957c3996c802cf126c5"/></dir><dir name="controllers"><file name="PaymentController.php" hash="e623057c689138ac04a0be6c7575ea28"/></dir><dir name="etc"><file name="adminhtml.xml" hash="cc0b954191622ca59328ff1363ffeee6"/><file name="config.xml" hash="a12baa970004518091146467f6df3305"/><file name="system.xml" hash="52b3b8bc7b1ca589b385858f9fc6c8b2"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Uni_Payhub.xml" hash="64154654faffbc78bdc12ba702091b9d"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="payhub.xml" hash="2f7230d1c0f17566580fcaa518fc3d5c"/></dir><dir name="template"><dir name="payhub"><file name="processing.phtml" hash="339a7ca4c4acec32b172f87c6b5e28bd"/><file name="redirect.phtml" hash="e517cd8dfae4d8e0afd7db2a507f2cf8"/></dir></dir></dir></dir></dir></target></contents>
|
18 |
+
<compatible/>
|
19 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>1.8.1.0</max></package><extension><name>gd</name><min>2.0.28</min><max>3.0</max></extension></required></dependencies>
|
20 |
+
</package>
|