require_once("Paypal.php");
$p = new Paypal();
$p->SetEmail("email@test.com");
$p->SetPassword("mypass");
The balance is saved in a scalar variable.
The recent transactions are saved in an array of arrays. In the example.php, the transactions are saved in the array. You can see the structure of the array with the print_r() function.$bal = $p->GetBalance();
But for those of you who are lazy, this is the array structure$trans = $p->GetTransactions();
Array
(
[0] => Array
(
[type] => Payment
[tofrom] => From
[nameemail] => John Smith
[date] => May 9, 2005
[status] => Completed
[amount] => $1,000.00 USD
[fee] => -$29.30 USD
)
[1] => Array
(
[type] => Payment
[tofrom] => From
[nameemail] => Joe Everyman
[date] => May 4, 2005
[status] => Completed
[amount] => $5.00 USD
[fee] => -$0.45 USD
)
)
If you have a Paypal account that stores multiple currencies at
the same time, then the regular GetBalance() won't work for you.
Instead, you should use
$balances = $p->GetMultipleBalances();This returns an array of the pair [amount, currency name], so that the array structure looks like
Array
(
[0] => Array
(
[0] => 533.40
[1] => USD
)
[1] => Array
(
[0] => 0.20
[1] => EUR
)
)