Version Notes
Initial release
Download this release
Release Info
| Developer | Instamojo |
| Extension | Instamojo_Imojo |
| Version | 0.0.1 |
| Comparing to | |
| See all releases | |
Version 0.0.1
- app/code/local/Instamojo/Imojo/Helper/Data.php +8 -0
- app/code/local/Instamojo/Imojo/Model/PaymentMethod.php +77 -0
- app/code/local/Instamojo/Imojo/controllers/PaymentController.php +202 -0
- app/code/local/Instamojo/Imojo/etc/config.xml +61 -0
- app/code/local/Instamojo/Imojo/etc/system.xml +95 -0
- package.xml +21 -0
app/code/local/Instamojo/Imojo/Helper/Data.php
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Instamojo_Imojo_Helper_Data extends Mage_Core_Helper_Abstract
|
| 3 |
+
{
|
| 4 |
+
public function indexAction()
|
| 5 |
+
{
|
| 6 |
+
echo "";
|
| 7 |
+
}
|
| 8 |
+
}
|
app/code/local/Instamojo/Imojo/Model/PaymentMethod.php
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
// This module is more than a normal payment gateway
|
| 3 |
+
// It needs dashboard and all
|
| 4 |
+
class Instamojo_Imojo_Model_PaymentMethod extends Mage_Payment_Model_Method_Abstract{
|
| 5 |
+
/**
|
| 6 |
+
* Availability options
|
| 7 |
+
*/
|
| 8 |
+
protected $_code = 'imojo';
|
| 9 |
+
|
| 10 |
+
protected $_isGateway = true;
|
| 11 |
+
protected $_canAuthorize = true;
|
| 12 |
+
protected $_canCapture = true;
|
| 13 |
+
protected $_canCapturePartial = true;
|
| 14 |
+
protected $_canRefund = false;
|
| 15 |
+
protected $_canVoid = false;
|
| 16 |
+
protected $_canUseInternal = true;
|
| 17 |
+
protected $_canUseCheckout = true;
|
| 18 |
+
protected $_canUseForMultishipping = true;
|
| 19 |
+
protected $_canSaveCc = false;
|
| 20 |
+
protected $_isInitializeNeeded = false;
|
| 21 |
+
|
| 22 |
+
// TO DO NOTES
|
| 23 |
+
// Implement safer signed links
|
| 24 |
+
// Create link first? Manually created in this case.
|
| 25 |
+
|
| 26 |
+
/**
|
| 27 |
+
* @return Mage_Checkout_Model_Session
|
| 28 |
+
*/
|
| 29 |
+
protected function _getCheckout()
|
| 30 |
+
{
|
| 31 |
+
return Mage::getSingleton('checkout/session');
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
// Construct the redirect URL
|
| 35 |
+
public function getOrderPlaceRedirectUrl()
|
| 36 |
+
{
|
| 37 |
+
Mage::Log('Step 2 Process: Getting the redirect URL: ' . Mage::getUrl('imojo/payment/redirect'));
|
| 38 |
+
//
|
| 39 |
+
return Mage::getUrl('imojo/payment/redirect');
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
// Check why capture is not working. I clearly specified it in the config.xml file. WTF!
|
| 43 |
+
// Need to look back into this issue more cleanly
|
| 44 |
+
public function authorize(Varien_Object $payment, $amount){
|
| 45 |
+
Mage::Log('Step 0 Process: Authorize');
|
| 46 |
+
// Haha interestingly this is working. Lolapa
|
| 47 |
+
// $order = $payment->getOrder();
|
| 48 |
+
// Create and capture transaction. How do we use it? Lets see.\
|
| 49 |
+
// $transactionId = time();
|
| 50 |
+
// $payment->setTransactionId($transactionId) // Make it unique. This is Rentomojo Transaction ID
|
| 51 |
+
// ->setIsTransactionClosed(0) // Close the transaction on return?
|
| 52 |
+
// ->setTransactionAdditionalInfo(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS, array('Context'=>'Token payment','Amount'=>'900','Status'=>0));
|
| 53 |
+
return $this;
|
| 54 |
+
}
|
| 55 |
+
// I think Instamojo can do this :). We need to authorize and capture for later reference
|
| 56 |
+
/**
|
| 57 |
+
* this method is called if we are authorising AND
|
| 58 |
+
* capturing a transaction
|
| 59 |
+
*/
|
| 60 |
+
public function capture(Varien_Object $payment, $amount)
|
| 61 |
+
{
|
| 62 |
+
Mage::Log('Step 1 Process: Create and capture the process');
|
| 63 |
+
// parent::capture();
|
| 64 |
+
// $order = $payment->getOrder();
|
| 65 |
+
// Create and capture transaction. How do we use it? Lets see.\
|
| 66 |
+
// $transactionId = time();
|
| 67 |
+
// $payment->setTransactionId($transactionId) // Make it unique. This is Rentomojo Transaction ID
|
| 68 |
+
// ->setIsTransactionClosed(0) // Close the transaction on return?
|
| 69 |
+
// ->setTransactionAdditionalInfo(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS, array('key1'=>'value1','key2'=>'value2'));
|
| 70 |
+
return $this;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
// Suggestions from
|
| 76 |
+
// http://stackoverflow.com/questions/6058430/magento-redirect-checkout-payment-to-a-3rd-party-gateway
|
| 77 |
+
//
|
app/code/local/Instamojo/Imojo/controllers/PaymentController.php
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Instamojo_Imojo_PaymentController extends Mage_Core_Controller_Front_Action
|
| 4 |
+
{
|
| 5 |
+
// Redirect to instamojo
|
| 6 |
+
public function redirectAction()
|
| 7 |
+
{
|
| 8 |
+
try {
|
| 9 |
+
Mage::Log('Step 5 Process: Loading the redirect.html page');
|
| 10 |
+
$this->loadLayout();
|
| 11 |
+
// Get latest order data
|
| 12 |
+
$orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
|
| 13 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
// Set status to payment pending
|
| 17 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, true)->save();
|
| 18 |
+
$amount = $order-> getBaseGrandTotal();
|
| 19 |
+
$email = $order->getCustomerEmail();
|
| 20 |
+
$name = $order->getCustomerName();
|
| 21 |
+
$phone = $order->getBillingAddress()->getTelephone();
|
| 22 |
+
$rmTranid = time();
|
| 23 |
+
|
| 24 |
+
$index = strpos($amount, '.');
|
| 25 |
+
if ($index !== False){
|
| 26 |
+
$amount = substr($amount, 0, $index+3);
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
$url = Mage::getStoreConfig('payment/imojo/payment_url');
|
| 30 |
+
$api_key = Mage::getStoreConfig('payment/imojo/api_key');
|
| 31 |
+
$auth_token = Mage::getStoreConfig('payment/imojo/auth_token');
|
| 32 |
+
$private_salt = Mage::getStoreConfig('payment/imojo/private_salt');
|
| 33 |
+
$custom_field = Mage::getStoreConfig('payment/imojo/custom_field');
|
| 34 |
+
|
| 35 |
+
Mage::log("Data from Backend: $url | $api_key | $auth_token | $private_salt | $custom_field");
|
| 36 |
+
|
| 37 |
+
$data = Array();
|
| 38 |
+
$data['data_email'] = substr($email, 0, 75);
|
| 39 |
+
$data['data_name'] = substr($name, 0, 20);
|
| 40 |
+
$data['data_phone'] = substr($phone, 0, 20);
|
| 41 |
+
$data['data_amount'] = $amount;
|
| 42 |
+
$data['data_' . $custom_field] = $rmTranid . "-". $orderId;
|
| 43 |
+
|
| 44 |
+
Mage::log("Transaction-order ID: " . ($rmTranid . "-". $orderId));
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
ksort($data, SORT_STRING | SORT_FLAG_CASE);
|
| 49 |
+
$message = implode('|', $data);
|
| 50 |
+
$sign = hash_hmac("sha1", $message, $private_salt);
|
| 51 |
+
$data['data_sign'] = $sign;
|
| 52 |
+
|
| 53 |
+
Mage::log("Signature is: $sign");
|
| 54 |
+
|
| 55 |
+
$link= $url . "?intent=buy&";
|
| 56 |
+
$link .= "data_readonly=data_email&data_readonly=data_amount&data_readonly=data_phone&data_readonly=data_name&data_readonly=data_$custom_field&data_hidden=data_$custom_field";
|
| 57 |
+
$link.="&data_amount=$amount&data_name=$name&data_email=$email&data_phone=$phone&data_$custom_field=$custom_field&data_sign=$sign";
|
| 58 |
+
$payment = $order->getPayment();
|
| 59 |
+
$payment->setTransactionId($rmTranid); // Make it unique.
|
| 60 |
+
$transaction = $payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH,
|
| 61 |
+
null,
|
| 62 |
+
false,
|
| 63 |
+
'I am good');
|
| 64 |
+
$transaction->setAdditionalInformation(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS,
|
| 65 |
+
array('Context'=>'Token payment',
|
| 66 |
+
'Amount'=>$amount,
|
| 67 |
+
'Status'=>0,
|
| 68 |
+
'Url'=>$link));
|
| 69 |
+
$transaction->setIsTransactionClosed(false); // Close the transaction on return?
|
| 70 |
+
$transaction->save();
|
| 71 |
+
$order->save();
|
| 72 |
+
|
| 73 |
+
$block = $this->getLayout()->createBlock('Mage_Core_Block_Template', 'imojo', array('template' => 'imojo/redirect.phtml'))
|
| 74 |
+
->assign(array_merge($data, array('url'=>$url, 'custom_field_name'=>'data_' . $custom_field)));
|
| 75 |
+
$this->getLayout()->getBlock('content')->append($block);
|
| 76 |
+
$this->renderLayout();
|
| 77 |
+
} catch (Exception $e){
|
| 78 |
+
Mage::logException($e);
|
| 79 |
+
parent::_redirect('checkout/cart');
|
| 80 |
+
}
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
// Redirect from Instamojo
|
| 84 |
+
// The response action is triggered when your gateway sends back a response after processing the customer's payment
|
| 85 |
+
public function responseAction() {
|
| 86 |
+
|
| 87 |
+
$custom_field = Mage::getStoreConfig('payment/imojo/custom_field');
|
| 88 |
+
$status = $this->getRequest()->getParam('status');
|
| 89 |
+
$insta_id = $this->getRequest()->getParam('payment_id');
|
| 90 |
+
$this->loadLayout();
|
| 91 |
+
|
| 92 |
+
// // Do curl here to get order id and information from instamojo;
|
| 93 |
+
$data= $this->_getcurlInfo($insta_id);
|
| 94 |
+
$order_tran_id = explode('-', $data['payment']['custom_fields'][$custom_field]['value']);
|
| 95 |
+
$transactionId = $order_tran_id[0];
|
| 96 |
+
$orderId = $order_tran_id[1];
|
| 97 |
+
$amount = $data['payment']['amount'];
|
| 98 |
+
|
| 99 |
+
// Get order details
|
| 100 |
+
$order = Mage::getModel('sales/order');
|
| 101 |
+
$order->loadByIncrementId($orderId);
|
| 102 |
+
$this->_processInvoice($orderId);
|
| 103 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true)->save();
|
| 104 |
+
$order->sendNewOrderEmail();
|
| 105 |
+
$order->setEmailSent(true);
|
| 106 |
+
|
| 107 |
+
// Close the transaction
|
| 108 |
+
$payment = $order->getPayment();
|
| 109 |
+
$transaction = $payment->getTransaction($transactionId);
|
| 110 |
+
$data = $transaction->getAdditionalInformation();
|
| 111 |
+
$url = $data['raw_details_info']['Url'];
|
| 112 |
+
$transaction->setAdditionalInformation(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS,
|
| 113 |
+
array('InstmojoId'=> $insta_id,
|
| 114 |
+
'Context'=>'Token payment',
|
| 115 |
+
'Amount'=>$amount,
|
| 116 |
+
'Status'=>1,
|
| 117 |
+
'Url'=>$url))->save();
|
| 118 |
+
$transaction->setParentTxnId($insta_id)->save();
|
| 119 |
+
|
| 120 |
+
// What if Id or status doesnt exit?
|
| 121 |
+
if($status){
|
| 122 |
+
$block = $this->getLayout()->createBlock('Mage_Core_Block_Template',
|
| 123 |
+
'imojo',
|
| 124 |
+
array('template' => 'imojo/success.phtml'))->assign(array('instaId'=> $insta_id));
|
| 125 |
+
// Curl fetch status information to cross compare
|
| 126 |
+
}else{
|
| 127 |
+
$block = $this->getLayout()->createBlock('Mage_Core_Block_Template',
|
| 128 |
+
'imojo',
|
| 129 |
+
array('template' => 'imojo/failure.phtml'))->assign(array('instaId'=> $insta_id));
|
| 130 |
+
}
|
| 131 |
+
$this->getLayout()->getBlock('content')->append($block);
|
| 132 |
+
//$this->_processInvoice($orderId);
|
| 133 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, false)->save();
|
| 134 |
+
$payment->setIsTransactionClosed(1);
|
| 135 |
+
$this->renderLayout();
|
| 136 |
+
|
| 137 |
+
// Trigger emails for success / failure - Sending desposit email
|
| 138 |
+
// $this->depositEmail($orderId);
|
| 139 |
+
|
| 140 |
+
// Trigger a order invoice after that?
|
| 141 |
+
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
private function _processInvoice($orderId){
|
| 145 |
+
|
| 146 |
+
$order = Mage::getModel("sales/order")->load($orderId);
|
| 147 |
+
|
| 148 |
+
try {
|
| 149 |
+
if(!$order->canInvoice())
|
| 150 |
+
{
|
| 151 |
+
Mage::throwException(Mage::helper("core")->__("Cannot create an invoice"));
|
| 152 |
+
}
|
| 153 |
+
$invoice = Mage::getModel("sales/service_order", $order)->prepareInvoice();
|
| 154 |
+
if (!$invoice->getTotalQty()) {
|
| 155 |
+
Mage::throwException(Mage::helper("core")->__("Cannot create an invoice without products."));
|
| 156 |
+
}
|
| 157 |
+
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE);
|
| 158 |
+
$invoice->register();
|
| 159 |
+
$transactionSave = Mage::getModel("core/resource_transaction")
|
| 160 |
+
->addObject($invoice)
|
| 161 |
+
->addObject($invoice->getOrder());
|
| 162 |
+
$transactionSave->save();
|
| 163 |
+
$invoice->sendEmail();
|
| 164 |
+
|
| 165 |
+
/* SET Order Status Here */
|
| 166 |
+
$orderModel = Mage::getModel("sales/order");
|
| 167 |
+
$orderModel->load($orderId);
|
| 168 |
+
$orderModel->setStatus("complete")
|
| 169 |
+
->save();
|
| 170 |
+
|
| 171 |
+
}
|
| 172 |
+
catch (Mage_Core_Exception $e) {
|
| 173 |
+
echo $e->getMessage();
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
// Get the order id from Instamojo based the transaction id
|
| 179 |
+
private function _getcurlInfo($iTransactionId){
|
| 180 |
+
try {
|
| 181 |
+
|
| 182 |
+
$cUrl = 'https://www.instamojo.com/api/1.1/payments/'.$iTransactionId;
|
| 183 |
+
$api_key = Mage::getStoreConfig('payment/imojo/api_key');
|
| 184 |
+
$auth_token = Mage::getStoreConfig('payment/imojo/auth_token');
|
| 185 |
+
|
| 186 |
+
$ch = curl_init();
|
| 187 |
+
curl_setopt($ch, CURLOPT_URL, $cUrl);
|
| 188 |
+
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
| 189 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
| 190 |
+
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
|
| 191 |
+
curl_setopt($ch, CURLOPT_HTTPHEADER, array("X-Api-Key:$api_key",
|
| 192 |
+
"X-Auth-Token:$auth_token"));
|
| 193 |
+
$response = curl_exec($ch);
|
| 194 |
+
$res = json_decode($response, true);
|
| 195 |
+
curl_close($ch);
|
| 196 |
+
} catch (Exception $e) {
|
| 197 |
+
throw $e;
|
| 198 |
+
}
|
| 199 |
+
return $res;
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
}
|
app/code/local/Instamojo/Imojo/etc/config.xml
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Instamojo_Imojo>
|
| 5 |
+
<version>0.0.1</version>
|
| 6 |
+
</Instamojo_Imojo>
|
| 7 |
+
</modules>
|
| 8 |
+
<global>
|
| 9 |
+
<blocks>
|
| 10 |
+
<imojo>
|
| 11 |
+
<class>Instamojo_Imojo_Block</class>
|
| 12 |
+
</imojo>
|
| 13 |
+
</blocks>
|
| 14 |
+
<models>
|
| 15 |
+
<imojo>
|
| 16 |
+
<class>Instamojo_Imojo_Model</class>
|
| 17 |
+
</imojo>
|
| 18 |
+
</models>
|
| 19 |
+
<resources>
|
| 20 |
+
<imojo_setup>
|
| 21 |
+
<setup>
|
| 22 |
+
<module>Instamojo_Imojo</module>
|
| 23 |
+
</setup>
|
| 24 |
+
<connection>
|
| 25 |
+
<use>core_setup</use>
|
| 26 |
+
</connection>
|
| 27 |
+
</imojo_setup>
|
| 28 |
+
<imojo_write>
|
| 29 |
+
<connection>
|
| 30 |
+
<use>core_write</use>
|
| 31 |
+
</connection>
|
| 32 |
+
</imojo_write>
|
| 33 |
+
<imojo_read>
|
| 34 |
+
<connection>
|
| 35 |
+
<use>core_read</use>
|
| 36 |
+
</connection>
|
| 37 |
+
</imojo_read>
|
| 38 |
+
</resources>
|
| 39 |
+
</global>
|
| 40 |
+
<default>
|
| 41 |
+
<payment>
|
| 42 |
+
<imojo>
|
| 43 |
+
<active>1</active>
|
| 44 |
+
<model>imojo/PaymentMethod</model>
|
| 45 |
+
<order_status>pending</order_status>
|
| 46 |
+
<title>Pay Using Instamojo</title>
|
| 47 |
+
</imojo>
|
| 48 |
+
</payment>
|
| 49 |
+
</default>
|
| 50 |
+
<frontend>
|
| 51 |
+
<routers>
|
| 52 |
+
<imojo>
|
| 53 |
+
<use>standard</use>
|
| 54 |
+
<args>
|
| 55 |
+
<module>Instamojo_Imojo</module>
|
| 56 |
+
<frontName>imojo</frontName>
|
| 57 |
+
</args>
|
| 58 |
+
</imojo>
|
| 59 |
+
</routers>
|
| 60 |
+
</frontend>
|
| 61 |
+
</config>
|
app/code/local/Instamojo/Imojo/etc/system.xml
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<sections>
|
| 4 |
+
<!-- payment tab -->
|
| 5 |
+
<payment>
|
| 6 |
+
<groups>
|
| 7 |
+
<!-- newmodule fieldset -->
|
| 8 |
+
<imojo translate="label" module="paygate">
|
| 9 |
+
<!-- will have title 'New Module' -->
|
| 10 |
+
<label>Instamojo Checkout</label>
|
| 11 |
+
<!-- position between other payment methods -->
|
| 12 |
+
<sort_order>1</sort_order>
|
| 13 |
+
<!-- do not show this configuration options in store scope -->
|
| 14 |
+
<show_in_default>1</show_in_default>
|
| 15 |
+
<show_in_website>1</show_in_website>
|
| 16 |
+
<show_in_store>0</show_in_store>
|
| 17 |
+
<fields>
|
| 18 |
+
<!-- is this payment method active for the website? -->
|
| 19 |
+
<active translate="label">
|
| 20 |
+
<!-- label for the field -->
|
| 21 |
+
<label>Enabled</label>
|
| 22 |
+
<!-- input type for configuration value -->
|
| 23 |
+
<frontend_type>select</frontend_type>
|
| 24 |
+
<!-- model to take the option values from -->
|
| 25 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 26 |
+
<!-- field position -->
|
| 27 |
+
<sort_order>1</sort_order>
|
| 28 |
+
<!-- do not show this field in store scope -->
|
| 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 |
+
<order_status translate="label">
|
| 34 |
+
<label>New order status</label>
|
| 35 |
+
<frontend_type>select</frontend_type>
|
| 36 |
+
<source_model>adminhtml/system_config_source_order_status_processing</source_model>
|
| 37 |
+
<sort_order>4</sort_order>
|
| 38 |
+
<show_in_default>1</show_in_default>
|
| 39 |
+
<show_in_website>1</show_in_website>
|
| 40 |
+
<show_in_store>0</show_in_store>
|
| 41 |
+
</order_status>
|
| 42 |
+
<api_key translate="label">
|
| 43 |
+
<label>API Key</label>
|
| 44 |
+
<frontend_type>text</frontend_type>
|
| 45 |
+
<sort_order>57</sort_order>
|
| 46 |
+
<show_in_default>1</show_in_default>
|
| 47 |
+
<show_in_website>1</show_in_website>
|
| 48 |
+
<show_in_store>0</show_in_store>
|
| 49 |
+
</api_key>
|
| 50 |
+
<auth_token translate="label">
|
| 51 |
+
<label>Auth Token</label>
|
| 52 |
+
<frontend_type>text</frontend_type>
|
| 53 |
+
<sort_order>58</sort_order>
|
| 54 |
+
<show_in_default>1</show_in_default>
|
| 55 |
+
<show_in_website>1</show_in_website>
|
| 56 |
+
<show_in_store>0</show_in_store>
|
| 57 |
+
</auth_token>
|
| 58 |
+
<private_salt translate="label">
|
| 59 |
+
<label>Private salt</label>
|
| 60 |
+
<frontend_type>text</frontend_type>
|
| 61 |
+
<sort_order>59</sort_order>
|
| 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 |
+
</private_salt>
|
| 66 |
+
<payment_url translate="label">
|
| 67 |
+
<label>Payment URL</label>
|
| 68 |
+
<frontend_type>text</frontend_type>
|
| 69 |
+
<sort_order>60</sort_order>
|
| 70 |
+
<show_in_default>1</show_in_default>
|
| 71 |
+
<show_in_website>1</show_in_website>
|
| 72 |
+
<show_in_store>0</show_in_store>
|
| 73 |
+
</payment_url>
|
| 74 |
+
<custom_field translate="label">
|
| 75 |
+
<label>Custom Field</label>
|
| 76 |
+
<frontend_type>text</frontend_type>
|
| 77 |
+
<sort_order>61</sort_order>
|
| 78 |
+
<show_in_default>1</show_in_default>
|
| 79 |
+
<show_in_store>0</show_in_store>
|
| 80 |
+
</custom_field>
|
| 81 |
+
<payment_action translate="label">
|
| 82 |
+
<label>Payment Action</label>
|
| 83 |
+
<frontend_type>select</frontend_type>
|
| 84 |
+
<source_model>paygate/authorizenet_source_paymentAction</source_model>
|
| 85 |
+
<sort_order>2</sort_order>
|
| 86 |
+
<show_in_default>1</show_in_default>
|
| 87 |
+
<show_in_website>1</show_in_website>
|
| 88 |
+
<show_in_store>0</show_in_store>
|
| 89 |
+
</payment_action>
|
| 90 |
+
</fields>
|
| 91 |
+
</imojo>
|
| 92 |
+
</groups>
|
| 93 |
+
</payment>
|
| 94 |
+
</sections>
|
| 95 |
+
</config>
|
package.xml
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<package>
|
| 3 |
+
<name>Instamojo_Imojo</name>
|
| 4 |
+
<version>0.0.1</version>
|
| 5 |
+
<stability>stable</stability>
|
| 6 |
+
<license uri="http://opensource.org/licenses/MIT">MIT</license>
|
| 7 |
+
<channel>community</channel>
|
| 8 |
+
<extends/>
|
| 9 |
+
<summary>Make payments using Instamojo Payment Gateway</summary>
|
| 10 |
+
<description>Instamojo lets you collect payments instantly. Start simply by creating a link by adding details. Share with your audience, through a link. And start collecting payments in minutes!
|
| 11 |
+

|
| 12 |
+
We provide you an out-of-the-box e-commerce framework that takes care of mundane stuff from payments to delivery. All you need to do is share a link wherever your audience is.
|
| 13 |
+
</description>
|
| 14 |
+
<notes>Initial release</notes>
|
| 15 |
+
<authors><author><name>Instamojo</name><user>Instamojo</user><email>dev@instamojo.com</email></author></authors>
|
| 16 |
+
<date>2015-04-13</date>
|
| 17 |
+
<time>15:35:31</time>
|
| 18 |
+
<contents><target name="magelocal"><dir name="Instamojo"><dir name="Imojo"><dir name="Helper"><file name="Data.php" hash="e53c6598fa917d8791e046b20d76d221"/></dir><dir name="Model"><file name="PaymentMethod.php" hash="a2e7744846b4ca05399f11bdecefcf7c"/></dir><dir name="controllers"><file name="PaymentController.php" hash="3da048cb36d7f7a8b5dacd4d0b00875c"/></dir><dir name="etc"><file name="config.xml" hash="9eb5aecb2c09a94639622ba59cab94cc"/><file name="system.xml" hash="428898819cd38b15ab4a222964179e65"/></dir></dir></dir></target></contents>
|
| 19 |
+
<compatible/>
|
| 20 |
+
<dependencies><required><php><min>5.3.0</min><max>5.6.6</max></php></required></dependencies>
|
| 21 |
+
</package>
|
