我正在嘗試獲取 payu webcheckout 實現的簽名我認為錯誤出現在簽名字段中,我在控制器中定義了 api 密鑰<form method="post" action="https://sandbox.checkout.payulatam.com/ppp-web-gateway-payu/"> <input name="merchantId" type="text" value="508029"> <input name="accountId" type="text" value="512321"> <input name="description" type="text" value="{{ $plans->description }}"> <input name="referenceCode" type="text" value="{{ $plans->id }}"> <input name="amount" type="text" value="{{ $plans->price }}"> <input name="tax" type="text" value="0"> <input name="taxReturnBase" type="text" value="0"> <input name="currency" type="text" value="COP"> <input name="signature" type="text" value="md5($apy_key." ~ "."508029 "."~ ".$plans->id."~ ".$plans->price."~ "."COP ")"> <input name="test" type="text" value="1"> <input name="buyerEmail" type="text" value="[email protected]"> <input name="responseUrl" type="text" value="https://poligonourbano.soluttolabs.com/"> <input name="confirmationUrl" type="text" value="http:// www.test.com/confirmation"> <input name="Submit" type="submit" value="Enviar"></form>控制器功能:public function planView() { $apy_key = "4Vj8eK4rloUd272L48hsrarnUA"; $plans = Plan::findOrFail(2); return view('plans', compact('plans', 'apy_key'));}
1 回答

蝴蝶刀刀
TA貢獻1801條經驗 獲得超8個贊
問題確實出在您創建簽名的方式上
當你放入md5($apy_key."~"."508029"."~".$plans->id."~".$plans->price."~"."COP")
它時""
,它被視為一個字符串,你應該用 包裹 md5 {{ }}
。
請嘗試在控制器中創建簽名并將其作為值傳遞給視圖,在視圖中處理任何邏輯不是最佳實踐。
- 1 回答
- 0 關注
- 137 瀏覽
添加回答
舉報
0/150
提交
取消