Version Notes
wallet payment gateway for mosambee.cash.
Download this release
Release Info
Developer | Mosambee Cash |
Extension | Mosambee_CashPaymentGateway |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/community/Mosambee/CashPaymentGateway/Helper/Data.php +15 -0
- app/code/community/Mosambee/CashPaymentGateway/Model/Standard.php +17 -0
- app/code/community/Mosambee/CashPaymentGateway/controllers/StandardController.php +177 -0
- app/code/community/Mosambee/CashPaymentGateway/etc/config.xml +77 -0
- app/code/community/Mosambee/CashPaymentGateway/etc/system.xml +111 -0
- app/design/frontend/base/default/template/cashpaymentgateway/redirect.phtml +42 -0
- app/etc/modules/Mosambee_CashPaymentGateway.xml +9 -0
- package.xml +18 -0
app/code/community/Mosambee/CashPaymentGateway/Helper/Data.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mosambee_CashPaymentGateway_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
// getHashSignature method to genrate signature
|
6 |
+
function getHashSignature($message,$secret){
|
7 |
+
return hash_hmac('sha512', $message,$secret);
|
8 |
+
}
|
9 |
+
|
10 |
+
// validateSignature method to validate signature
|
11 |
+
function validateSignature($m_Sign,$g_Sign){
|
12 |
+
return hash_equals($m_Sign,$g_Sign);
|
13 |
+
}
|
14 |
+
|
15 |
+
}
|
app/code/community/Mosambee/CashPaymentGateway/Model/Standard.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mosambee_CashPaymentGateway_Model_Standard extends Mage_Payment_Model_Method_Abstract
|
4 |
+
{
|
5 |
+
protected $_code = 'cashpaymentgateway_checkout';
|
6 |
+
protected $_isInitializeNeeded = true;
|
7 |
+
protected $_canUseInternal = false;
|
8 |
+
protected $_canUseForMultishipping = false;
|
9 |
+
|
10 |
+
// return order place redirect url (string)
|
11 |
+
public function getOrderPlaceRedirectUrl()
|
12 |
+
{
|
13 |
+
//when you click on place order you will be redirected on this url
|
14 |
+
return Mage::getUrl('customcard/standard/redirect', array('_secure' => true));
|
15 |
+
}
|
16 |
+
|
17 |
+
}
|
app/code/community/Mosambee/CashPaymentGateway/controllers/StandardController.php
ADDED
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Mosambee_CashPaymentGateway_StandardController extends Mage_Core_Controller_Front_Action {
|
3 |
+
// The redirectAction is triggered when someone places an order
|
4 |
+
public function redirectAction() {
|
5 |
+
// Retrieve order
|
6 |
+
$order = new Mage_Sales_Model_Order();
|
7 |
+
$customcard['order_id'] = Mage::getSingleton('checkout/session')->getLastRealOrderId();
|
8 |
+
$order->loadByIncrementId( $customcard['order_id']);
|
9 |
+
|
10 |
+
// Get payment gateway config data
|
11 |
+
$customcard['action'] = Mage::getStoreConfig('payment/cashpaymentgateway_checkout/submit_url');
|
12 |
+
$customcard['merchant_id'] = Mage::getStoreConfig('payment/cashpaymentgateway_checkout/merchant_id');
|
13 |
+
$customcard['merchant_password'] = Mage::getStoreConfig('payment/cashpaymentgateway_checkout/merchant_password');
|
14 |
+
|
15 |
+
$customcard['total_amount'] = round( $order->base_grand_total, 2 );
|
16 |
+
$customcard['redirect_url'] = Mage::getBaseUrl().'customcard/standard/response';
|
17 |
+
// signature genration
|
18 |
+
$customcard['request_signature'] = Mage::helper('cashpaymentgateway')->getHashSignature($customcard['merchant_id'],$customcard['merchant_password']);
|
19 |
+
|
20 |
+
// Retrieve order details
|
21 |
+
$billingAddress = $order->getBillingAddress();
|
22 |
+
$billingData = $billingAddress->getData();
|
23 |
+
$shippingAddress = $order->getShippingAddress();
|
24 |
+
if ($shippingAddress)
|
25 |
+
$shippingData = $shippingAddress->getData();
|
26 |
+
|
27 |
+
$customcard['billing_cust_name'] = $billingData['firstname'] . ' ' . $billingData['lastname'];
|
28 |
+
$customcard['billing_cust_address'] = $billingAddress->street;
|
29 |
+
$customcard['billing_cust_state'] = $billingAddress->region;
|
30 |
+
$customcard['billing_cust_country'] = Mage::getModel('directory/country')->load($billingAddress->country_id)->getName();
|
31 |
+
$customcard['billing_city'] = $billingAddress->city;
|
32 |
+
$customcard['billing_zip'] = $billingAddress->postcode;
|
33 |
+
$customcard['billing_cust_tel'] = $billingAddress->telephone;
|
34 |
+
$customcard['billing_cust_email'] = $order->customer_email;
|
35 |
+
|
36 |
+
if ($shippingAddress){
|
37 |
+
$customcard['delivery_cust_name'] = $shippingData['firstname'] . ' ' . $shippingData['lastname'];
|
38 |
+
$customcard['delivery_cust_address'] = $shippingAddress->street;
|
39 |
+
$customcard['delivery_cust_state'] = $shippingAddress->region;
|
40 |
+
$customcard['delivery_cust_country'] = Mage::getModel('directory/country')->load($shippingAddress->country_id)->getName();
|
41 |
+
$customcard['delivery_city'] = $shippingAddress->city;
|
42 |
+
$customcard['delivery_cust_tel'] = $shippingAddress->telephone;
|
43 |
+
$customcard['delivery_zip'] = $shippingAddress->postcode;
|
44 |
+
}
|
45 |
+
|
46 |
+
else {
|
47 |
+
$customcard['delivery_cust_name'] = '';
|
48 |
+
$customcard['delivery_cust_address'] = '';
|
49 |
+
$customcard['delivery_cust_state'] = '';
|
50 |
+
$customcard['delivery_cust_country'] = '';
|
51 |
+
$customcard['delivery_cust_tel'] = '';
|
52 |
+
$customcard['delivery_city'] = '';
|
53 |
+
$customcard['delivery_zip'] = '';
|
54 |
+
}
|
55 |
+
|
56 |
+
// Add data to registry so it's accessible in the view file
|
57 |
+
Mage::register('customcard', $customcard);
|
58 |
+
|
59 |
+
// Render layout
|
60 |
+
$this->loadLayout();
|
61 |
+
$block = $this->getLayout()->createBlock('Mage_Core_Block_Template','customcard', array('template' => 'cashpaymentgateway/redirect.phtml'));
|
62 |
+
$this->getLayout()->getBlock('content')->append($block);
|
63 |
+
$this->renderLayout();
|
64 |
+
}
|
65 |
+
// The response action is triggered when your gateway sends back a response after processing the customer's payment
|
66 |
+
public function responseAction() {
|
67 |
+
if($this->getRequest()->isPost()) {
|
68 |
+
if(isset($_POST['merchant_id'])&&isset($_POST['result'])&&isset($_POST['order_id'])&&isset($_POST['gateway_signature'])&&$_POST['result']!= null) {
|
69 |
+
// gateway post data
|
70 |
+
$validated = $_POST['result'];
|
71 |
+
$orderId = $_POST['order_id'];
|
72 |
+
$g_Sign = $_POST['gateway_signature'];
|
73 |
+
$merchant_id = $_POST['merchant_id'];
|
74 |
+
$merchant_password = Mage::getStoreConfig('payment/cashpaymentgateway_checkout/merchant_password');
|
75 |
+
// signature to validate gateway response
|
76 |
+
$s_Sign = Mage::helper('cashpaymentgateway')->getHashSignature($merchant_id.$orderId,$merchant_password);
|
77 |
+
// validation of signature
|
78 |
+
if(Mage::helper('cashpaymentgateway')->validateSignature($s_Sign,$g_Sign)){
|
79 |
+
if($validated==="success"){
|
80 |
+
// Payment was successful, so update the order's state, send order email and move to the success page
|
81 |
+
$order = Mage::getModel('sales/order');
|
82 |
+
$order->loadByIncrementId($orderId);
|
83 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Mosambee.Cash Receive Wallet Payment Successfully.');
|
84 |
+
// exception handling for order email
|
85 |
+
try{
|
86 |
+
$order->sendNewOrderEmail();
|
87 |
+
$order->setEmailSent(true);
|
88 |
+
}catch(Exception $e){
|
89 |
+
Mage::logException($e);
|
90 |
+
}
|
91 |
+
// check for invoice
|
92 |
+
if(!$order->canInvoice()) {
|
93 |
+
Mage::throwException(Mage::helper('core')->__('Cannot create an invoice.'));
|
94 |
+
}
|
95 |
+
$invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
|
96 |
+
// check for order quantity
|
97 |
+
if(!$invoice->getTotalQty()) {
|
98 |
+
Mage::throwException(Mage::helper('core')->__('Cannot create an invoice without products.'));
|
99 |
+
}
|
100 |
+
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
|
101 |
+
$invoice->addComment('Invoice genrated automatically by Mosambee.Cash');
|
102 |
+
$invoice->register();
|
103 |
+
$transactionSave = Mage::getModel('core/resource_transaction')
|
104 |
+
->addObject($invoice)
|
105 |
+
->addObject($order);
|
106 |
+
$transactionSave->save();
|
107 |
+
// Exception Handling for invoice email
|
108 |
+
try {
|
109 |
+
$invoice->sendEmail(true);
|
110 |
+
} catch (Exception $e) {
|
111 |
+
Mage::logException($e);
|
112 |
+
Mage::getSingleton('core/session')->addError($this->__('Unable to send the invoice email.'));
|
113 |
+
}
|
114 |
+
// save the order
|
115 |
+
$order->save();
|
116 |
+
Mage::getSingleton('checkout/session')->unsQuoteId();
|
117 |
+
Mage::getSingleton('core/session')->addSuccess('Thank You for choosing Mosambee.Cash wallet payment!');
|
118 |
+
Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/success', array('_secure'=>true));
|
119 |
+
}
|
120 |
+
// if payment not success cancel order
|
121 |
+
else{
|
122 |
+
Mage::getSingleton('core/session')->addError('Mosambee.Cash has declined the wallet payment!');
|
123 |
+
$this->cancelAction();
|
124 |
+
}
|
125 |
+
}
|
126 |
+
// cancel order if signature not match
|
127 |
+
else{
|
128 |
+
Mage::getSingleton('core/session')->addError('Something goes wrong, Please try again!');
|
129 |
+
$this->cancelAction();
|
130 |
+
}
|
131 |
+
}
|
132 |
+
else{
|
133 |
+
Mage::getSingleton('core/session')->addError('Gateway request parameter error, Please try again!');
|
134 |
+
$this->cancelAction();
|
135 |
+
}
|
136 |
+
}
|
137 |
+
// if response is not post
|
138 |
+
else{
|
139 |
+
Mage::getSingleton('core/session')->addError('Gateway request method not validated, Please try again!');
|
140 |
+
$this->cancelAction();
|
141 |
+
}
|
142 |
+
}
|
143 |
+
// The cancel action is triggered when an order is to be cancelled
|
144 |
+
public function cancelAction() {
|
145 |
+
$session = Mage::getSingleton('checkout/session');
|
146 |
+
$cart = Mage::getSingleton('checkout/cart');
|
147 |
+
|
148 |
+
if($session->getLastRealOrderId()) {
|
149 |
+
$incrementId = $session->getLastRealOrderId();
|
150 |
+
if (empty($incrementId)) {
|
151 |
+
$this->_redirect('checkout/cart');
|
152 |
+
return;
|
153 |
+
}
|
154 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($session->getLastRealOrderId());
|
155 |
+
$session->getQuote()->setIsActive(false)->save();
|
156 |
+
$session->clear();
|
157 |
+
try{
|
158 |
+
$order->setActionFlag(Mage_Sales_Model_Order::ACTION_FLAG_CANCEL, true);
|
159 |
+
$order->cancel()->save();
|
160 |
+
}catch (Mage_Core_Exception $e) {
|
161 |
+
Mage::logException($e);
|
162 |
+
}
|
163 |
+
$items = $order->getItemsCollection();
|
164 |
+
foreach ($items as $item) {
|
165 |
+
try {
|
166 |
+
$cart->addOrderItem($item);
|
167 |
+
}catch (Mage_Core_Exception $e) {
|
168 |
+
$session->addError($this->__($e->getMessage()));
|
169 |
+
Mage::logException($e);
|
170 |
+
continue;
|
171 |
+
}
|
172 |
+
}
|
173 |
+
$cart->save();
|
174 |
+
}
|
175 |
+
$this->_redirect('checkout/cart');
|
176 |
+
}
|
177 |
+
}
|
app/code/community/Mosambee/CashPaymentGateway/etc/config.xml
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Mosambee_CashPaymentGateway>
|
5 |
+
<version>1.0.0</version>
|
6 |
+
</Mosambee_CashPaymentGateway>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<helpers>
|
10 |
+
<cashpaymentgateway>
|
11 |
+
<class>Mosambee_CashPaymentGateway_Helper</class>
|
12 |
+
</cashpaymentgateway>
|
13 |
+
</helpers>
|
14 |
+
<models>
|
15 |
+
<cashpaymentgateway>
|
16 |
+
<class>Mosambee_CashPaymentGateway_Model</class>
|
17 |
+
</cashpaymentgateway>
|
18 |
+
</models>
|
19 |
+
<resources>
|
20 |
+
<cashpaymentgateway_setup>
|
21 |
+
<setup>
|
22 |
+
<module>Mosambee_CashPaymentGateway</module>
|
23 |
+
</setup>
|
24 |
+
<connection>
|
25 |
+
<use>core_setup</use>
|
26 |
+
</connection>
|
27 |
+
</cashpaymentgateway_setup>
|
28 |
+
<cashpaymentgateway_read>
|
29 |
+
<connection>
|
30 |
+
<use>core_read</use>
|
31 |
+
</connection>
|
32 |
+
</cashpaymentgateway_read>
|
33 |
+
<cashpaymentgateway_write>
|
34 |
+
<connection>
|
35 |
+
<use>core_write</use>
|
36 |
+
</connection>
|
37 |
+
</cashpaymentgateway_write>
|
38 |
+
</resources>
|
39 |
+
<fieldsets>
|
40 |
+
<sales_convert_quote_payment>
|
41 |
+
<check_no>
|
42 |
+
<to_order_payment>*</to_order_payment>
|
43 |
+
</check_no>
|
44 |
+
<check_date>
|
45 |
+
<to_order_payment>*</to_order_payment>
|
46 |
+
</check_date>
|
47 |
+
</sales_convert_quote_payment>
|
48 |
+
</fieldsets>
|
49 |
+
</global>
|
50 |
+
<frontend>
|
51 |
+
<routers>
|
52 |
+
<cashpaymentgateway>
|
53 |
+
<use>standard</use>
|
54 |
+
<args>
|
55 |
+
<module>Mosambee_CashPaymentGateway</module>
|
56 |
+
<frontName>customcard</frontName>
|
57 |
+
</args>
|
58 |
+
</cashpaymentgateway>
|
59 |
+
</routers>
|
60 |
+
</frontend>
|
61 |
+
<default>
|
62 |
+
<payment>
|
63 |
+
<cashpaymentgateway_checkout>
|
64 |
+
<active>1</active>
|
65 |
+
<model>cashpaymentgateway/standard</model>
|
66 |
+
<order_status>processing</order_status>
|
67 |
+
<title>Mosambee.Cash Wallet Payment</title>
|
68 |
+
<payment_action>sale</payment_action>
|
69 |
+
<submit_url> </submit_url>
|
70 |
+
<merchant_id> </merchant_id>
|
71 |
+
<merchant_password> </merchant_password>
|
72 |
+
<allowspecific>0</allowspecific>
|
73 |
+
<sort_order>1</sort_order>
|
74 |
+
</cashpaymentgateway_checkout>
|
75 |
+
</payment>
|
76 |
+
</default>
|
77 |
+
</config>
|
app/code/community/Mosambee/CashPaymentGateway/etc/system.xml
ADDED
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<payment>
|
5 |
+
<groups>
|
6 |
+
<cashpaymentgateway_checkout translate="label comment" module="cashpaymentgateway">
|
7 |
+
<label>Mosambee.Cash Wallet Payment Gateway</label>
|
8 |
+
<comment>
|
9 |
+
<![CDATA[
|
10 |
+
If you don't have Mosambee.Cash wallet payment merchant account details contact Mosambee.cash</br>
|
11 |
+
Website- <a href="http://www.mosambee.in" target="_blnk">www.mosambee.in</a> ||
|
12 |
+
Phone- +91-22 28523171 ||
|
13 |
+
Email- <a href="mailto:magento@mosambee.in">magento@mosambee.in</a>
|
14 |
+
]]>
|
15 |
+
</comment>
|
16 |
+
<frontend_type>text</frontend_type>
|
17 |
+
<sort_order>671</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 |
+
<comment>Enable / Disable Mosambee.Cash gateway in store</comment>
|
25 |
+
<frontend_type>select</frontend_type>
|
26 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
27 |
+
<sort_order>10</sort_order>
|
28 |
+
<show_in_default>1</show_in_default>
|
29 |
+
<show_in_website>1</show_in_website>
|
30 |
+
<show_in_store>0</show_in_store>
|
31 |
+
</active>
|
32 |
+
<title translate="label">
|
33 |
+
<label>Gateway Title</label>
|
34 |
+
<comment>Visible to customer at the time of checkout, Put any meaningful text</comment>
|
35 |
+
<frontend_type>text</frontend_type>
|
36 |
+
<sort_order>20</sort_order>
|
37 |
+
<show_in_default>1</show_in_default>
|
38 |
+
<show_in_website>1</show_in_website>
|
39 |
+
<show_in_store>1</show_in_store>
|
40 |
+
</title>
|
41 |
+
<order_status translate="label">
|
42 |
+
<label>New Order Status</label>
|
43 |
+
<comment>Default Order Status</comment>
|
44 |
+
<frontend_type>select</frontend_type>
|
45 |
+
<source_model>adminhtml/system_config_source_order_status</source_model>
|
46 |
+
<sort_order>50</sort_order>
|
47 |
+
<show_in_default>1</show_in_default>
|
48 |
+
<show_in_website>1</show_in_website>
|
49 |
+
<show_in_store>0</show_in_store>
|
50 |
+
</order_status>
|
51 |
+
<submit_url>
|
52 |
+
<label>Gateway URL</label>
|
53 |
+
<comment>Enter Mosambee.Cash Gateway URL</comment>
|
54 |
+
<frontend_type>text</frontend_type>
|
55 |
+
<sort_order>58</sort_order>
|
56 |
+
<show_in_default>1</show_in_default>
|
57 |
+
<show_in_website>1</show_in_website>
|
58 |
+
<show_in_store>0</show_in_store>
|
59 |
+
</submit_url>
|
60 |
+
<merchant_id>
|
61 |
+
<label>Merchant id</label>
|
62 |
+
<comment>Enter Mosambee.Cash Merchant ID</comment>
|
63 |
+
<frontend_type>text</frontend_type>
|
64 |
+
<sort_order>59</sort_order>
|
65 |
+
<show_in_default>1</show_in_default>
|
66 |
+
<show_in_website>1</show_in_website>
|
67 |
+
<show_in_store>0</show_in_store>
|
68 |
+
</merchant_id>
|
69 |
+
<merchant_password>
|
70 |
+
<label>Merchant Password</label>
|
71 |
+
<comment>Enter Mosambee.Cash Merchant Password</comment>
|
72 |
+
<frontend_type>password</frontend_type>
|
73 |
+
<sort_order>64</sort_order>
|
74 |
+
<show_in_default>1</show_in_default>
|
75 |
+
<show_in_website>1</show_in_website>
|
76 |
+
<show_in_store>0</show_in_store>
|
77 |
+
</merchant_password>
|
78 |
+
<allowspecific translate="label">
|
79 |
+
<label>Payment Applicable From</label>
|
80 |
+
<comment>Allow all countries or specific countries</comment>
|
81 |
+
<frontend_type>select</frontend_type>
|
82 |
+
<sort_order>66</sort_order>
|
83 |
+
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
84 |
+
<show_in_default>1</show_in_default>
|
85 |
+
<show_in_website>1</show_in_website>
|
86 |
+
<show_in_store>0</show_in_store>
|
87 |
+
</allowspecific>
|
88 |
+
<specificcountry translate="label">
|
89 |
+
<label>Countries Payment Applicable From</label>
|
90 |
+
<frontend_type>multiselect</frontend_type>
|
91 |
+
<sort_order>70</sort_order>
|
92 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
93 |
+
<show_in_default>1</show_in_default>
|
94 |
+
<show_in_website>1</show_in_website>
|
95 |
+
<show_in_store>0</show_in_store>
|
96 |
+
<depends><allowspecific>1</allowspecific></depends>
|
97 |
+
</specificcountry>
|
98 |
+
<sort_order translate="label">
|
99 |
+
<label>Sort Order</label>
|
100 |
+
<frontend_type>text</frontend_type>
|
101 |
+
</sort_order>
|
102 |
+
<sort_order>100</sort_order>
|
103 |
+
<show_in_default>1</show_in_default>
|
104 |
+
<show_in_website>1</show_in_website>
|
105 |
+
<show_in_store>0</show_in_store>
|
106 |
+
</fields>
|
107 |
+
</cashpaymentgateway_checkout>
|
108 |
+
</groups>
|
109 |
+
</payment>
|
110 |
+
</sections>
|
111 |
+
</config>
|
app/design/frontend/base/default/template/cashpaymentgateway/redirect.phtml
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Get Custom card Details
|
3 |
+
$customcard = Mage::registry( 'customcard' );
|
4 |
+
?>
|
5 |
+
<!-- Notify user if browser not support javascript -->
|
6 |
+
<noscript>
|
7 |
+
Sorry! Your browser dosn't supoort javascript, try to use different browser or enable javascript in your web browser.
|
8 |
+
</noscript>
|
9 |
+
|
10 |
+
<form name="customcardform" id="name="customcardform"" method="post" action="<?php echo $customcard['action']; ?>">
|
11 |
+
<!-- Required Parameters -->
|
12 |
+
<input type="hidden" name="merchant_id" value="<?php echo $customcard['merchant_id']; ?>">
|
13 |
+
<input type="hidden" name="total_amount" value="<?php echo $customcard['total_amount']; ?>">
|
14 |
+
<input type="hidden" name="order_id" value="<?php echo $customcard['order_id']; ?>">
|
15 |
+
<input type="hidden" name="request_signature" value="<?php echo $customcard['request_signature']; ?>">
|
16 |
+
<input type="hidden" name="redirect_url" value="<?php echo $customcard['redirect_url']; ?>">
|
17 |
+
<!-- ### END Required Parameters -->
|
18 |
+
|
19 |
+
<!-- Billing details -->
|
20 |
+
<input type="hidden" name="billing_cust_name" value="<?php echo $customcard['billing_cust_name']; ?>">
|
21 |
+
<input type="hidden" name="billing_cust_address" value="<?php echo $customcard['billing_cust_address']; ?>">
|
22 |
+
<input type="hidden" name="billing_cust_state" value="<?php echo $customcard['billing_cust_state']; ?>">
|
23 |
+
<input type="hidden" name="billing_cust_country" value="<?php echo $customcard['billing_cust_country']; ?>">
|
24 |
+
<input type="hidden" name="billing_cust_city" value="<?php echo $customcard['billing_city']; ?>">
|
25 |
+
<input type="hidden" name="billing_zip_code" value="<?php echo $customcard['billing_zip']; ?>">
|
26 |
+
<input type="hidden" name="billing_cust_tel" value="<?php echo $customcard['billing_cust_tel']; ?>">
|
27 |
+
<input type="hidden" name="billing_cust_email" value="<?php echo $customcard['billing_cust_email']; ?>">
|
28 |
+
<!-- ### END Billing details -->
|
29 |
+
<!-- Delivery Details -->
|
30 |
+
<input type="hidden" name="delivery_cust_name" value="<?php echo $customcard['delivery_cust_name']; ?>">
|
31 |
+
<input type="hidden" name="delivery_cust_address" value="<?php echo $customcard['delivery_cust_address']; ?>">
|
32 |
+
<input type="hidden" name="delivery_cust_state" value="<?php echo $customcard['delivery_cust_state']; ?>">
|
33 |
+
<input type="hidden" name="delivery_cust_country" value="<?php echo $customcard['delivery_cust_country']; ?>">
|
34 |
+
<input type="hidden" name="delivery_cust_city" value="<?php echo $customcard['delivery_city']; ?>">
|
35 |
+
<input type="hidden" name="delivery_cust_tel" value="<?php echo $customcard['delivery_cust_tel']; ?>">
|
36 |
+
<input type="hidden" name="delivery_zip_code" value="<?php echo $customcard['delivery_zip']; ?>">
|
37 |
+
<!-- ### END Delivery Details -->
|
38 |
+
</form>
|
39 |
+
<!-- Script to submit form -->
|
40 |
+
<script type="text/javascript">
|
41 |
+
document.customcardform.submit();
|
42 |
+
</script>
|
app/etc/modules/Mosambee_CashPaymentGateway.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Mosambee_CashPaymentGateway>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Mosambee_CashPaymentGateway>
|
8 |
+
</modules>
|
9 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Mosambee_CashPaymentGateway</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Mosambee.Cash Payemt gateway provide wallets payment.</summary>
|
10 |
+
<description>Mosambee.Cash Wallet Payment Gateway provides all the popular wallets (PayU Money, Citrus, Mom, Atom, Idea Money, Vodafone mPesa, MobiKwik etc.) payment functionality on Magento CE e-commerce store.</description>
|
11 |
+
<notes>wallet payment gateway for mosambee.cash.</notes>
|
12 |
+
<authors><author><name>Mosambee</name><user>mosambeecash</user><email>magento@mosambee.in</email></author><author><name>Satyendra kumar Singh</name><user>singhsatyendra</user><email>satyendrasingh971@gmail.com</email></author></authors>
|
13 |
+
<date>2016-04-01</date>
|
14 |
+
<time>09:08:53</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Mosambee"><dir name="CashPaymentGateway"><dir name="Helper"><file name="Data.php" hash="bc5b29219d0c04141f74552d5dde239b"/></dir><dir name="Model"><file name="Standard.php" hash="36cb44b920bdb52f94c1a62a780cfa2c"/></dir><dir name="controllers"><file name="StandardController.php" hash="1e65f3005d12a6d8dcb1385dae794faf"/></dir><dir name="etc"><file name="config.xml" hash="c134896825626d7fd5d1a37b1b01d4b3"/><file name="system.xml" hash="3694fe490e5ee748bbc39a0d39887253"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mosambee_CashPaymentGateway.xml" hash="9d2a2edb1037157f9cff6177de5b8888"/></dir></target><target name="mageweb"><dir name="app"><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="cashpaymentgateway"><file name="redirect.phtml" hash="519e35b9c7543613ed3e7c7999000145"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|