2)
$amount_fraction = (double) ("0." . $amount_chunks[1]);
$amount_fraction = $amount_fraction * 1000000;
// pack the JSON
$json = json_encode (array ('reserve_pub' => $reserve_pk,
'execution_date' => "/Date(" . time() . ")/",
'wire' => array ('type' => 'test'),
'amount' => array ('value' => intval($amount_chunks[0]),
'fraction' => $amount_fraction,
'currency' => $amount_chunks[count($amount_chunks) - 1])));
// craft the HTTP request
$req = new http\Client\Request ("POST",
"http://" . $mint . "/admin/add/incoming",
array ("Content-Type" => "application/json"));
$req->getBody()->append ($json);
// execute HTTP request
$client = new http\Client;
$client->enqueue($req)->send ();
$resp = $client->getResponse ();
// evaluate response
$status_code = $resp->getResponseCode ();
http_response_code ($status_code);
if ($status_code != 200)
{
echo "Error $status_code when faking the wire transfer. Please report to taler@gnu.org";
}
else
{
echo "Pretend wire transfer successful. Exit through the gift shop and enjoy shopping!";
}
?>