Location: PHPKode > scripts > e-Gold > e-gold/docs/e-gold/egold.html
<html>
<head>
<title>Docs For Class egold</title>
<link rel="stylesheet" type="text/css" href="../media/style.css">
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
    <td class="header_top">e-gold</td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td class="header_menu">
        
                                    
                              		  [ <a href="../classtrees_e-gold.html" class="menu">class tree: e-gold</a> ]
		  [ <a href="../elementindex_e-gold.html" class="menu">index: e-gold</a> ]
		  	    [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="200" class="menu">
      <b>Packages:</b><br />
              <a href="../li_e-gold.html">e-gold</a><br />
            <br /><br />
                        <b>Files:</b><br />
      	  <div class="package">
			<a href="../e-gold/_e-gold.class.php.html">		e-gold.class.php
		</a><br>
	  </div><br />

      
      
            <b>Classes:</b><br />
        <div class="package">
		    		<a href="../e-gold/egold.html">egold</a><br />
	  </div>

                </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1>Class: egold</h1>
Source Location: /e-gold.class.php<br /><br />


<table width="100%" border="0">
<tr><td valign="top">

<h3><a href="#class_details">Class Overview</a></h3>
<pre></pre><br />
<div class="description">Class to manage e-Gold Account</div><br /><br />
<h4>Author(s):</h4>
<ul>
          <li>Pawel Banasiak &lt;<a href="mailto:hide@address.com">hide@address.com</a>&gt;</li>
                        </ul>




        
          
      
<h4>Version:</h4>
<ul>
  <li>1.0.0</li>
</ul>

<h4>Copyright:</h4>
<ul>
  <li>Pawel Banasiak 2007</li>
</ul>
        
</td>

<td valign="top">
<h3><a href="#class_vars">Variables</a></h3>
<ul>
    <li><a href="../e-gold/egold.html#var$connection_timeout">$connection_timeout</a></li>
    <li><a href="../e-gold/egold.html#var$connection_type">$connection_type</a></li>
  </ul>
</td>


<td valign="top">
<h3><a href="#class_methods">Methods</a></h3>
<ul>
    <li><a href="../e-gold/egold.html#methodbalance">balance</a></li>
    <li><a href="../e-gold/egold.html#methodhistory">history</a></li>
    <li><a href="../e-gold/egold.html#methodmetaldata">metaldata</a></li>
    <li><a href="../e-gold/egold.html#methodsci">sci</a></li>
    <li><a href="../e-gold/egold.html#methodspend">spend</a></li>
    <li><a href="../e-gold/egold.html#methodverify">verify</a></li>
  </ul>
</td>

</tr></table>
<hr />

<table width="100%" border="0"><tr>






</tr></table>
<hr />

<a name="class_details"></a>
<h3>Class Details</h3>
<div class="tags">
[line <a href="../__filesource/fsource_e-gold__e-gold.class.php.html#a20">20</a>]<br />
Class to manage e-Gold Account<br /><br /><p>Author: Pawel Banasiak <a href="http://banasiak.net">http://banasiak.net</a></p><p>Thanks to wlk (<a href="http://krzeslo.net">http://krzeslo.net</a>)</p><p>YOU USE THIS SCRIPT AT YOUR OWN RESPONSIBILITY AND AT YOUR OWN RISK</p><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>author:</b>&nbsp;&nbsp;</td><td>Pawel Banasiak &lt;<a href="mailto:hide@address.com">hide@address.com</a>&gt;</td>
  </tr>
  <tr>
    <td><b>version:</b>&nbsp;&nbsp;</td><td>1.0.0</td>
  </tr>
  <tr>
    <td><b>copyright:</b>&nbsp;&nbsp;</td><td>Pawel Banasiak 2007</td>
  </tr>
  <tr>
    <td><b>license:</b>&nbsp;&nbsp;</td><td>BSD</td>
  </tr>
</table>
</div>
</div><br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div><br />

<hr />
<a name="class_vars"></a>
<h3>Class Variables</h3>
<div class="tags">
	<a name="var$connection_timeout"></a>
	<p></p>
	<h4>static $connection_timeout = <span class="value">&nbsp;15</span></h4>
	<p>[line <a href="../__filesource/fsource_e-gold__e-gold.class.php.html#a24">24</a>]</p>
  <br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>var:</b>&nbsp;&nbsp;</td><td>Connection timeout</td>
  </tr>
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>

  <br />
	<div class="tags">
  <table border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><b>Type:</b>&nbsp;&nbsp;</td>
      <td>int</td>
    </tr>
      </table>
	</div><br /><br />
	<div class="top">[ <a href="#top">Top</a> ]</div><br />
	<a name="var$connection_type"></a>
	<p></p>
	<h4>static $connection_type = <span class="value">&nbsp;'curl'</span></h4>
	<p>[line <a href="../__filesource/fsource_e-gold__e-gold.class.php.html#a28">28</a>]</p>
  <br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>var:</b>&nbsp;&nbsp;</td><td>Connection type - 'curl' or 'fsockopen' (fsockopen is not safety!)</td>
  </tr>
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>

  <br />
	<div class="tags">
  <table border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><b>Type:</b>&nbsp;&nbsp;</td>
      <td>string</td>
    </tr>
      </table>
	</div><br /><br />
	<div class="top">[ <a href="#top">Top</a> ]</div><br />
</div><br />

<hr />
<a name="class_methods"></a>
<h3>Class Methods</h3>
<div class="tags">
  <hr />
	<a name="methodbalance"></a>
	<h3>static method balance <span class="smalllinenumber">[line <a href="../__filesource/fsource_e-gold__e-gold.class.php.html#a148">148</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>static int|array balance(
int
$account, string
$password, [string
$cur = 'USD'])</code>
    </td></tr></table>
    </td></tr></table><br />
	
		Shows current account balance<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td>Returns negative on error or array on success</td>
  </tr>
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>
<br /><br />

	
        <h4>Parameters:</h4>
    <div class="tags">
    <table border="0" cellspacing="0" cellpadding="0">
          <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$account</b>&nbsp;&nbsp;</td>
        <td>Number of e-Gold Account</td>
      </tr>
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$password</b>&nbsp;&nbsp;</td>
        <td>Password to e-Gold Acount</td>
      </tr>
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$cur</b>&nbsp;&nbsp;</td>
        <td>Currency of balance (see page 17 from <a href="http://www.e-gold.com/docs/e-gold_automation.pdf">http://www.e-gold.com/docs/e-gold_automation.pdf</a>) default: USD</td>
      </tr>
        </table>
    </div><br />
        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>
  <hr />
	<a name="methodhistory"></a>
	<h3>static method history <span class="smalllinenumber">[line <a href="../__filesource/fsource_e-gold__e-gold.class.php.html#a111">111</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>static int|string|csv history(
int
$account, string
$password, [string
$start = '-1 year'], [string
$end = 'now'], [array
$datas = null])</code>
    </td></tr></table>
    </td></tr></table><br />
	
		Shows history of account transactions<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td>Returns negative on script error, string on e-Gold error or csv data on success</td>
  </tr>
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>
<br /><br />

	
        <h4>Parameters:</h4>
    <div class="tags">
    <table border="0" cellspacing="0" cellpadding="0">
          <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$account</b>&nbsp;&nbsp;</td>
        <td>Number of e-Gold Account</td>
      </tr>
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$password</b>&nbsp;&nbsp;</td>
        <td>Password to e-Gold Acount</td>
      </tr>
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$start</b>&nbsp;&nbsp;</td>
        <td>Start date - must be in GNU format (see: <a href="http://www.gnu.org/software/tar/manual/html_node/tar_113.html">http://www.gnu.org/software/tar/manual/html_node/tar_113.html</a>)</td>
      </tr>
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$end</b>&nbsp;&nbsp;</td>
        <td>End date - must be in GNU format (see: <a href="http://www.gnu.org/software/tar/manual/html_node/tar_113.html">http://www.gnu.org/software/tar/manual/html_node/tar_113.html</a>)</td>
      </tr>
          <tr>
        <td class="type">array&nbsp;&nbsp;</td>
        <td><b>$datas</b>&nbsp;&nbsp;</td>
        <td>see page 11 from <a href="http://www.e-gold.com/docs/e-gold_automation.pdf">http://www.e-gold.com/docs/e-gold_automation.pdf</a> default: paymentsmade = 1, paymentsreceived = 1, redemptions = 1, fees = 1</td>
      </tr>
        </table>
    </div><br />
        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>
  <hr />
	<a name="methodmetaldata"></a>
	<h3>static method metaldata <span class="smalllinenumber">[line <a href="../__filesource/fsource_e-gold__e-gold.class.php.html#a192">192</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>static int|array metaldata(
[string
$start = null], [string
$end = null], [string
$cur = 'USD'])</code>
    </td></tr></table>
    </td></tr></table><br />
	
		Shows exchange rates of metals<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td>Returns negative on error or array on success</td>
  </tr>
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>
<br /><br />

	
        <h4>Parameters:</h4>
    <div class="tags">
    <table border="0" cellspacing="0" cellpadding="0">
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$start</b>&nbsp;&nbsp;</td>
        <td>Start date - must be in GNU format (see: <a href="http://www.gnu.org/software/tar/manual/html_node/tar_113.html">http://www.gnu.org/software/tar/manual/html_node/tar_113.html</a>) If not specified, you receive latest exchange rates</td>
      </tr>
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$end</b>&nbsp;&nbsp;</td>
        <td>End date - must be in GNU format (see: <a href="http://www.gnu.org/software/tar/manual/html_node/tar_113.html">http://www.gnu.org/software/tar/manual/html_node/tar_113.html</a>)</td>
      </tr>
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$cur</b>&nbsp;&nbsp;</td>
        <td>Currency (see page 17 from <a href="http://www.e-gold.com/docs/e-gold_automation.pdf">http://www.e-gold.com/docs/e-gold_automation.pdf</a>) default: USD</td>
      </tr>
        </table>
    </div><br />
        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>
  <hr />
	<a name="methodsci"></a>
	<h3>static method sci <span class="smalllinenumber">[line <a href="../__filesource/fsource_e-gold__e-gold.class.php.html#a338">338</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>static int sci(
[string
$alternatepassword = null], [bool
$apinmd5 = false], [array
$datas = null], [string
$ip = null])</code>
    </td></tr></table>
    </td></tr></table><br />
	
		Verifies payments<br /><br /><p>For mor information see <a href="http://www.e-gold.com/docs/e-gold_sci.pdf">http://www.e-gold.com/docs/e-gold_sci.pdf</a></p><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td>Return negative on error (-1 on bad ip address -2 on bad hash) or 1 on success</td>
  </tr>
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>
<br /><br />

	
        <h4>Parameters:</h4>
    <div class="tags">
    <table border="0" cellspacing="0" cellpadding="0">
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$alternatepassword</b>&nbsp;&nbsp;</td>
        <td>Alternate password to e-Gold Account</td>
      </tr>
          <tr>
        <td class="type">bool&nbsp;&nbsp;</td>
        <td><b>$apinmd5</b>&nbsp;&nbsp;</td>
        <td>Set TRUE if in $alternatepassword you specified md5 hash of Alternate password</td>
      </tr>
          <tr>
        <td class="type">array&nbsp;&nbsp;</td>
        <td><b>$datas</b>&nbsp;&nbsp;</td>
        <td>Specify only if payment informations is not in $_POST</td>
      </tr>
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$ip</b>&nbsp;&nbsp;</td>
        <td>Specify only if IP address are not in $_SERVER['REMOTE_ADDR']</td>
      </tr>
        </table>
    </div><br />
        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>
  <hr />
	<a name="methodspend"></a>
	<h3>static method spend <span class="smalllinenumber">[line <a href="../__filesource/fsource_e-gold__e-gold.class.php.html#a284">284</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>static int|string|array spend(
int
$account, string
$password, int
$payee, float
$amount, string
$memo, [int
$payin = 1], [string
$worthof = 'Gold'], [string
$ounces = null], [string
$ignoreratechange = 'y'], [string
$paymentid = null])</code>
    </td></tr></table>
    </td></tr></table><br />
	
		Make transaction<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td>Returns negative on script error, string on e-Gold error or array on success</td>
  </tr>
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>
<br /><br />

	
        <h4>Parameters:</h4>
    <div class="tags">
    <table border="0" cellspacing="0" cellpadding="0">
          <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$account</b>&nbsp;&nbsp;</td>
        <td>Number of e-Gold Account</td>
      </tr>
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$password</b>&nbsp;&nbsp;</td>
        <td>Password to e-Gold Acount</td>
      </tr>
          <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$payee</b>&nbsp;&nbsp;</td>
        <td>Payee Account Number</td>
      </tr>
          <tr>
        <td class="type">float&nbsp;&nbsp;</td>
        <td><b>$amount</b>&nbsp;&nbsp;</td>
        <td>Amount of transaction</td>
      </tr>
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$memo</b>&nbsp;&nbsp;</td>
        <td>see page 7 from <a href="http://www.e-gold.com/docs/e-gold_automation.pdf">http://www.e-gold.com/docs/e-gold_automation.pdf</a></td>
      </tr>
          <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$payin</b>&nbsp;&nbsp;</td>
        <td>see page 7 from <a href="http://www.e-gold.com/docs/e-gold_automation.pdf">http://www.e-gold.com/docs/e-gold_automation.pdf</a></td>
      </tr>
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$worthof</b>&nbsp;&nbsp;</td>
        <td>see page 7 from <a href="http://www.e-gold.com/docs/e-gold_automation.pdf">http://www.e-gold.com/docs/e-gold_automation.pdf</a></td>
      </tr>
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$ounces</b>&nbsp;&nbsp;</td>
        <td>see page 7 from <a href="http://www.e-gold.com/docs/e-gold_automation.pdf">http://www.e-gold.com/docs/e-gold_automation.pdf</a></td>
      </tr>
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$ignoreratechange</b>&nbsp;&nbsp;</td>
        <td>see page 7 from <a href="http://www.e-gold.com/docs/e-gold_automation.pdf">http://www.e-gold.com/docs/e-gold_automation.pdf</a></td>
      </tr>
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$paymentid</b>&nbsp;&nbsp;</td>
        <td>see page 7 from <a href="http://www.e-gold.com/docs/e-gold_automation.pdf">http://www.e-gold.com/docs/e-gold_automation.pdf</a></td>
      </tr>
        </table>
    </div><br />
        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>
  <hr />
	<a name="methodverify"></a>
	<h3>static method verify <span class="smalllinenumber">[line <a href="../__filesource/fsource_e-gold__e-gold.class.php.html#a230">230</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>static int|string|array verify(
int
$account, string
$password, int
$payee, float
$amount, [string
$worthof = &quot;Gold&quot;], [int
$payin = 1], [string
$memo = null], [string
$paymentid = null])</code>
    </td></tr></table>
    </td></tr></table><br />
	
		Verifies if transaction is possible<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td>Return negative on script error, string on e-Gold error or array on success</td>
  </tr>
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>
<br /><br />

	
        <h4>Parameters:</h4>
    <div class="tags">
    <table border="0" cellspacing="0" cellpadding="0">
          <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$account</b>&nbsp;&nbsp;</td>
        <td>Number of e-Gold Account</td>
      </tr>
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$password</b>&nbsp;&nbsp;</td>
        <td>Password to e-Gold Acount</td>
      </tr>
          <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$payee</b>&nbsp;&nbsp;</td>
        <td>Payee Account Number</td>
      </tr>
          <tr>
        <td class="type">float&nbsp;&nbsp;</td>
        <td><b>$amount</b>&nbsp;&nbsp;</td>
        <td>Amount of transaction</td>
      </tr>
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$worthof</b>&nbsp;&nbsp;</td>
        <td>see page 9 from <a href="http://www.e-gold.com/docs/e-gold_automation.pdf">http://www.e-gold.com/docs/e-gold_automation.pdf</a></td>
      </tr>
          <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$payin</b>&nbsp;&nbsp;</td>
        <td>see page 9 from <a href="http://www.e-gold.com/docs/e-gold_automation.pdf">http://www.e-gold.com/docs/e-gold_automation.pdf</a></td>
      </tr>
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$memo</b>&nbsp;&nbsp;</td>
        <td>see page 9 from <a href="http://www.e-gold.com/docs/e-gold_automation.pdf">http://www.e-gold.com/docs/e-gold_automation.pdf</a></td>
      </tr>
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$paymentid</b>&nbsp;&nbsp;</td>
        <td>see page 9 from <a href="http://www.e-gold.com/docs/e-gold_automation.pdf">http://www.e-gold.com/docs/e-gold_automation.pdf</a></td>
      </tr>
        </table>
    </div><br />
        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>

</div><br />


        <div class="credit">
		    <hr />
		    Documentation generated on Mon, 29 Oct 2007 20:30:41 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.0a2</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>
Return current item: e-Gold