MasterCard支付网关PHP中的状态HTTP状态400

时间:2016-03-21 13:56:35

标签: php

我正在尝试实施万事达卡支付网关服务并且它正在提供HTTP状态400。

我无法获得成功结果。

        $amount=10;
        $SECURE_SECRET =  $signature; //value from migs payment gateway
        $accessCode    =  $accesscode;//value from migs payment gateway
        $merchantId    =  $merchantid;//value from migs payment gateway
        $order="testing";
        $paymentdata = array(
                 "vpc_AccessCode" => $accessCode,
                 "vpc_Amount" => ($amount*100),//our product price , must multipy by 100
                 "vpc_Command" => 'pay',
                 "vpc_Locale" => 'en',
                 "vpc_MerchTxnRef" =>  "ODID".$unique_id,
                 "vpc_Merchant" => $merchantId,
                 "vpc_OrderInfo" => $order,
                 "vpc_ReturnURL" => "https://faspro.net/index.php/",
                 "vpc_Version" => '1'
                           );


        $actionurl ='https://migs.mastercard.com.au/vpcpay?';
        $HashData = $SECURE_SECRET;
        $str = 0;
        $appendAmp = 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);

我在返回网址中尝试了不同的网址,但它提供了HTTP 404状态错误。

0 个答案:

没有答案