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

(万事达卡虚拟支付客户端)migs集成php,php,payment-gateway,Php,Payment Gateway,我试图从Axis银行实现migs网关以接受在线支付,但我在与PHP网站集成时面临问题 我在Google上阅读了很多教程,最终找到了一个解决方案,它至少可以让我进入Master Card页面,但我在MIGS gateway的登录页面时出错。下图中的错误: 使用的migs积分是 $SECURE_SECRET = "****************"; //value from migs payment gateway $accessCode = "********";//valu

我试图从Axis银行实现migs网关以接受在线支付,但我在与PHP网站集成时面临问题

我在Google上阅读了很多教程,最终找到了一个解决方案,它至少可以让我进入Master Card页面,但我在MIGS gateway的
登录
页面时出错。下图中的错误:

使用的migs积分是

$SECURE_SECRET =  "****************"; //value from migs payment gateway
    $accessCode    =  "********";//value from migs payment gateway
    $merchantId    =  "********";//value from migs payment gateway
    $unique_id = rand(8888888,999999);
    $paymentdata = array(
             "vpc_AccessCode" => $accessCode,
             "vpc_Amount" => ("100"),
             "vpc_Command" => 'pay',
             "vpc_Locale" => 'en',
             "vpc_MerchTxnRef" =>  "ODID".$unique_id,
             "vpc_Merchant" => $merchantId,
             "vpc_OrderInfo" => "Some Comment",
             "vpc_ReturnURL" => "htps://localhost/test/success.php",
             "vpc_Version" => '1'
                       );
    ksort($paymentdata);
    $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) {
            if ($str == 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);
    echo $actionurl;

看起来支付网关正在检查您提交的返回url的有效性

  "vpc_ReturnURL" => "htps://localhost/test/success.php"

如果您提供了有效的、可公开访问的URL,则应解决此错误。

尝试对数组排序
$paymentdata
(按$keys升序)。然后传递此排序数组以创建哈希。请记住,vpc_MerchTxnRef
是唯一的


除此之外,您的代码似乎还可以。

尝试删除
urlencode()


当我试图升级到
SHA256
时,
urlencode()
确实导致了400错误。

@akhillaj N S。。你能告诉我原因吗?我已经按照你的回答在这里
http://stackoverflow.com/questions/8033497/migs-mastercard-virtual-payment-client-integration-php
它是否在@gags处解析?它显然是一个有效的URL。。。localhost如何成为无效的URL,即使它在上不存在Internet@Gags-
htps
不是有效的协议。哎呀!!是打字错误。。我的坏:)当我更改为http时,我得到了http状态-400:(
if ($str == 0) {
    $actionurl .= $key . '=' . $value;
    $str = 1;
 } else {
    $actionurl .= '&' . $key . "=" . $value;
 }