migs(万事达卡虚拟支付客户端)集成php

发布时间:2022-04-30 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了migs(万事达卡虚拟支付客户端)集成php脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
任何机构都可以帮助我了解何在PHP网站中集成migs(MasterCard虚拟支付客户端)!

我已经阅读了参考指南,但它没有用!

//此值提交给MIGS PAYMENT GATEWAY
$SECURE_SECRET =  $signature; //value From migs payment gateway
        $accessCode    =  $accesscode;//value from migs payment gateway
        $merchantId    =  $merchantid;//value from migs payment gateway
        $paymentdata = array(
                 "vpc_AccessCode" => $accessCode,"vpc_Amount" => ($amount*100),//our PRoduct price,must multipy by 100
                 "vpc_Command" => 'pay',"vpc_Locale" => 'en',// order id
                 "vpc_MerchTxnRef" => random_unique_value(like session),"vpc_Merchant" => $merchantId,"vpc_OrderInfo" => "Some Comment","vpc_ReturnURL" => "htps://yoursITe.COM/returnpoint",//here code for db updation,return VARiable here
                 "vpc_Version" => '1'
                           );

        $actionurl = 'https://migs.mastercard.com.au/vpcpay' . "?";
        $HashData = $SECURE_SECRET;
        $str = 0;
        foreach ($paymentdata as $key => $value) {
            // create the md5 input and URL
            if (strlen($value) > 0) {
                // this ensures the First paramter of the URL is preceded by the '?' char
                if ($apPEndAmp == 0) {
                    $actionurl .= urlencode($key) . '=' . urlencode($value);
                    $str = 1;
                } else {
                    $actionurl .= '&' . urlencode($key) . "=" . urlencode($value);
                }
                $HashData .= $value;
            }
        }

        if (strlen($SECURE_SECRET) > 0){$actionurl .= "&vpc_SecureHash=" . strtoupper(md5($HashData));}
        header("Location: " . $actionurl);
    }

/////////////////////返回值/////////////////////////// //////

the return url will be like

https://yoursite.com/returnpoint?vpc_TransactionNo="migs_transaction_number"&vpc_MerchTxnRef="random_unique_value(we post to migs)"&vpc_TxnResponseCode=value&vpc_Message="value"
 if vpc_TxnResponseCode = 0 -- success,vpc_Message = approved -- paymet is success,All other unsuccessfull payment

脚本宝典总结

以上是脚本宝典为你收集整理的migs(万事达卡虚拟支付客户端)集成php全部内容,希望文章能够帮你解决migs(万事达卡虚拟支付客户端)集成php所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。