I'm trying to get a payment link to work, but whatever I try to do either breaks the page (white screen) or lands me at an XML page.
Since I'm not fully understand the code, this is the explanation that I got with it:
Request code:
$ curl -X GET "https://www.mollie.com/xml/ideal?a=create-link&partnerid=[partnerid]&amount=[amount]&description=[omschrijving]&profile_key=[profiel key]"
Response code:
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>
My current code:
If I put the request code like below on top of the page, the page breaks instantly. The idea is that the code should return the content from the xml on line 16 and not link to the xml. Am i not adding iid right to the description or am I doing something else wrong?
<?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>
';
}
?>