migs (MasterCard Virtual Payment Client) integration php

后端 未结 4 1080
既然无缘
既然无缘 2021-02-06 05:31

Can any body help me about how to integrate migs (MasterCard Virtual Payment Client) in a php website !

I have read the reference guide but it\

4条回答
  •  半阙折子戏
    2021-02-06 05:57

    implementing migs payment gateway in which we need to post some details to the https://migs.mastercard.com.au/vpcpay? this url with the below datas

        /*"vpc_AccessCode" the accesscode given by Migs
    "vpc_Amount" Amount that is multiplied by 100
    "vpc_Command" ='pay',default pay
    "vpc_Locale" = 'en' // language
    "vpc_MerchTxnRef"  orderId // Should be Unique for each payment
    "vpc_Merchant"  // merchant ID
    "vpc_OrderInfo"  // Desc or and details of Product
    "vpc_ReturnURL" // SuccessUrl
    "vpc_Version" = '1'
    &vpc_SecureHash = // create MD5 of all the values that are passed  */
    

    Creating Url

        $SECURE_SECRET = "YEOCOEN29B0785F1FF1E3C0FA8A3FUJK";  
            $accessCode = '546484645';
            $merchantId = '5465465288';
            if($migs_testmode ==1) {
                $SECURE_SECRET = "YEOCOEN29B0785F1FF1E3C0FA8A3FUJK";
                $accessCode = '98989645';
                $merchantId = '56456456489';
            }
         $amount ='10.00';
        $unique_id = rand(999999,8988888888);//this is a sample random no
            $postdata = array(
                    "vpc_AccessCode" => $accessCode,
                    "vpc_Amount" => ($amount*100),
                    "vpc_Command" => 'pay',
                    "vpc_Locale" => 'en',
                    "vpc_MerchTxnRef" => $unique_id,
                    "vpc_Merchant" => $merchantId,
                    "vpc_OrderInfo" => 'this is a product',
                    "vpc_ReturnURL" => "https://mywebsite.com/success.php",
                    "vpc_Version" => '1');
    
    
            $vpcURL = 'https://migs.mastercard.com.au/vpcpay?';
            $md5Hash = $SECURE_SECRET;
            $appendAmp = 0;
    
    
            foreach ($wpay_postdata as $key => $value) {
    
                if (strlen($value) > 0) {
    
                    if ($appendAmp == 0) {
                        $vpcURL .= urlencode($key) . '=' . urlencode($value);
                        $appendAmp = 1;
                    } else {
                        $vpcURL .= '&' . urlencode($key) . "=" . urlencode($value);
                    }
                    $md5Hash .= $value;
                }
            }
    
            if (strlen($SECURE_SECRET) > 0) {
                $vpcURL .= "&vpc_SecureHash=" . strtoupper(md5($md5Hash));
            }
            header("Location: " . $vpcURL)
    

    for detailed result is available here

提交回复
热议问题