本文整理匯總了PHP中client::addbank方法的典型用法代碼示例。如果您正苦於以下問題:PHP client::addbank方法的具體用法?PHP client::addbank怎麽用?PHP client::addbank使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類client
的用法示例。
在下文中一共展示了client::addbank方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: serverproxy
$server = new serverproxy($url);
echo $server->process("hello") . "\n";
return;
*/
$passphrase3 = "a really lousy passphrase";
$err = $client->newuser($passphrase3, 512);
if ($err) {
echo "{$err}\n";
}
$err = $client->login($passphrase3);
if ($err) {
die("Login feailed for user3. Dying: {$err}\n");
}
$id3 = $client->id;
echo "id: {$id3}\n";
$err = $client->addbank($url);
if ($err) {
echo "Addbank failed for user 3. {$err}\n";
} else {
echo "User 3 bankid: " . $client->bankid . "\n";
//echo "server:"; print_r($client->server);
}
$banks = $client->getbanks(true);
if (is_string($banks)) {
echo "getbanks error: {$banks}\n";
}
//print_r($banks);
// This fails because the customer has no tokens.
$err = $client->register('John Doe');
if ($err) {
echo "Registration failed for user 3. {$err}\n";
示例2: doit
//.........這裏部分代碼省略.........
if (!$server) {
$server = new server($db, $ssl, false, $bank_name, $bankurl);
}
$t = $server->t;
$bankid = $server->bankid();
$tokenid = $server->tokenid;
if (file_exists('client/settings.php')) {
require_once "client/settings.php";
}
$dbdir = "client/{$dbdir}";
$template_file = "client/{$template_file}";
$error = die_unless_client_properly_configured(true);
if (!$error) {
require_once "lib/client.php";
$clientdb = new fsdb("{$dbdir}");
$client = new client($clientdb, $ssl);
if ($enabledebug) {
$client->showprocess = 'appenddebug';
}
$hash = $client->passphrasehash($passphrase);
if (!$clientdb->get("privkey/{$hash}")) {
// Create the new account
$error = $client->newuser($passphrase);
} else {
$error = $client->login($passphrase);
}
if (!$error) {
$id = $client->id;
if ($clientdb->get("account/{$id}/bank/{$bankid}/req")) {
$error = 'Account already exists for that passphrase. ' . 'Use the <a href="client/">client interface</a> to administer.';
} else {
$error = $client->login($bankpass);
if (!$error) {
$error = $client->addbank($bankurl);
}
if (!$error) {
$error = $client->setbank($bankid);
}
if (!$error) {
$error = $client->spend($id, $tokenid, "10000");
}
if ($error) {
$error = "While spending tokens from bank: {$error}";
}
}
if (!$error) {
$error = $client->login($passphrase);
if (!$error) {
$error = $client->addbank($bankurl, $name);
}
if (!$error) {
?>
<p>Your bank is now ready for business. You may now login as administrator in the
<a href="client/">Client interface</a>, accept your initial tokens from
the bank, and start inviting customers.</p>
<?php
return;
}
}
}
}
}
}
if (!$error) {
$error = " ";
}