本文整理汇总了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 = " ";
}