在payU的示例代码中;
<form action="<%= action1 %>" method="post" name="payuForm">
<input type="hidden" name="key" value="<%= merchant_key %>" />
<input type="hidden" name="hash" value="<%= hash %>"/>
<input type="hidden" name="txnid" value="<%= txnid %>" />
<table>
<tr>
<td><b>Mandatory Parameters</b></td>
</tr>
<tr>
<td>Amount: </td>
<td><input name="amount" value="<%= (empty(params.get("amount"))) ? "" : params.get("amount") %>" /></td>
<td>First Name: </td>
<td><input name="firstname" id="firstname" value="<%= (empty(params.get("firstname"))) ? "" : params.get("firstname") %>" /></td>
</tr>
<tr>
<td>Email: </td>
<td><input name="email" id="email" value="<%= (empty(params.get("email"))) ? "" : params.get("email") %>" /></td>
<td>Phone: </td>
<td><input name="phone" value="<%= (empty(params.get("phone"))) ? "" : params.get("phone") %>" /></td>
</tr>
<tr>
<td>Product Info: </td>
<td colspan="3"><input name="productinfo" value="<%= (empty(params.get("productinfo"))) ? "" : params.get("productinfo") %>" size="64" /></td>
</tr>
<tr>
<td>Success URI: </td>
<td colspan="3"><input name="surl" value="<%= (empty(params.get("surl"))) ? "" : params.get("surl") %>" size="64" /></td>
</tr>
<tr>
<td>Failure URI: </td>
<td colspan="3"><input name="furl" value="<%= (empty(params.get("furl"))) ? "" : params.get("furl") %>" size="64" /></td>
</tr>
<tr>
<td><b>Optional Parameters</b></td>
</tr>
<tr>
<td>Last Name: </td>
<td><input name="lastname" id="lastname" value="<%= (empty(params.get("lastname"))) ? "" : params.get("lastname") %>" /></td>
<td>Cancel URI: </td>
<td><input name="curl" value="" /></td>
</tr>
<tr>
<td>Address1: </td>
<td><input name="address1" value="<%= (empty(params.get("address1"))) ? "" : params.get("address1") %>" /></td>
<td>Address2: </td>
<td><input name="address2" value="<%= (empty(params.get("address2"))) ? "" : params.get("address2") %>" /></td>
</tr>
<tr>
<td>City: </td>
<td><input name="city" value="<%= (empty(params.get("city"))) ? "" : params.get("city") %>" /></td>
<td>State: </td>
<td><input name="state" value="<%= (empty(params.get("state"))) ? "" : params.get("state") %>" /></td>
</tr>
<tr>
<td>Country: </td>
<td><input name="country" value="<%= (empty(params.get("country"))) ? "" : params.get("country") %>" /></td>
<td>Zipcode: </td>
<td><input name="zipcode" value="<%= (empty(params.get("zipcode"))) ? "" : params.get("zipcode") %>" /></td>
</tr>
<tr>
<td>UDF1: </td>
<td><input name="udf1" value="<%= (empty(params.get("udf1"))) ? "" : params.get("udf1") %>" /></td>
<td>UDF2: </td>
<td><input name="udf2" value="<%= (empty(params.get("udf2"))) ? "" : params.get("udf2") %>" /></td>
</tr>
<tr>
<td>UDF3: </td>
<td><input name="udf3" value="<%= (empty(params.get("udf3"))) ? "" : params.get("udf3") %>" /></td>
<td>UDF4: </td>
<td><input name="udf4" value="<%= (empty(params.get("udf4"))) ? "" : params.get("udf4") %>" /></td>
</tr>
<tr>
<td>UDF5: </td>
<td><input name="udf5" value="<%= (empty(params.get("udf5"))) ? "" : params.get("udf5") %>" /></td>
<td>PG: </td>
<td><input name="pg" value="<%= (empty(params.get("pg"))) ? "" : params.get("pg") %>" /></td>
</tr>
<tr>
<% if(empty(hash)){ %>
<td colspan="4"><input type="submit" value="Submit" /></td>
<% } %>
</tr>
</table>
</form>
“产品信息”字段看起来像;
<tr>
<td>Product Info: </td>
<td colspan="3"><input name="productinfo" value="<%= (empty(params.get("productinfo"))) ? "" : params.get("productinfo") %>" size="64" /></td>
</tr>
但在“PayUMoney 集成文档”中,“产品信息”描述为;
产品信息:它是一个 json 编码的各种支付部分的数组,每个部分包含“名称”、“描述”、“值”和“isRequired”字段。JSON(JavaScript Object Notation)是一种轻量级的数据交换格式。人类很容易阅读和写作。机器很容易解析和生成。
现在我很困惑,在形式上,我该如何提交一个 json 文件。如果我提交类似的表格;
payU 向我返回错误;