[Sepcay] digest ≠ digest key

早上11點開始處理 Secpay 的 callback 驗證,怎麼試都不行。


我先把產生好的 digest 用 curl 傳送出去,在 sepcay 的刷卡畫面也驗證無誤,但是 Callback 回來的 hash 就是怎麼樣都不 match。

20050927_01.gif
(digiest 的產生方式)

20050927_02.gif
(callback 的驗證方式)

因為 GET URI 的方式比較難釐清問題所在,吃過中餐後再改用自訂 md_flds 方式來驗證,只使用 trans_id + digestkey ,但是結果還是一樣失敗。

過程中我在 Google 找到了 OSC secpay plug-in 的處理方式,雖然是用預設的 GET 處理,但感覺 digistkey 不太像是動態產生的。

剛剛突然靈光一閃,跑去查了 Secpay 的 Technical FAQs,看了第二條:

Q:What is the Secret Key and Confirm Key in Actinic Catalogue?
A:The Secret Key and Confim Key in the payment setup for Actinic Catalogue are referred to as the Message Digest by SECPay. The two values should be set to the same as your message digest key which can be setup in the user login area of the SECPay website. You should click on change remote passwords and setup a new password for the message digest.

digest key 可以自行設定? 我進了 secpay 的後台畫面,因為是測試帳號,所以更改的功能似乎不能用,於是就去看了文件裡除了測試帳號密碼外,還有一個 Digiest Key: secpay ,頓時才恍然大悟。

果然 Digiest Key 並不是動態產生的,而是固定的變數,一測試就成功了。digest 跟 digestkey 二個不同的東西名字取那麼像,文件又沒有註明清楚,算我自己搞烏龍好了,真是白白浪費了一個上午。

Leave a reply:

Your email address will not be published.

Site Footer

Sliding Sidebar