Version Notes
Techinflo Instamojo Payment gateway helps the magento customer to utilize the feature of making payments online.
All you need to have is a instamojo account and payment link to receive the payments.
This extension avails;
1. Debit Card Payments
2. Credit Card Payments
3. Net Banking Payments
Download this release
Release Info
Developer | Techinflo |
Extension | Techinflo_Instamojo |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/local/Techinflo/Instamojo/Helper/Data.php +164 -0
- app/code/local/Techinflo/Instamojo/Model/Standard.php +20 -0
- app/code/local/Techinflo/Instamojo/controllers/PaymentController.php +57 -0
- app/code/local/Techinflo/Instamojo/etc/config.xml +57 -0
- app/code/local/Techinflo/Instamojo/etc/system.xml +118 -0
- app/design/frontend/base/default/template/instamojo/redirect.phtml +84 -0
- app/etc/modules/Techinflo_Instamojo.xml +17 -0
- package.xml +30 -0
app/code/local/Techinflo/Instamojo/Helper/Data.php
ADDED
@@ -0,0 +1,164 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Package: Techinflo_Instamojo
|
4 |
+
* Edition: Community
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Developer: Sampath Kumar<Techinflo Team>
|
7 |
+
*/
|
8 |
+
|
9 |
+
class Techinflo_Instamojo_Helper_Data extends Mage_Core_Helper_Abstract
|
10 |
+
{ /**
|
11 |
+
* Get/Generate signature key for the current order object
|
12 |
+
* @return type string
|
13 |
+
*/
|
14 |
+
public function generateSecureKey(){
|
15 |
+
$_order = $this->getCurrentOrder();
|
16 |
+
//$orderIncId = $this->getOrderIncId($_order);
|
17 |
+
$userName = $this->getUserName($_order);
|
18 |
+
$privateSalt = $this->getPrivateSalt();
|
19 |
+
$orderAmt = $this->getGrandTotal($_order);
|
20 |
+
$userEmail = $this->getUserEmail($_order);
|
21 |
+
$userPhone = $this->getUserPhone($_order);
|
22 |
+
//$message = $orderAmt.'|'.$userEmail.'|'.$orderIncId.'|'.$userName.'|'.$userPhone;
|
23 |
+
$message = $orderAmt.'|'.$userEmail.'|'.$userName.'|'.$userPhone;
|
24 |
+
$signature = hash_hmac('sha1', $message, $privateSalt);
|
25 |
+
return $signature;
|
26 |
+
}
|
27 |
+
/**
|
28 |
+
* Get customer full name using the current order object
|
29 |
+
* @return type string
|
30 |
+
*/
|
31 |
+
public function getUserName($_order){
|
32 |
+
if(is_object($_order)){
|
33 |
+
$userName = $_order->getCustomerFirstname(). ' ' .$_order->getCustomerLastname();
|
34 |
+
return $userName;
|
35 |
+
}
|
36 |
+
return;
|
37 |
+
}
|
38 |
+
/**
|
39 |
+
* Get current order customer email id using order object
|
40 |
+
* @retrun type string
|
41 |
+
*/
|
42 |
+
public function getUserEmail($_order){
|
43 |
+
if(is_object($_order)){
|
44 |
+
$userEmail = $_order->getCustomerEmail();
|
45 |
+
return $userEmail;
|
46 |
+
}
|
47 |
+
return;
|
48 |
+
}
|
49 |
+
/**
|
50 |
+
* Get current order customer telephone number using order object
|
51 |
+
* @return type string
|
52 |
+
*/
|
53 |
+
public function getUserPhone($_order){
|
54 |
+
if(is_object($_order)){
|
55 |
+
$userPhone = $_order->getShippingAddress()->getTelephone();
|
56 |
+
return $userPhone;
|
57 |
+
}
|
58 |
+
return;
|
59 |
+
}
|
60 |
+
/**
|
61 |
+
* Get instamojo private salt element from configuration settings
|
62 |
+
* @return type string
|
63 |
+
*/
|
64 |
+
public function getPrivateSalt(){
|
65 |
+
$salt = Mage::getStoreConfig('payment/instamojo/salt');
|
66 |
+
return $salt;
|
67 |
+
}
|
68 |
+
/**
|
69 |
+
* Get instamojo private api key element from configuration settings
|
70 |
+
* @return type string
|
71 |
+
*/
|
72 |
+
public function getPrivateApiKey(){
|
73 |
+
$apikey = Mage::getStoreConfig('payment/instamojo/apikey');
|
74 |
+
return $apikey;
|
75 |
+
}
|
76 |
+
/**
|
77 |
+
* Get instamojo private auth token element from configuration settings
|
78 |
+
* @return type string
|
79 |
+
*/
|
80 |
+
public function getPrivateAuth(){
|
81 |
+
$authtoken = Mage::getStoreConfig('payment/instamojo/auth');
|
82 |
+
return $authtoken;
|
83 |
+
}
|
84 |
+
/**
|
85 |
+
* Get order increment id using order object
|
86 |
+
* @return type long int
|
87 |
+
*/
|
88 |
+
public function getOrderIncId($_order){
|
89 |
+
if(is_object($_order)){
|
90 |
+
$IncrementId = $_order->getIncrementId();
|
91 |
+
return $IncrementId;
|
92 |
+
}
|
93 |
+
return;
|
94 |
+
}
|
95 |
+
/**
|
96 |
+
* Get grand total using the order object
|
97 |
+
* @return type float
|
98 |
+
*/
|
99 |
+
public function getGrandTotal($_order){
|
100 |
+
if(is_object($_order)){
|
101 |
+
$grandTotal = str_replace(',', '', number_format($_order->getBaseGrandTotal(), 2));
|
102 |
+
return $grandTotal;
|
103 |
+
}
|
104 |
+
return;
|
105 |
+
}
|
106 |
+
/**
|
107 |
+
* Get Instampjo payment link from configuration settings
|
108 |
+
* @return type string
|
109 |
+
*/
|
110 |
+
public function getLinkUrl(){
|
111 |
+
$linkUrl = Mage::getStoreConfig('payment/instamojo/linkurl');
|
112 |
+
return $linkUrl;
|
113 |
+
}
|
114 |
+
/**
|
115 |
+
* Get current user order id using checkout session
|
116 |
+
* @return long int
|
117 |
+
*/
|
118 |
+
public function getCurrentOrderId(){
|
119 |
+
$_id = Mage::getSingleton('checkout/session')->getLastRealOrderId();
|
120 |
+
return $_id;
|
121 |
+
}
|
122 |
+
/**
|
123 |
+
* Load current user order using last real order id
|
124 |
+
* @return type object
|
125 |
+
*/
|
126 |
+
public function getCurrentOrder(){
|
127 |
+
$_orderid = $this->getCurrentOrderId();
|
128 |
+
if($_orderid){
|
129 |
+
$_order = Mage::getModel('sales/order')->loadByIncrementId($_orderid);
|
130 |
+
return $_order;
|
131 |
+
}
|
132 |
+
return;
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* Get instamojo payment details using the payment id
|
137 |
+
* @ return type array
|
138 |
+
*/
|
139 |
+
public function getPaymentDetail($payment_id){
|
140 |
+
if($payment_id){
|
141 |
+
$apikey = $this->getPrivateApiKey();
|
142 |
+
$authtoken = $this->getPrivateAuth();
|
143 |
+
$ch = curl_init('http://www.instamojo.com/api/1.1/payments/'.$payment_id);
|
144 |
+
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
145 |
+
'X-Api-Key: '. $apikey,
|
146 |
+
'X-Auth-Token: '. $authtoken
|
147 |
+
));
|
148 |
+
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
149 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
150 |
+
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
|
151 |
+
curl_setopt($ch, CURLOPT_ENCODING, "gzip,deflate");
|
152 |
+
$response = json_decode(curl_exec($ch));
|
153 |
+
curl_close($ch);
|
154 |
+
$responseArr = (array)$response->payment;
|
155 |
+
$payment_info =array();
|
156 |
+
foreach($responseArr as $key=>$value){
|
157 |
+
if(!is_object($value))
|
158 |
+
$payment_info[$key]=$value;
|
159 |
+
}
|
160 |
+
return $payment_info;
|
161 |
+
}
|
162 |
+
return;
|
163 |
+
}
|
164 |
+
}
|
app/code/local/Techinflo/Instamojo/Model/Standard.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Package: Techinflo_Instamojo
|
4 |
+
* Edition: Community
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Developer: Sampath Kumar<Techinflo Team>
|
7 |
+
*/
|
8 |
+
|
9 |
+
class Techinflo_Instamojo_Model_Standard extends Mage_Payment_Model_Method_Abstract {
|
10 |
+
protected $_code = 'instamojo';
|
11 |
+
|
12 |
+
protected $_isInitializeNeeded = true;
|
13 |
+
protected $_canUseInternal = true;
|
14 |
+
protected $_canUseForMultishipping = false;
|
15 |
+
|
16 |
+
public function getOrderPlaceRedirectUrl() {
|
17 |
+
return Mage::getUrl('instamojo/payment/redirect', array('_secure' => true));
|
18 |
+
}
|
19 |
+
}
|
20 |
+
?>
|
app/code/local/Techinflo/Instamojo/controllers/PaymentController.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Package: Techinflo_Instamojo
|
4 |
+
* Edition: Community
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Developer: Sampath Kumar<Techinflo Team>
|
7 |
+
*/
|
8 |
+
class Techinflo_Instamojo_PaymentController extends Mage_Core_Controller_Front_Action {
|
9 |
+
/**
|
10 |
+
* Set redirect template once after customer places order
|
11 |
+
*/
|
12 |
+
public function redirectAction() {
|
13 |
+
$this->loadLayout();
|
14 |
+
$block = $this->getLayout()->createBlock('Mage_Core_Block_Template','instamojo',array('template' => 'instamojo/redirect.phtml'));
|
15 |
+
$this->getLayout()->getBlock('content')->append($block);
|
16 |
+
$this->renderLayout();
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Set response received from instamojo payment gateway and display template
|
21 |
+
*/
|
22 |
+
public function responseAction() {
|
23 |
+
$payment_id = $this->getRequest()->getParam('payment_id');
|
24 |
+
$status = $this->getRequest()->getParam('status');
|
25 |
+
if($payment_id) {
|
26 |
+
try{
|
27 |
+
if($status == "success"){
|
28 |
+
$response = Mage::helper('instamojo')->getPaymentDetail($payment_id);
|
29 |
+
Mage::getSingleton('checkout/session')->addSuccess('Payment Success: '. $payment_id);
|
30 |
+
$order = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('customer_email', $response["buyer_email"])->getLastItem();
|
31 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Payment Gateway has authorized the payment.');
|
32 |
+
$order->sendNewOrderEmail();
|
33 |
+
$order->setEmailSent(true);
|
34 |
+
$order->save();
|
35 |
+
$this->_redirect('checkout/onepage/success', array('_secure'=>true));
|
36 |
+
}else {
|
37 |
+
$this->_redirect('checkout/onepage/failure', array('_secure'=>true));
|
38 |
+
}
|
39 |
+
} catch (Exception $e) {
|
40 |
+
Mage::getSingleton('checkout/session')->addError('Payment Failed: '. $payment_id);
|
41 |
+
}
|
42 |
+
}else{ $this->cancelAction();
|
43 |
+
$this->_redirect('');
|
44 |
+
}
|
45 |
+
}
|
46 |
+
/*
|
47 |
+
* cancel the order once after declining payment from the gateway
|
48 |
+
*/
|
49 |
+
public function cancelAction() {
|
50 |
+
if (Mage::getSingleton('checkout/session')->getLastRealOrderId()) {
|
51 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());
|
52 |
+
if($order->getId()) {
|
53 |
+
$order->cancel()->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, 'Payment Gateway has declined the payment.')->save();
|
54 |
+
}
|
55 |
+
}
|
56 |
+
}
|
57 |
+
}
|
app/code/local/Techinflo/Instamojo/etc/config.xml
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Package: Techinflo_Instamojo
|
5 |
+
* Edition: Community
|
6 |
+
* Version: 1.0.0
|
7 |
+
* Developer: Sampath Kumar<Techinflo Team>
|
8 |
+
*/
|
9 |
+
-->
|
10 |
+
<config>
|
11 |
+
<modules>
|
12 |
+
<Techinflo_Instamojo>
|
13 |
+
<version>1.0.0</version>
|
14 |
+
</Techinflo_Instamojo>
|
15 |
+
</modules>
|
16 |
+
<global>
|
17 |
+
<models>
|
18 |
+
<instamojo>
|
19 |
+
<class>Techinflo_Instamojo_Model</class>
|
20 |
+
</instamojo>
|
21 |
+
</models>
|
22 |
+
<helpers>
|
23 |
+
<instamojo>
|
24 |
+
<class>Techinflo_Instamojo_Helper</class>
|
25 |
+
</instamojo>
|
26 |
+
</helpers>
|
27 |
+
<blocks>
|
28 |
+
<instamojo>
|
29 |
+
<class>Techinflo_Instamojo_Block</class>
|
30 |
+
</instamojo>
|
31 |
+
</blocks>
|
32 |
+
</global>
|
33 |
+
<default>
|
34 |
+
<payment>
|
35 |
+
<instamojo>
|
36 |
+
<model>instamojo/standard</model>
|
37 |
+
<active>1</active>
|
38 |
+
<order_status>pending</order_status>
|
39 |
+
<title>Instamojo Pay</title>
|
40 |
+
<payment_action>sale</payment_action>
|
41 |
+
<allowspecific>0</allowspecific>
|
42 |
+
<sort_order>1</sort_order>
|
43 |
+
</instamojo>
|
44 |
+
</payment>
|
45 |
+
</default>
|
46 |
+
<frontend>
|
47 |
+
<routers>
|
48 |
+
<instamojo>
|
49 |
+
<use>standard</use>
|
50 |
+
<args>
|
51 |
+
<module>Techinflo_Instamojo</module>
|
52 |
+
<frontName>instamojo</frontName>
|
53 |
+
</args>
|
54 |
+
</instamojo>
|
55 |
+
</routers>
|
56 |
+
</frontend>
|
57 |
+
</config>
|
app/code/local/Techinflo/Instamojo/etc/system.xml
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Package: Techinflo_Instamojo
|
5 |
+
* Edition: Community
|
6 |
+
* Version: 1.0.0
|
7 |
+
* Developer: Sampath Kumar<Techinflo Team>
|
8 |
+
*/
|
9 |
+
-->
|
10 |
+
<config>
|
11 |
+
<sections>
|
12 |
+
<payment>
|
13 |
+
<groups>
|
14 |
+
<instamojo translate="label comment" module="instamojo">
|
15 |
+
<label>Techinflo Instamojo</label>
|
16 |
+
<frontend_type>text</frontend_type>
|
17 |
+
<sort_order>999999</sort_order>
|
18 |
+
<show_in_default>1</show_in_default>
|
19 |
+
<show_in_website>1</show_in_website>
|
20 |
+
<show_in_store>1</show_in_store>
|
21 |
+
<fields>
|
22 |
+
<active translate="label">
|
23 |
+
<label>Enabled</label>
|
24 |
+
<frontend_type>select</frontend_type>
|
25 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
26 |
+
<sort_order>10</sort_order>
|
27 |
+
<show_in_default>1</show_in_default>
|
28 |
+
<show_in_website>1</show_in_website>
|
29 |
+
<show_in_store>0</show_in_store>
|
30 |
+
</active>
|
31 |
+
<title translate="label">
|
32 |
+
<label>Title</label>
|
33 |
+
<frontend_type>text</frontend_type>
|
34 |
+
<sort_order>20</sort_order>
|
35 |
+
<show_in_default>1</show_in_default>
|
36 |
+
<show_in_website>1</show_in_website>
|
37 |
+
<show_in_store>1</show_in_store>
|
38 |
+
</title>
|
39 |
+
<order_status translate="label">
|
40 |
+
<label>New Order Status</label>
|
41 |
+
<frontend_type>select</frontend_type>
|
42 |
+
<source_model>adminhtml/system_config_source_order_status</source_model>
|
43 |
+
<sort_order>30</sort_order>
|
44 |
+
<show_in_default>1</show_in_default>
|
45 |
+
<show_in_website>1</show_in_website>
|
46 |
+
<show_in_store>0</show_in_store>
|
47 |
+
</order_status>
|
48 |
+
<allowspecific translate="label">
|
49 |
+
<label>Payment Applicable From</label>
|
50 |
+
<frontend_type>select</frontend_type>
|
51 |
+
<sort_order>40</sort_order>
|
52 |
+
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
53 |
+
<show_in_default>1</show_in_default>
|
54 |
+
<show_in_website>1</show_in_website>
|
55 |
+
<show_in_store>0</show_in_store>
|
56 |
+
</allowspecific>
|
57 |
+
<specificcountry translate="label">
|
58 |
+
<label>Countries Payment Applicable From</label>
|
59 |
+
<frontend_type>multiselect</frontend_type>
|
60 |
+
<sort_order>50</sort_order>
|
61 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
62 |
+
<show_in_default>1</show_in_default>
|
63 |
+
<show_in_website>1</show_in_website>
|
64 |
+
<show_in_store>0</show_in_store>
|
65 |
+
<depends>
|
66 |
+
<allowspecific>1</allowspecific>
|
67 |
+
</depends>
|
68 |
+
</specificcountry>
|
69 |
+
<sort_order translate="label">
|
70 |
+
<label>Sort Order</label>
|
71 |
+
<frontend_type>text</frontend_type>
|
72 |
+
<sort_order>60</sort_order>
|
73 |
+
<show_in_default>1</show_in_default>
|
74 |
+
<show_in_website>1</show_in_website>
|
75 |
+
<show_in_store>0</show_in_store>
|
76 |
+
</sort_order>
|
77 |
+
<linkurl translate="label">
|
78 |
+
<label>Url</label>
|
79 |
+
<frontend_type>text</frontend_type>
|
80 |
+
<sort_order>70</sort_order>
|
81 |
+
<show_in_default>1</show_in_default>
|
82 |
+
<show_in_website>1</show_in_website>
|
83 |
+
<show_in_store>0</show_in_store>
|
84 |
+
<comment><![CDATA[Instamojo payment link url. ex: https://www.instamojo.com/instamojo/payments/]]></comment>
|
85 |
+
</linkurl>
|
86 |
+
<apikey translate="label">
|
87 |
+
<label>Private API Key</label>
|
88 |
+
<frontend_type>text</frontend_type>
|
89 |
+
<sort_order>80</sort_order>
|
90 |
+
<show_in_default>1</show_in_default>
|
91 |
+
<show_in_website>1</show_in_website>
|
92 |
+
<show_in_store>0</show_in_store>
|
93 |
+
<comment><![CDATA[Instamojo Private API Key, can be collected from here https://www.instamojo.com/developers/ once after logging into your instamojo account]]></comment>
|
94 |
+
</apikey>
|
95 |
+
<auth translate="label">
|
96 |
+
<label>Private Auth Token</label>
|
97 |
+
<frontend_type>text</frontend_type>
|
98 |
+
<sort_order>90</sort_order>
|
99 |
+
<show_in_default>1</show_in_default>
|
100 |
+
<show_in_website>1</show_in_website>
|
101 |
+
<show_in_store>0</show_in_store>
|
102 |
+
<comment><![CDATA[Instamojo Private Auth Token, can be collected from here https://www.instamojo.com/developers/ once after logging into your instamojo account]]></comment>
|
103 |
+
</auth>
|
104 |
+
<salt translate="label">
|
105 |
+
<label>Private Salt</label>
|
106 |
+
<frontend_type>text</frontend_type>
|
107 |
+
<sort_order>100</sort_order>
|
108 |
+
<show_in_default>1</show_in_default>
|
109 |
+
<show_in_website>1</show_in_website>
|
110 |
+
<show_in_store>0</show_in_store>
|
111 |
+
<comment><![CDATA[Instamojo private salt, can be collected from here https://www.instamojo.com/developers/ once after logging into your instamojo account]]></comment>
|
112 |
+
</salt>
|
113 |
+
</fields>
|
114 |
+
</instamojo>
|
115 |
+
</groups>
|
116 |
+
</payment>
|
117 |
+
</sections>
|
118 |
+
</config>
|
app/design/frontend/base/default/template/instamojo/redirect.phtml
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Package: Techinflo_Instamojo
|
4 |
+
* Edition: Community
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Developer: Sampath Kumar<Techinflo Team>
|
7 |
+
*/
|
8 |
+
?>
|
9 |
+
<?php
|
10 |
+
$_orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
|
11 |
+
$_order = Mage::helper('instamojo')->getCurrentOrder();
|
12 |
+
$linkurl = Mage::helper('instamojo')->getLinkUrl();
|
13 |
+
$privateSalt = Mage::helper('instamojo')->getPrivateSalt();
|
14 |
+
if($_orderId){
|
15 |
+
$data_name = Mage::helper('instamojo')->getUserName($_order);
|
16 |
+
$data_email = Mage::helper('instamojo')->getUserEmail($_order);
|
17 |
+
$data_phone = Mage::helper('instamojo')->getUserPhone($_order);
|
18 |
+
$data_amount = Mage::helper('instamojo')->getGrandTotal($_order);
|
19 |
+
$data_orderid = Mage::helper('instamojo')->getCurrentOrderId();
|
20 |
+
$signature = Mage::helper('instamojo')->generateSecureKey();
|
21 |
+
?>
|
22 |
+
<?php $date = date('m/d/Y');
|
23 |
+
$formatedDate = date('m/d/Y',strtotime($date));
|
24 |
+
$date = explode('/', $formatedDate);
|
25 |
+
$year = $date[2]; $month = $date[0]; $day = $date[1]; $hour = 24; $min = 30;
|
26 |
+
?>
|
27 |
+
<script type="text/javascript">
|
28 |
+
var current="Time Up!";
|
29 |
+
var year='<?php echo $year; ?>';
|
30 |
+
var month='<?php echo $month; ?>';
|
31 |
+
var day='<?php echo $day; ?>';
|
32 |
+
var hour='<?php echo $hour; ?>';
|
33 |
+
var minute='<?php echo $min; ?>';
|
34 |
+
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
|
35 |
+
function countdown(yr,m,d,hr,min){
|
36 |
+
theyear=yr;themonth=m;theday=d;thehour=hr;theminute=min;
|
37 |
+
var today=new Date();
|
38 |
+
var todayy=today.getYear();
|
39 |
+
if (todayy < 1000) todayy+=1900;
|
40 |
+
var todaym=today.getMonth();
|
41 |
+
var todayd=today.getDate();
|
42 |
+
var todayh=today.getHours();
|
43 |
+
var todaymin=today.getMinutes();
|
44 |
+
var todaysec=today.getSeconds();
|
45 |
+
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec;
|
46 |
+
var futurestring=montharray[m-1]+" "+d+", "+yr+" "+hr+":"+min+":"+"00";
|
47 |
+
var dd=Date.parse(futurestring)-Date.parse(todaystring);
|
48 |
+
var dday=Math.floor(dd/(60*60*1000*24)*1);
|
49 |
+
var dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1);
|
50 |
+
var dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1);
|
51 |
+
var dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1);
|
52 |
+
if(dday<=0&&dhour<=0&&dmin<=0&&dsec<=0){
|
53 |
+
document.getElementById('timer-text').style.display="none";
|
54 |
+
document.getElementById('timer-table').style.display="none";
|
55 |
+
return;
|
56 |
+
} else {
|
57 |
+
document.getElementById('dsec').innerHTML=dsec;
|
58 |
+
setTimeout("countdown(theyear,themonth,theday,thehour,theminute)",1000);
|
59 |
+
}
|
60 |
+
}
|
61 |
+
</script>
|
62 |
+
<h1 style="margin: 100px 0px 0px 200px; color:#ea7601; width:40px; border:2px solid #ea7601; border-radius:50px; padding: 9px; text-align:center;" id="dsec"></h1>
|
63 |
+
<div id="loadtext" style="font-size: 17px; margin: 20px 25px; text-align: center;"><?php echo $this->__("Please wait for a moment, While we redirect you to Instamojo Payments") ?></div>
|
64 |
+
<form name="instamojoform" method="get" action="<?php echo $linkurl; ?>">
|
65 |
+
<input type="hidden" name="data_sign" value="<?php echo $signature; ?>">
|
66 |
+
<input type="hidden" name="data_readonly" value="<?php echo "data_amount"; ?>">
|
67 |
+
<input type="hidden" name="data_readonly" value="<?php echo "data_name"; ?>">
|
68 |
+
<input type="hidden" name="data_readonly" value="<?php echo "data_email"; ?>">
|
69 |
+
<input type="hidden" name="data_readonly" value="<?php echo "data_phone"; ?>">
|
70 |
+
<!--<input type="hidden" name="data_readonly" value="<?php //echo "data_Field_40225"; ?>">-->
|
71 |
+
<input type="hidden" name="data_amount" value="<?php echo $data_amount; ?>">
|
72 |
+
<input type="hidden" name="data_email" value="<?php echo $data_email; ?>">
|
73 |
+
<input type="hidden" name="data_name" value="<?php echo $data_name; ?>">
|
74 |
+
<input type="hidden" name="data_phone" value="<?php echo $data_phone; ?>">
|
75 |
+
<!--<input type="hidden" name="data_Field_40225" value="<?php //echo $data_orderid; ?>">-->
|
76 |
+
<input type="hidden" name="intent" value="<?php echo $this->__("buy"); ?>">
|
77 |
+
</form>
|
78 |
+
<script type="text/javascript">
|
79 |
+
document.instamojoform.submit();
|
80 |
+
window.onload=countdown(year,month,day,hour,minute);
|
81 |
+
</script>
|
82 |
+
<?php } else { ?>
|
83 |
+
<h4><?php echo $this->__("It seems something went wrong on your end. Please try again!") ?> <a href="<?php echo Mage::getUrl('customer/account') ?>"> <?php echo $this->__("click here") ?></a><?php echo $this->__("to go back") ?></h4>
|
84 |
+
<?php } ?>
|
app/etc/modules/Techinflo_Instamojo.xml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Package: Techinflo_Instamojo
|
5 |
+
* Edition: Community
|
6 |
+
* Version: 1.0.1
|
7 |
+
* Developer: Sampath Kumar<Techinflo Team>
|
8 |
+
*/
|
9 |
+
-->
|
10 |
+
<config>
|
11 |
+
<modules>
|
12 |
+
<Techinflo_Instamojo>
|
13 |
+
<active>true</active>
|
14 |
+
<codePool>local</codePool>
|
15 |
+
</Techinflo_Instamojo>
|
16 |
+
</modules>
|
17 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Techinflo_Instamojo</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Techinflo Instamojo Payment gateway helps the magento customer to utilize the feature of making payments online using Debit/Credit Cards and also through Net banking as well.</summary>
|
10 |
+
<description>Techinflo Instamojo Payment gateway helps the magento customer to utilize the feature of making payments online.
|
11 |
+
All you need to have is a instamojo account and payment link to receive the payments.
|
12 |
+

|
13 |
+
This extension avails;
|
14 |
+
1. Debit Card Payments
|
15 |
+
2. Credit Card Payments
|
16 |
+
3. Net Banking Payments</description>
|
17 |
+
<notes>Techinflo Instamojo Payment gateway helps the magento customer to utilize the feature of making payments online.
|
18 |
+
All you need to have is a instamojo account and payment link to receive the payments.
|
19 |
+

|
20 |
+
This extension avails;
|
21 |
+
1. Debit Card Payments
|
22 |
+
2. Credit Card Payments
|
23 |
+
3. Net Banking Payments</notes>
|
24 |
+
<authors><author><name>Techinflo</name><user>Techinflo</user><email>sampath@techinflo.com</email></author></authors>
|
25 |
+
<date>2015-04-09</date>
|
26 |
+
<time>10:43:41</time>
|
27 |
+
<contents><target name="mageetc"><dir><dir name="modules"><file name="Techinflo_Instamojo.xml" hash="6d125611e98b76161f346dc2648b3891"/></dir></dir></target><target name="magelocal"><dir><dir name="Techinflo"><dir name="Instamojo"><dir><dir name="Helper"><file name="Data.php" hash="2837630f0271a2c87990f9babc102b09"/></dir><dir name="Model"><file name="Standard.php" hash="758f9aa24e95cf0b72b59cdcbe175c74"/></dir><dir name="controllers"><file name="PaymentController.php" hash="4659346753c5f12d6863ae7e6c47ae53"/></dir><dir name="etc"><file name="config.xml" hash="9bda97b0037f1bbd538605d86da9f027"/><file name="system.xml" hash="cf4645dfaf8a181030abd0cf3be38ee4"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="instamojo"><file name="redirect.phtml" hash="d0c8146eb679fc576ec6913cf91ff53a"/></dir></dir></dir></dir></dir></dir></target></contents>
|
28 |
+
<compatible/>
|
29 |
+
<dependencies><required><php><min>5.1.0</min><max>6.1.0</max></php></required></dependencies>
|
30 |
+
</package>
|