我正在尝试使付款链接正常工作,但是无论我尝试做什么都会破坏页面(白屏)或使我进入 XML 页面。
由于我不完全理解代码,这是我得到的解释:
请求代码:
$ curl -X GET "https://www.mollie.com/xml/ideal?a=create-link&partnerid=[partnerid]&amount=[amount]&description=[omschrijving]&profile_key=[profiel key]"
响应代码:
HTTP/1.1 200 OK
<?xml version="1.0" ?>
<response>
<link>
<URL>https://www.mollie.com/pay/ideal/000000/200_Testorder_15/43bd941819a5f5db83adf97d08da508805bce051</URL>
<message>Your iDEAL-link has been successfully setup. Your customer should visit the given URL to make the payment.</message>
</link>
</response>
我当前的代码:
如果我将下面的请求代码放在页面顶部,页面会立即中断。这个想法是代码应该在第 16 行从 xml 返回内容,而不是链接到 xml。我没有在描述中添加 iid 权利还是我做错了什么?
<?php
$iid = $_POST['infinid'];
$email = $_POST['email'];
$orderid = $date . '-' . $id;
if(isset($_POST['name'])){
echo "<table><tr><td>Name</td><td>";
echo $_POST['name'];
echo "</td></tr><tr><td>InfinTV ID</td><td>";
echo $_POST['infinid'];
echo "</td></tr><tr><td>Email adres</td><td>";
echo $_POST['email'];
echo "</td></tr><tr><td colspan=\"2\">If the information above is correct, please proceed to payment</td></tr><tr><td colspan=\"2\">";
echo "<a href=\"";
echo "https://www.mollie.com/xml/ideal?a=create-link&partnerid=2006811&amount=1000&description=" . $iid . "&profile_key=3721B6A4";
echo "\">Pay Now</a>";
echo "</td></tr></table>";
}
else{
echo '<form method="post" action="">
<table>
<tr><td colspan="2">Please fill in the form below to renew your subscription</td></tr>
<tr><td>Name</td><td><input type="text" name="name" /></td></tr>
<tr><td>InfinTV ID</td><td><input type="text" name="infinid" /></td></tr>
<tr><td>Email</td><td><input type="text" name="email" /></td></tr>
<tr><td colspan="2"><input type="submit" value="Proceed to checkout" /></td></tr>
</table>
';
}
?>