# 綠界測試研究 錯誤 405 原因 ###### tags: `火箭` # 綠界返回的時候  405 - HTTP verb used to access this page is not allowed. The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access. ## 解 綠界有幾個設定 要注意   1. ResultURL 是用來接到綠界回傳訊息後 做後續邏輯 像是訂單狀態修改成 已完成 2. OrderResultURL 是 使用者導頁(但這邊綠界是用post方式傳回) 必須要從後端接 發送導頁RedirectPermanent方法 return RedirectPermanent(); 而不是直接導到前端的頁面 3. ClientBackURL 是指返回商店按鈕 當今天有這個參數 而且OrderResultURL為空的時候 當完成訂單就會有 返回按鈕 而不是直接跳轉 這個跳轉 會是返回導向網址 而不是POST ## 所以這邊有兩種做法 1. 一種 OrderResultURL 留空 靠 ClientBackURL 在完成訂單後 並不會自動導頁 他會顯示出一個 訂單成功頁面 附帶一個 返回商店按鈕 這個按鈕是 返回導向網址 而不是POST 3. 另一種是 ClientBackURL 留空 設定 OrderResultURL 但是要多寫一支端去接這個綠界post過來的 再利用return RedirectPermanent(); 導頁 # 資料 1. 測試後台 網址:https://vendor-stage.ecpay.com.tw 特店編號:2000132 廠商管理後台登入帳號:stagetest1234 廠商管理後台登入密碼:test1234 身分證件末四碼/統一編號:53538851 HashKey:5294y06JbISpM5x9 HashIV:v77hoKGq4kWxNNIS 2. 測試信用卡 卡號:4311-9522-2222-2222 安全碼:222 信用卡測試有效月/年:MM/YYYY 值請大於現在當下時間的月/年 # 參考 https://developers.ecpay.com.tw/?p=5631 https://github.com/ECPay/ECPayAIO_Net/tree/master/Sample%20Code/5.1.%E8%A8%82%E5%96%AE%E7%94%A2%E7%94%9F/5.1.%E8%A8%82%E5%96%AE%E7%94%A2%E7%94%9F/AioCheckOut https://weitechshare.blogspot.com/2020/11/ecpay.html
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up