加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

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

发布时间:2020-12-13 14:05:05 所属栏目:PHP教程 来源:网络整理
导读:任何机构都可以帮助我了解如何在php网站中集成migs(MasterCard虚拟支付客户端)! 我已经阅读了参考指南,但它没有用! //此值提交给MIGS PAYMENT GATEWAY $SECURE_SECRET = $signature; //value from migs payment gateway $accessCode = $accesscode;//value
任何机构都可以帮助我了解如何在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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读