【问题标题】:The order could not be processed with the reference code [xxx], PayU Laravel使用参考代码 [xxx] PayU Laravel 无法处理订单
【发布时间】:2020-10-30 14:45:08
【问题描述】:

我正在尝试为 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="test@test.com">
  <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'));
}

【问题讨论】:

    标签: php html laravel payu


    【解决方案1】:

    问题确实来自您创建签名的方式

    当您将md5($apy_key."~"."508029"."~".$plans-&gt;id."~".$plans-&gt;price."~"."COP") 放入"" 时,它被视为一个字符串,您应该用{{ }} 包装md5。

    请尝试在控制器中创建签名并将其作为值传递给视图,在视图中处理任何逻辑都不是最佳实践。

    【讨论】:

      猜你喜欢
      • 2015-04-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-10
      • 1970-01-01
      • 1970-01-01
      • 2022-01-26
      相关资源
      最近更新 更多