faturahpayment - Version 0.1.0

Version Notes

This extension will help you to add faturah payment method on payment page.

Download this release

Release Info

Developer BluethinkIT
Extension faturahpayment
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

app/code/community/BT/Faturahpayment/Block/Standard/Redirect.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /****************************************************************
3
+ *
4
+ * @Company Name: Bluethink IT Consulting
5
+ * @Author: BT Team
6
+ * @Date: 23 August 2014
7
+ * @Description: Redirect on payment gateway.
8
+ * @Support : http://ticket.bluethink.in/
9
+ *
10
+ ***************************************************************/
11
+ class BT_faturahpayment_Block_Standard_Redirect extends Mage_Core_Block_Abstract
12
+ {
13
+
14
+
15
+ protected function _toHtml()
16
+ {
17
+ $standard = Mage::getModel('faturahpayment/standard');
18
+ $action = $standard->getToken();
19
+ $html = '<html><body>';
20
+ $html.= $this->__('You will be redirected to the faturah website in a few seconds.');
21
+ $html .= '<form id ="faturah_standard_checkout" method ="post" action ="'.$action.'" >';
22
+ $html .= '<form>';
23
+ $html.= '<script type="text/javascript">document.getElementById("faturah_standard_checkout").submit();</script>';
24
+ $html.= '</body></html>';
25
+ return $html;
26
+ }
27
+ }
app/code/community/BT/Faturahpayment/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class BT_Faturahpayment_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/community/BT/Faturahpayment/Model/Standard.php ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /****************************************************************
4
+ *
5
+ * @Company Name: Bluethink IT Consulting
6
+ * @Author: BT Team
7
+ * @Date: 23 August 2014
8
+ * @Description: Used for process faturah payment
9
+ * @Support : http://ticket.bluethink.in/
10
+ *
11
+ ***************************************************************/
12
+
13
+
14
+ class BT_Faturahpayment_Model_Standard extends Mage_Payment_Model_Method_Abstract
15
+ {
16
+
17
+ protected $_code = 'faturahpayment';
18
+
19
+
20
+ /**
21
+ * Return Order place redirect url
22
+ *
23
+ * @return string
24
+ */
25
+ public function getOrderPlaceRedirectUrl()
26
+ {
27
+ return Mage::getUrl('faturahpayment/index/redirect', array('_secure' => true));
28
+ }
29
+
30
+
31
+
32
+ /**
33
+ * Return form field array
34
+ *
35
+ * @return array
36
+ */
37
+
38
+
39
+ public function getToken(){
40
+
41
+ try
42
+ {//*** Initialize
43
+ $client = new SoapClient('https://Services.faturah.com/TokenGeneratorWS.asmx?wsdl');
44
+ // $client = new SoapClient('TokenGeneratorWS.wsdl');
45
+ // From the locally downloaded file $strMyMerchantCode = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx1001"; //*** Put your merchant Code
46
+ $strMyMerchantCode = $this->getMerchantCode();
47
+
48
+ $faturahParams = array('GenerateNewMerchantToken'=>array("merchantCode"=>$strMyMerchantCode));
49
+ $result = $client->__soapCall('GenerateNewMerchantToken', $faturahParams);
50
+ $TokenGUID = $result->GenerateNewMerchantTokenResult;
51
+ $returnURL = $this->RedirectBuyerToPaymentGatwayPage($strMyMerchantCode, $TokenGUID); //*** This Function is illustrated in Appendix III
52
+ return $returnURL ;
53
+ }catch(Exception $ex)
54
+ {
55
+
56
+ Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('faturahpayment/index/error'));
57
+ Mage::app()->getResponse()->sendResponse();
58
+ exit;
59
+ //return;
60
+
61
+ }
62
+
63
+
64
+ }
65
+
66
+ function RedirectBuyerToPaymentGatwayPage($strMerchantCode, $TokenGUID)
67
+ {
68
+
69
+ $orderIncrementId = $this->getCheckout()->getLastRealOrderId();
70
+ $order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
71
+
72
+ $sandboxMode = Mage::getStoreConfig('payment/faturahpayment/sandbox_flag');
73
+
74
+ if(!$sandboxMode){
75
+ $FaturahPaymentPageURL = "https://gateway.faturah.com/TransactionRequestHandler.aspx";
76
+ }else{
77
+ $FaturahPaymentPageURL = "https://gatewaytest.faturah.com/TransactionRequestHandler.aspx";
78
+ }
79
+
80
+
81
+ $strTransactionPrice = $order->getBaseGrandTotal();
82
+ $shippingAmount = $order->getShippingAmount();
83
+ $mobile = $order->getShippingAddress()->getTelephone();
84
+
85
+ $email = $order->getCustomerEmail();
86
+ $customerName = $order->getCustomerName();
87
+
88
+
89
+ //**** Append Mandatory fields to URL
90
+ $FaturahPaymentPageURL .= "?" . "mc=" . $strMerchantCode; //*** Merchant Code
91
+ $FaturahPaymentPageURL .= "&" . "mt=" . $TokenGUID; //*** Token Genrated
92
+ $FaturahPaymentPageURL .= "&" . "dt=" . date('m/d/Y h:i:s A'); //*** Transaction date & time
93
+ $FaturahPaymentPageURL .= "&" . "a=" . $strTransactionPrice; //*** Merchant Code
94
+
95
+ $items = $order->getAllVisibleItems();
96
+ $count = count($items);
97
+
98
+ $productIds = '' ;
99
+ $productName = '' ;
100
+ $productQty = '' ;
101
+ $productPrice = '' ;
102
+ foreach ($items as $itemId => $item)
103
+ {
104
+
105
+
106
+ $productIds[] = $item->getId();
107
+ $productName[] = $item->getName();
108
+ $productQty[] = (int) $item->getQtyOrdered();
109
+ $productPrice[] = round($item->getPrice(),2);
110
+ }
111
+
112
+ $productIdsString = implode("|",$productIds) ;
113
+ $productPriceString = implode("|",$productPrice);
114
+ $productQtyString = implode("|",$productQty) ;
115
+ $productNameString = implode(" | ",$productName) ;
116
+
117
+
118
+
119
+ //******************************************
120
+ //*** These parameters should be passed aslo
121
+ //******************************************
122
+ $FaturahPaymentPageURL .= "&" . "ProductID=" .$productIdsString;
123
+ if(strlen($productNameString) <= 1000)
124
+ {
125
+ $FaturahPaymentPageURL .= "&" . "ProductName=" . $productNameString;
126
+ }
127
+ if(strlen($productNameString) <= 1000) //*** Check on lenght of List of products Descriptions
128
+ {
129
+ $FaturahPaymentPageURL .= "&" . "ProductDescription=" . $productNameString; //*** List of products Descriptions
130
+ }
131
+ $FaturahPaymentPageURL .= "&" . "ProductQuantity=" . $productQtyString; //*** List of products Quanitites
132
+ $FaturahPaymentPageURL .= "&" . "ProductPrice=" . $productPriceString; //*** List of products Prices
133
+ $FaturahPaymentPageURL .= "&" . "DeliveryCharge=" . $shippingAmount; //*** Delivery Charge
134
+ $FaturahPaymentPageURL .= "&" . "CustomerName=" . $customerName;
135
+
136
+
137
+
138
+ //*********************************************************************
139
+ //*** Here you can pass more fields as per your specific configuration
140
+ //*********************************************************************
141
+ $FaturahPaymentPageURL .= "&" . "EMail=" . $email; //*** Customer Email
142
+ $FaturahPaymentPageURL .= "&" . "lang=" . "en"; //*** Preferred Language (ar=Arabic, en=English)
143
+ $FaturahPaymentPageURL .= "&" . "PhoneNumber=" . $mobile; //*** Customer Email
144
+
145
+ return $FaturahPaymentPageURL ;
146
+
147
+ }
148
+
149
+
150
+ public function getMerchantCode(){
151
+
152
+ return Mage::getStoreConfig('payment/faturahpayment/merchant_code');
153
+
154
+ }
155
+
156
+
157
+
158
+ public function getCheckout()
159
+ {
160
+ return Mage::getSingleton('checkout/session');
161
+ }
162
+
163
+
164
+
165
+
166
+
167
+ }
app/code/community/BT/Faturahpayment/controllers/IndexController.php ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /****************************************************************
3
+ *
4
+ * @Company Name: Bluethink IT Consulting
5
+ * @Author: BT Team
6
+ * @Date: 23 August 2014
7
+ * @Description: Used for process faturah payment
8
+ * @Support : http://ticket.bluethink.in/
9
+ *
10
+ ***************************************************************/
11
+
12
+ class BT_Faturahpayment_IndexController extends Mage_Core_Controller_Front_Action
13
+ {
14
+ public function indexAction()
15
+ {
16
+ $this->loadLayout();
17
+ $this->renderLayout();
18
+ }
19
+
20
+
21
+ public function errorAction()
22
+ {
23
+ $this->loadLayout();
24
+ $this->renderLayout();
25
+ }
26
+
27
+
28
+ public function redirectAction()
29
+ {
30
+ $session = Mage::getSingleton('checkout/session');
31
+ $session->setBilldeskStandardQuoteId($session->getQuoteId());
32
+ $this->getResponse()->setBody($this->getLayout()->createBlock('faturahpayment/standard_redirect')->toHtml());
33
+ $session->unsQuoteId();
34
+ $session->unsRedirectUrl();
35
+ }
36
+
37
+
38
+ public function callbackprocessAction(){
39
+
40
+ try {
41
+
42
+
43
+ $strReturnedToken = $_GET["token"];
44
+ $strTransactionCode = '';
45
+
46
+
47
+ if(isset($_GET["ignore"]) && $_GET["ignore"] == 0)
48
+ {
49
+
50
+ if(isset($_GET["Response"]) && !empty($_GET["Response"]) && strtolower($_GET["Response"]) == "0") //**** Error happened
51
+ {
52
+ //*** Handle error messages & update my system that there is an error
53
+ if(isset($_GET["ResponseText"]) && !empty($_GET["ResponseText"]) != null)
54
+ {
55
+ switch(strtolower($_GET["ResponseText"]))
56
+ {
57
+ case "system error":
58
+ //*******************************************
59
+ //**** Handle this error case into my System
60
+ //*******************************************
61
+
62
+ $this->_redirect('checkout/onepage/failure');
63
+
64
+ break;
65
+
66
+ case "invalid configuration":
67
+ //*******************************************
68
+ //**** Handle this error case into my System
69
+ //*******************************************
70
+ $this->_redirect('checkout/onepage/failure');
71
+
72
+ break;
73
+
74
+ case "merchant code(mc) is not found":
75
+ //*******************************************
76
+ //**** Handle this error case into my System
77
+ //*******************************************
78
+ $this->_redirect('checkout/onepage/failure');
79
+ break;
80
+
81
+ case "...": //**** Repeat case for all other error messages and as per your logic
82
+ //**************************************
83
+ //**** Handle error case into my System
84
+ //**************************************
85
+ $this->_redirect('checkout/onepage/failure');
86
+ break;
87
+ }
88
+ }
89
+ }else //*** No error happened
90
+ {
91
+ //*** Initaialize
92
+ $strTransactionCode = $_GET["code"];
93
+
94
+ //*** Handle returned status message
95
+ if(isset($_GET["status"]) && !empty($_GET["status"]))
96
+ {
97
+ switch(strtolower($_GET["status"]))
98
+ {
99
+ case '15': //**** Transaction is accepted by bank
100
+ //*******************************************
101
+ //**** Handle this status case into my System
102
+ //*******************************************
103
+ $this->_redirect('checkout/onepage/success');
104
+ break;
105
+
106
+ case '30': //**** Transaction is approved/accepted by Faturah Team
107
+ //*******************************************
108
+ //**** Handle this status case into my System
109
+ //*******************************************
110
+ $this->_redirect('checkout/onepage/success');
111
+ break;
112
+
113
+ case '22': //**** Transaction is rejected
114
+ //*******************************************
115
+ //**** Handle this status case into my System
116
+ //*******************************************
117
+ $this->_redirect('checkout/onepage/failure');
118
+ break;
119
+
120
+ case '6': //**** Transaction is NOT approved/accepted by Faturah Team
121
+ //*******************************************
122
+ //**** Handle this status case into my System
123
+ //*******************************************
124
+ $this->_redirect('checkout/onepage/failure');
125
+ break;
126
+
127
+ case '1': //**** Transaction is under processing on the bank
128
+ //*******************************************
129
+ //**** Handle this status case into my System
130
+ //*******************************************
131
+ $this->_redirect('checkout/onepage/success');
132
+ break;
133
+
134
+ case '18': //**** Transaction is under processing on Faturah Team for approval/acceptance
135
+ //*******************************************
136
+ //**** Handle this status case into my System
137
+ //*******************************************
138
+
139
+
140
+ $this->_redirect('checkout/onepage/success');
141
+
142
+ break;
143
+ }
144
+ }
145
+ }
146
+ }//*****************************************************
147
+ //*** Second handle second message come from Faturah
148
+ //*** Only display message to buyer with this trsnaction status
149
+ //*****************************************************
150
+ else //*** This is second message comes from faturah
151
+ {
152
+ //**** Check if there is error or not
153
+ if(isset($_GET["Response"]) && !empty($_GET["Response"]) && strtolower($_GET["Response"]) == "0") //**** Error happened
154
+ {
155
+ //*** Handle error messages & update my system that there is an error
156
+ if(isset($_GET["ResponseText"]) && !empty($_GET["ResponseText"]))
157
+ {
158
+ //**** Display Error message to buyer
159
+ if(isset($_GET["lang"]) && !empty($_GET["lang"]) && strtolower($_GET["lang"]) == "ar")
160
+ print("حدث خطأ اثناء العملية!");
161
+ else
162
+ print("An error occured while handle this payment!");
163
+ }
164
+ }else //*** No error happened
165
+ {
166
+ //*** Initaialize
167
+ $strTransactionCode = $_GET["code"];
168
+
169
+ //*** Display status message based on returned status message
170
+ if(isset($_GET["status"]) && !empty($_GET["status"]))
171
+ {
172
+ switch($_GET["status"])
173
+ {
174
+ case '15': //**** Transaction is accepted by bank
175
+ //**** Display Error message to buyer
176
+ if(isset($_GET["lang"]) && !empty($_GET["lang"]) && strtolower(
177
+ $_GET["lang"]) == "ar")
178
+ print("العملية بكود: " . $strTransactionCode . " قبلت من البنك");
179
+ else
180
+ print("Your transaction with code: " . $strTransactionCode . " is accepted by bank");
181
+ break;
182
+
183
+ case '30': //**** Transaction is approved/accepted by Faturah Team
184
+ //**** Display Error message to buyer
185
+ if(isset($_GET["lang"]) && !empty($_GET["lang"]) && strtolower(
186
+ $_GET["lang"]) == "ar")
187
+ print("العملية بكود: " . $strTransactionCode . " قبلت من فاتورة");
188
+ else
189
+ print
190
+ ("Your transaction with code: " . $strTransactionCode . " is approved/accepted by Faturah Team");
191
+ break;
192
+
193
+ case '22': //**** Transaction is rejected
194
+ //**** Display Error message to buyer
195
+ if(isset($_GET["lang"]) && !empty($_GET["lang"]) && strtolower(
196
+ $_GET["lang"]) == "ar")
197
+ print("العملية بكود: " . $strTransactionCode . " رفضت");
198
+ else
199
+ print("Your transaction with code: " . $strTransactionCode . " is rejected");
200
+ break;
201
+
202
+ case '6': //**** Transaction is NOT approved/accepted by Faturah Team
203
+ //**** Display Error message to buyer
204
+ if(isset($_GET["lang"]) && !empty($_GET["lang"]) && strtolower(
205
+ $_GET["lang"]) == "ar")
206
+ print("العملية بكود: " . $strTransactionCode . " رفضت من فاتورة");
207
+ else
208
+ print
209
+ ("Your transaction with code: " . $strTransactionCode . " is NOT approved/accepted by Faturah Team");
210
+ break;
211
+
212
+ case '1': //**** Transaction is under processing on the bank
213
+ //**** Display Error message to buyer
214
+ if(isset($_GET["lang"]) && !empty($_GET["lang"]) && strtolower(
215
+ $_GET["lang"]) == "ar")
216
+ print("العملية بكود: " . $strTransactionCode . " العملية قيد التنفيذ وتحت المراجعة من البنك");
217
+ else
218
+
219
+ print(
220
+ "Your transaction with code: " . $strTransactionCode . " is under processing on the bank");
221
+ break;
222
+
223
+ case '18': //**** Transaction is under processing on Faturah Team for approval/acceptance
224
+ //**** Display Error message to buyer
225
+ if(isset($_GET["lang"]) && !empty($_GET["lang"]) && strtolower(
226
+ $_GET["lang"]) == "ar")
227
+ print("العملية بكود: " . $strTransactionCode . " العملية قيد التنفيذ");
228
+ else
229
+ print("Your transaction with code: " . $strTransactionCode . " is under processing on Faturah Team for approval/acceptance");
230
+ break;
231
+ }
232
+ }
233
+ }
234
+ }
235
+ }catch(Exception $ex)
236
+ {
237
+ print("An Error Occured!");
238
+ }
239
+
240
+
241
+ }
242
+
243
+
244
+ }
app/code/community/BT/Faturahpayment/etc/config.xml ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <BT_Faturahpayment>
5
+ <version>0.1.0</version>
6
+ </BT_Faturahpayment>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <faturahpayment>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>BT_Faturahpayment</module>
14
+ <frontName>faturahpayment</frontName>
15
+ </args>
16
+ </faturahpayment>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <faturahpayment>
21
+ <file>faturahpayment.xml</file>
22
+ </faturahpayment>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <admin>
27
+ <routers>
28
+ <faturahpayment>
29
+ <use>admin</use>
30
+ <args>
31
+ <module>BT_Faturahpayment</module>
32
+ <frontName>faturahpayment</frontName>
33
+ </args>
34
+ </faturahpayment>
35
+ </routers>
36
+ </admin>
37
+ <adminhtml>
38
+
39
+ <acl>
40
+ <resources>
41
+ <all>
42
+ <title>Allow Everything</title>
43
+ </all>
44
+ <admin>
45
+ <children>
46
+ <BT_Faturahpayment>
47
+ <title>Faturahpayment Module</title>
48
+ <sort_order>10</sort_order>
49
+ </BT_Faturahpayment>
50
+ </children>
51
+ </admin>
52
+ </resources>
53
+ </acl>
54
+ <layout>
55
+ <updates>
56
+ <faturahpayment>
57
+ <file>faturahpayment.xml</file>
58
+ </faturahpayment>
59
+ </updates>
60
+ </layout>
61
+ </adminhtml>
62
+ <global>
63
+ <models>
64
+ <faturahpayment>
65
+ <class>BT_Faturahpayment_Model</class>
66
+ <resourceModel>faturahpayment_mysql4</resourceModel>
67
+ </faturahpayment>
68
+ <faturahpayment_mysql4>
69
+ <class>BT_Faturahpayment_Model_Mysql4</class>
70
+ <entities>
71
+ <faturahpayment>
72
+ <table>faturahpayment</table>
73
+ </faturahpayment>
74
+ </entities>
75
+ </faturahpayment_mysql4>
76
+ </models>
77
+ <resources>
78
+ <faturahpayment_setup>
79
+ <setup>
80
+ <module>BT_Faturahpayment</module>
81
+ </setup>
82
+ <connection>
83
+ <use>core_setup</use>
84
+ </connection>
85
+ </faturahpayment_setup>
86
+ <faturahpayment_write>
87
+ <connection>
88
+ <use>core_write</use>
89
+ </connection>
90
+ </faturahpayment_write>
91
+ <faturahpayment_read>
92
+ <connection>
93
+ <use>core_read</use>
94
+ </connection>
95
+ </faturahpayment_read>
96
+ </resources>
97
+ <blocks>
98
+ <faturahpayment>
99
+ <class>BT_Faturahpayment_Block</class>
100
+ </faturahpayment>
101
+ </blocks>
102
+ <helpers>
103
+ <faturahpayment>
104
+ <class>BT_Faturahpayment_Helper</class>
105
+ </faturahpayment>
106
+ </helpers>
107
+ </global>
108
+
109
+ <!-- Start for payment -->
110
+ <default>
111
+ <payment>
112
+ <faturahpayment>
113
+ <model>faturahpayment/standard</model>
114
+ <active>1</active>
115
+ <order_status>pending</order_status>
116
+ <title>Gaturah Payment</title>
117
+ <payment_action>sale</payment_action>
118
+ <allowspecific>0</allowspecific>
119
+ <sort_order>1</sort_order>
120
+ </faturahpayment>
121
+ </payment>
122
+ </default>
123
+
124
+ <!-- End for payment -->
125
+ </config>
app/code/community/BT/Faturahpayment/etc/system.xml ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <sections>
4
+ <payment>
5
+ <groups>
6
+ <faturahpayment translate="label" module="faturahpayment">
7
+ <label>Faturahpayment</label>
8
+ <sort_order>670</sort_order>
9
+ <show_in_default>1</show_in_default>
10
+ <show_in_website>1</show_in_website>
11
+ <show_in_store>0</show_in_store>
12
+ <fields>
13
+ <active translate="label">
14
+ <label>Enabled</label>
15
+ <frontend_type>select</frontend_type>
16
+ <source_model>adminhtml/system_config_source_yesno</source_model>
17
+ <sort_order>1</sort_order>
18
+ <show_in_default>1</show_in_default>
19
+ <show_in_website>1</show_in_website>
20
+ <show_in_store>0</show_in_store>
21
+ </active>
22
+ <order_status translate="label">
23
+ <label>New order status</label>
24
+ <frontend_type>select</frontend_type>
25
+ <source_model>adminhtml/system_config_source_order_status_new</source_model>
26
+ <sort_order>2</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
+ </order_status>
31
+ <title translate="label">
32
+ <label>Title</label>
33
+ <frontend_type>text</frontend_type>
34
+ <sort_order>3</sort_order>
35
+ <show_in_default>1</show_in_default>
36
+ <show_in_website>1</show_in_website>
37
+ <show_in_store>0</show_in_store>
38
+ </title>
39
+
40
+
41
+ <merchant_code>
42
+ <label>Merchant code</label>
43
+ <frontend_type>text</frontend_type>
44
+ <sort_order>59</sort_order>
45
+ <show_in_default>1</show_in_default>
46
+ <show_in_website>1</show_in_website>
47
+ <show_in_store>0</show_in_store>
48
+ </merchant_code>
49
+
50
+
51
+ <sandbox_flag translate="label">
52
+ <label>Sandbox Mode</label>
53
+ <frontend_type>select</frontend_type>
54
+ <source_model>adminhtml/system_config_source_yesno</source_model>
55
+ <sort_order>50</sort_order>
56
+ <show_in_default>1</show_in_default>
57
+ <show_in_website>1</show_in_website>
58
+ <shared>1</shared>
59
+ </sandbox_flag>
60
+
61
+
62
+ <sort_order translate="label">
63
+ <label>Sort Order</label>
64
+ <frontend_type>text</frontend_type>
65
+ <sort_order>62</sort_order>
66
+ <show_in_default>1</show_in_default>
67
+ <show_in_website>1</show_in_website>
68
+ <show_in_store>0</show_in_store>
69
+ </sort_order>
70
+
71
+ </fields>
72
+ </faturahpayment>
73
+ </groups>
74
+ </payment>
75
+ </sections>
76
+ </config>
app/design/frontend/default/default/layout/faturahpayment.xml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <layout version="0.1.0">
4
+
5
+ <faturahpayment_index_error>
6
+ <reference name="root">
7
+ <action method="setTemplate"><template>page/1column.phtml</template></action>
8
+ </reference>
9
+ <reference name="content">
10
+ <block type="core/template" name="error" template="faturahpayment/error.phtml"/>
11
+ </reference>
12
+ </faturahpayment_index_error>
13
+
14
+ </layout>
app/etc/modules/BT_Faturahpayment.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <BT_Faturahpayment>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </BT_Faturahpayment>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>faturahpayment</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</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>This extension will help you to add faturah payment method on payment page.</summary>
10
+ <description>This extension will help you to add faturah payment method on payment page.&#xD;
11
+ Features&#xD;
12
+ No core file changed.&#xD;
13
+ A small useful extension for payment.&#xD;
14
+ Works on Magento 1.6 and above.&#xD;
15
+ Supported Features.&#xD;
16
+ Admin -&gt; go to System -&gt; Configuration -&gt; Sales -&gt; Payment Method -&gt; faturah payment method.&#xD;
17
+ Now you can enable/disable this extension from admin.&#xD;
18
+ Faturah Payment method is displayed automatically at the time of checkout on payment page.&#xD;
19
+ </description>
20
+ <notes>This extension will help you to add faturah payment method on payment page.</notes>
21
+ <authors><author><name>BluethinkIT</name><user>Bluethink</user><email>pramodgupta.bt@gmail.com</email></author></authors>
22
+ <date>2014-09-05</date>
23
+ <time>19:44:21</time>
24
+ <contents><target name="magecommunity"><dir name="BT"><dir name="Faturahpayment"><dir name="Block"><dir name="Standard"><file name="Redirect.php" hash="1fbdf74e85c028114ee40e649d523b6b"/></dir></dir><dir name="Helper"><file name="Data.php" hash="e67c479267d2bc436a8acbdf92eeed14"/></dir><dir name="Model"><file name="Standard.php" hash="917c221b632315b660b56f7693637398"/></dir><dir name="controllers"><file name="IndexController.php" hash="9391e1d3073c9e76e0487d05e62b337c"/></dir><dir name="etc"><file name="config.xml" hash="23f10c9f0e3b3ee5b7b7b7c0cdc35017"/><file name="system.xml" hash="01be4d19a858321014e682d3174a88c5"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="BT_Faturahpayment.xml" hash="1ec5765386d6761e20015f3d48f8768b"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="faturahpayment.xml" hash="87d833c9aec02dd6986f674879aa1da5"/></dir></dir></dir></dir></target><target name="magelocal"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="faturahpayment"><file name="error.phtml" hash=""/></dir></dir></dir></dir></dir></target></contents>
25
+ <compatible/>
26
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
27
+ </package>