Magento 1.8 & 1.9 Othman Hussein info@myfatoorah.com 1
Table of Contents: Installation Steps.....3 Merchant Configuration Details.....6 Payment Request.7 Test Card Details.10 Live URL.10 2
Installation steps: Please follow the below mentioned steps for installing Magento plugin 1) Extract MindPlugged.zip file into app\code\local 2) Extract myfatoorahgateway.zip file into app\design\frontend\{theme}\default\template\ 3) For Admin Transaction Details app\design\adminhtml\default\default\template\sales\order\view\items.phtml Put below mentioned code at the end of the file code. <?php //MyFatoorah Transaction Details Block Start $Paymode = ''; $transactiondetailsarray = array(); $order = Mage::getModel("sales/order")->load($this- >getrequest()->getparam('order_id')); $transactiondetails = $order->getpayment()->getadditionalinformation(); foreach ($transactiondetails as $transactiondetailskey => $transactiondetailsvalue) { $transactiondetailsarray = json_decode($transactiondetailskey); } $Paymode = strtoupper($transactiondetailsarray->paymode); $payment_method = $order->getpayment()->getmethodinstance()->getcode(); if($payment_method=='myfatoorahgateway') { $transactionid = $order->getpayment()->getlasttransid();?> <div class="box-left"> <!--Payment Method--> <div class="entry-edit"> <div class="entry-edit-head"> <h4 class="icon-head head-payment-method"><?php echo Mage::getStoreConfig('payment/myfatoorahgateway/title');?> Information</h4> </div> <fieldset> MyFatoorah Transaction Id : <?php echo ($transactionid? $transactionid : 'N.A') ;?><br/> Paymode : <?php echo ($Paymode? $Paymode : 'N.A');?> <div></div> </fieldset> </div> </div> <br/> <?php } //MyFatoorah Transaction Details Block End?> 3
4) For Separate Payment Tabs app\design\frontend\{theme}\default\template\checkout\onepage\payment\methods.phtml Below The Below Code : <?php else: foreach ($methods as $_method): $_code = $_method->getcode();?> Above The Below Code : <dt id="dt_method_<?php echo $_code?>"> Put the below mentioned code <?php $paymentmode = Mage::getStoreConfig('payment/myfatoorahgateway/payment_mode'); if($_code=='myfatoorahgateway' && strtoupper($paymentmode)!='both'): $modesarray = array(); if(strtoupper($paymentmode)=='separate') { $modesarray = array( 'KNET'=>'_knet', 'VISA'=>'_visa'); } else { $modesarray = array( $paymentmode=>'_'.strtolower($paymentmode) ); } $_current_mode = $_code; foreach ($modesarray as $_keymodes => $_modes): $_code = $_current_mode.$_modes;?> <dt id="dt_method_<?php echo $_code?>"> <?php if(!$onemethod):?> <input id="p_method_<?php echo $_code?>" value="<?php echo $_current_mode?>" type="radio" name="payment[method]" title="<?php echo $this- >escapehtml($_method->gettitle())?>" onclick="payment.switchmethod('<?php echo $_code?>')"<?php if($this->getselectedmethodcode()==$_code):?> checked="checked"<?php endif;?> class="radio switchmode" /> <?php else:?> <span class="no-display"><input id="p_method_<?php echo $_code?>" value="<?php echo $_code?>" type="radio" name="payment[method]" checked="checked" class="radio" /></span> <?php $onemethod = $_code;?> <?php endif;?> <label for="p_method_<?php echo $_code?>"><?php echo $this- >escapehtml($this->getmethodtitle($_method)).ucfirst(' '.$_keymodes)?></label> </dt> <?php endforeach;?> <?php else:?> On the same file put the below mentioned code at the END OF FILE <script type="text/javascript"> //<![CDATA[ 4
var $j = jquery.noconflict(); Mage.Cookies.set('switchMode', ''); $j(function() { $j(".switchmode").click(function() { var valattr = $j(".switchmode").attr("value"); var forknet = "p_method_"+valattr+"_knet"; var forvisa = "p_method_"+valattr+"_visa"; var isknetchecked = $j('#' + forknet).is(":checked"); var isvisachecked = $j('#' + forvisa).is(":checked"); if(isknetchecked) { var urlstorecode = window.location.pathname.replace(/^\/+ \/+$/g,"").split('/')[0]; if(urlstorecode!= "") Mage.Cookies.set('switchMode', 'KNET'); } if(isvisachecked) { var urlstorecode = window.location.pathname.replace(/^\/+ \/+$/g,"").split('/')[0]; if(urlstorecode!= "") Mage.Cookies.set('switchMode', 'VISA'); } }); }); //]]> </script> 5 ) Create folder /app/etc/modules Copy MindPlugged_All.xml file into it 5
Merchant Configuration details: In Magento Admin Panel fill Merchant Configuration Details provided by MyFatoorah to be added. Merchant Code: 999999 User Name: testapi@myfatoorah.com Password: E55D0 Payment Gateway URL: https://test.myfatoorah.com/pg/paygatewayservicev2.asmx Payment Mode: Select One 1. Knet 2. Visa / Debit Card 3. Myfatoorah Both 4. Separate Knet & Visa 6
PaymentRequest: Step: 1 Select Item from category and Add to cart. Note: Click on update to get the subtotal. Click on Proceed to Checkout Step: 2 Fill the Billing Information as follows. Billing Information Parameter: Customer Information First Name - Customer First Name (Required) Middle Name/Initial - Customer Middle Name (Optional) Last Name - Customer Last Name (Required) Company - Customer Company (Optional) Address - Customer Address (Required) Street Address 2 - Customer Street Address 2 (Optional) City - Customer City Name (Required) State/Province - State Name (Optional) Zip/Postal Code - Zip Code (Required) Country - Customer Country Name (Required) Telephone - Customer Telephone Number (Required) Fax - Fax Number (Optional) There will be 2 options Ship to this address (If Customer selects this the information provided in the billing information will be used.) Ship to different address (If the Customer selects this he needs to fill the customer information for the order shipment in Shipping Information Form.) 7
Step: 3 Click on Continue. It will move to shipping method that will show rates. Click on Continue Step: 4 Payment Information Select MyFatoorah Gateway. Click on Continue Step: 5 Order Review. Review your order if you have forgot any item you can edit your cart. Click on Place Order Step: 6 You will be taken to MyFatoorah Payment Link. 8
9
Test Card Details: KNET Test Cards 8888880000000001 (any Pin /Expiry) Captured 8888880000000002 (any Pin /Expiry) Not Captured MasterCard Test Cards Card Number Expiry Date CVV 5123456789012346 05/17 123 5313581000123430 05/17 123 Visa Test Cards Card Number Expiry Date CVV 4005550000000001 05/17 123 4557012345678902 05/17 123 Note: For visa test the amount should as per the below given scenarios. Live URL: Once completed with the test, merchant can go live using the url given below and the live credentials provided by MyFatoorah. https://www.myfatoorah.com/pg/paygatewayservicev2.asmx 10