e-gold
[ class tree: e-gold ] [ index: e-gold ] [ all elements ]

Class: egold

Source Location: /e-gold.class.php

Class Overview


Class to manage e-Gold Account


Author(s):

Version:

  • 1.0.0

Copyright:

  • Pawel Banasiak 2007

Variables

Methods



Class Details

[line 20]
Class to manage e-Gold Account

Author: Pawel Banasiak http://banasiak.net

Thanks to wlk (http://krzeslo.net)

YOU USE THIS SCRIPT AT YOUR OWN RESPONSIBILITY AND AT YOUR OWN RISK




Tags:

author:  Pawel Banasiak <banasiak@banasiak.net>
version:  1.0.0
copyright:  Pawel Banasiak 2007
license:  BSD


[ Top ]


Class Variables

static $connection_timeout =  15

[line 24]



Tags:

var:  Connection timeout
access:  public

Type:   int


[ Top ]

static $connection_type =  'curl'

[line 28]



Tags:

var:  Connection type - 'curl' or 'fsockopen' (fsockopen is not safety!)
access:  public

Type:   string


[ Top ]



Class Methods


static method balance [line 148]

static int|array balance( int $account, string $password, [string $cur = 'USD'])

Shows current account balance



Tags:

return:  Returns negative on error or array on success
access:  public


Parameters:

int   $account   Number of e-Gold Account
string   $password   Password to e-Gold Acount
string   $cur   Currency of balance (see page 17 from http://www.e-gold.com/docs/e-gold_automation.pdf) default: USD

[ Top ]

static method history [line 111]

static int|string|csv history( int $account, string $password, [string $start = '-1 year'], [string $end = 'now'], [array $datas = null])

Shows history of account transactions



Tags:

return:  Returns negative on script error, string on e-Gold error or csv data on success
access:  public


Parameters:

int   $account   Number of e-Gold Account
string   $password   Password to e-Gold Acount
string   $start   Start date - must be in GNU format (see: http://www.gnu.org/software/tar/manual/html_node/tar_113.html)
string   $end   End date - must be in GNU format (see: http://www.gnu.org/software/tar/manual/html_node/tar_113.html)
array   $datas   see page 11 from http://www.e-gold.com/docs/e-gold_automation.pdf default: paymentsmade = 1, paymentsreceived = 1, redemptions = 1, fees = 1

[ Top ]

static method metaldata [line 192]

static int|array metaldata( [string $start = null], [string $end = null], [string $cur = 'USD'])

Shows exchange rates of metals



Tags:

return:  Returns negative on error or array on success
access:  public


Parameters:

string   $start   Start date - must be in GNU format (see: http://www.gnu.org/software/tar/manual/html_node/tar_113.html) If not specified, you receive latest exchange rates
string   $end   End date - must be in GNU format (see: http://www.gnu.org/software/tar/manual/html_node/tar_113.html)
string   $cur   Currency (see page 17 from http://www.e-gold.com/docs/e-gold_automation.pdf) default: USD

[ Top ]

static method sci [line 338]

static int sci( [string $alternatepassword = null], [bool $apinmd5 = false], [array $datas = null], [string $ip = null])

Verifies payments

For mor information see http://www.e-gold.com/docs/e-gold_sci.pdf




Tags:

return:  Return negative on error (-1 on bad ip address -2 on bad hash) or 1 on success
access:  public


Parameters:

string   $alternatepassword   Alternate password to e-Gold Account
bool   $apinmd5   Set TRUE if in $alternatepassword you specified md5 hash of Alternate password
array   $datas   Specify only if payment informations is not in $_POST
string   $ip   Specify only if IP address are not in $_SERVER['REMOTE_ADDR']

[ Top ]

static method spend [line 284]

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])

Make transaction



Tags:

return:  Returns negative on script error, string on e-Gold error or array on success
access:  public


Parameters:

int   $account   Number of e-Gold Account
string   $password   Password to e-Gold Acount
int   $payee   Payee Account Number
float   $amount   Amount of transaction
string   $memo   see page 7 from http://www.e-gold.com/docs/e-gold_automation.pdf
int   $payin   see page 7 from http://www.e-gold.com/docs/e-gold_automation.pdf
string   $worthof   see page 7 from http://www.e-gold.com/docs/e-gold_automation.pdf
string   $ounces   see page 7 from http://www.e-gold.com/docs/e-gold_automation.pdf
string   $ignoreratechange   see page 7 from http://www.e-gold.com/docs/e-gold_automation.pdf
string   $paymentid   see page 7 from http://www.e-gold.com/docs/e-gold_automation.pdf

[ Top ]

static method verify [line 230]

static int|string|array verify( int $account, string $password, int $payee, float $amount, [string $worthof = "Gold"], [int $payin = 1], [string $memo = null], [string $paymentid = null])

Verifies if transaction is possible



Tags:

return:  Return negative on script error, string on e-Gold error or array on success
access:  public


Parameters:

int   $account   Number of e-Gold Account
string   $password   Password to e-Gold Acount
int   $payee   Payee Account Number
float   $amount   Amount of transaction
string   $worthof   see page 9 from http://www.e-gold.com/docs/e-gold_automation.pdf
int   $payin   see page 9 from http://www.e-gold.com/docs/e-gold_automation.pdf
string   $memo   see page 9 from http://www.e-gold.com/docs/e-gold_automation.pdf
string   $paymentid   see page 9 from http://www.e-gold.com/docs/e-gold_automation.pdf

[ Top ]


Documentation generated on Mon, 29 Oct 2007 20:30:41 +0100 by phpDocumentor 1.4.0a2