3

I need a MasterCard internet Gateway Service (MiGS) & Virtual Payment Client (VPC) Extension for magento 1.9.2.4. Its needed for Bank to Magento integration you can suggest any good extension please.

Thank you

0

MiGS Payment Gateway For Magento 1.9

You can Download Thinkhigh_VPCpaymentgateway Extension to integrate MasterCard internet Gateway Service (MiGS) with magento 1.9.2.4.

MiGS uses MD5 hash as default and now it converted to SHA256. So you have to made some changes in Coding also

  • open the file C:YOURPROJECT\app\design\frontend\default\default\template\vpcpaymentgateway\redirect.phtml
  • Replace the code with below code
 $RedirectUrl=Mage::helper('vpcpaymentgateway')->getRedirectUrl();
if($RedirectUrl){

   $post_data=Mage::getModel('vpcpaymentgateway/paymentconnection')->getPostData();

    $secretHash=Mage::helper('vpcpaymentgateway')->getSecureHash();

    $data = array(
        "vpc_AccessCode" => $post_data['vpc_AccessCode'],
        "vpc_Amount" => $post_data['vpc_Amount'],
        "vpc_Command" => $post_data['vpc_Command'],
        "vpc_Currency" => $post_data['vpc_Currency'],
        "vpc_Gateway" => $post_data['vpc_Gateway'],
        "vpc_Locale" => $post_data['vpc_Locale'],
        "vpc_MerchTxnRef" =>  $post_data['vpc_MerchTxnRef'],
        "vpc_Merchant" => $post_data['vpc_Merchant'],
        "vpc_OrderInfo" => $post_data['vpc_OrderInfo'],
        "vpc_ReturnAuthResponseData" => $post_data['vpc_ReturnAuthResponseData'],
        "vpc_ReturnURL" => $post_data['vpc_ReturnURL'],
        "vpc_SecureHashType" => 'SHA256',
        "vpc_Version" => $post_data['vpc_Version'],

    );



    ksort($data);
    $hash = null;
    foreach ($data as $k => $v) {
        if (in_array($k, array('vpc_SecureHash', 'vpc_SecureHashType'))) {
            continue;
        }
        if ((strlen($v) > 0) && ((substr($k, 0, 4)=="vpc_") || (substr($k, 0, 5) =="user_"))) {
            $hash .= $k . "=" . $v . "&";
        }
    }
    $hash = rtrim($hash, "&");

    $secureHash = strtoupper(hash_hmac('SHA256', $hash, pack('H*', $secretHash)));
    $paraFinale = array_merge($data, array('vpc_SecureHash' => $secureHash));
     ksort($paraFinale);

    $actionurl = 'https://migs.mastercard.com.au/vpcpay?'.http_build_query($paraFinale);


    header("Location:".$actionurl);
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.