function withdrawBitcoin() { check_verified(); $_POST['is_international'] = 0; unset($_POST['voucher']); do_withdraw(post('amount'), "BTC", $voucher_code, $reqid); return array("status" => "OK", "reqid" => $reqid); }
function withdrawVoucher() { check_verified(); $_POST['is_international'] = 0; $_POST['voucher'] = 1; do_withdraw(post('amount'), post('currency'), $voucher_code, $reqid); return array("status" => "OK", "voucher" => $voucher_code, "reqid" => $reqid); }
if (!$is_verified) { throw new Error("Not Verified", "Please <a href=\"?page=identity\">identify yourself</a> before initiating any withdrawal."); } if (isset($_POST['amount']) && isset($_POST['curr_type'])) { if (isset($_POST['csrf_token'])) { if ($_SESSION['csrf_token'] != $_POST['csrf_token']) { throw new Error("csrf", "csrf token mismatch!"); } } else { throw new Error("csrf", "csrf token missing"); } } if (isset($_POST['amount']) && isset($_POST['curr_type'])) { $curr_type = post('curr_type'); $amount_disp = post('amount'); do_withdraw($amount_disp, $curr_type, $voucher_code, $reqid); echo "<div class='content_box'>\n"; echo "<h3>" . sprintf(_("Withdraw %s"), $curr_type) . "</h3>\n"; if (isset($_POST['voucher'])) { echo "<p>" . sprintf(_("Your voucher for %s is:"), "{$amount_disp} {$curr_type}") . "</p><p class='voucher'>{$voucher_code}</p>\n"; } else { echo "<p>" . sprintf(_("Your request to withdraw %s has been submitted. Visit your %sprofile%s to check on the status of your request."), "{$amount_disp} {$curr_type}", "<a href='?page=profile'>", "</a>") . "</p>\n"; } echo "</div>\n"; } else { ?> <div class='content_box'> <h3><?php printf(_("Withdraw %s"), CURRENCY); ?> </h3>