ReturnURL 出現CheckMacValue verify fail. - 金流服務 - 歐付寶討論版

歐付寶討論版

查詢
查看: 3547|回覆: 2
打印 上一主題 下一主題

ReturnURL 出現CheckMacValue verify fail.

[複製連結]
1153280
發表於 2017-6-2 10:24:52 | 顯示全部樓層 回帖獎勵 |倒序瀏覽 |閱讀模式
測試環境底下正常,但正式環境就會出現CheckMacValue verify fail.

以下是直接從網站使用的php 程式,有甚麼問題嗎?

include_once "include/AllPay.Payment.Integration.php";


/*
* 接收訂單資料產生完成的範例程式碼。
*/
try
{
    $oPayment = new AllInOne();
    /* 服務參數 */
    $oPayment->HashKey     = ''xxxxxxxxxxxxxxxx ;        //測試用Hashkey,請自行帶入AllPay提供的HashKey
    $oPayment->HashIV      = 'xxxxxxxxxxxxxxx' ;        //測試用HashIV,請自行帶入AllPay提供的HashIV
    $oPayment->MerchantID  = 'xxxxxxxx';                  //測試用MerchantID,請自行帶入AllPay提供的MerchantID

    /* 取得回傳參數 */
    $arFeedback = $oPayment->CheckOutFeedback();
    /* 檢核與變更訂單狀態 */
    if (sizeof($arFeedback) > 0) {
        // 正常訂單處理程式
        ...
        print '1|OK';

    } else {
        print '0|Fail';
        fputs($fp_local,'0|Fail\n');
    }
}
catch (Exception $e)
{
    // 例外錯誤處理。
    print '0|' . $e->getMessage();
    fputs($fp_local, $e->getMessage() . "\n");
}


----------------------------------------------------
還有一個問題,如何從POST 資料去產生CheckMacValue
有php 可以直接套用嗎?

1153280
 樓主| 發表於 2017-6-2 11:55:51 | 顯示全部樓層
為何SDK 產生的檢查會錯呢?
完全依照下列文件第23頁寫法
https://www.allpay.com.tw/Content/files/allpay_047.pdf

GMT+8, 2024-5-2 17:59 , Processed in 0.106000 second(s), 21 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回覆 返回頂部 返回列表