PHP Classes

PHP Wallet : Perform operations with amounts in a wallet

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2023-10-27 (11 months ago) RSS 2.0 feedNot enough user ratingsTotal: 66 All time: 10,366 This week: 89Up
Version License PHP version Categories
algo_dgw 1.0.0MIT/X Consortium ...5PHP 5, Finances
Description 

Author

This package can perform operations with amounts in a wallet.

It provides a class that stores money amounts and can perform several types of financial operations with those amounts.

Currently, it can:

- Set the initial balance

- Get the current balance

- Deposit a given amount in the wallet

- Withdraw a given amount in the wallet

- Transfer a given amount between two wallets by withdrawing from one wallet and depositing that amount in another wallet

Picture of The Algoslingers
  Performance   Level  
Name: The Algoslingers is available for providing paid consulting. Contact The Algoslingers .
Classes: 9 packages by
Country: Ghana Ghana
Age: ???
All time rank: 37455 in Ghana Ghana
Week rank: 44 Up1 in Ghana Ghana Up
Innovation award
Innovation award
Nominee: 5x

Winner: 2x

Instructions

Example Usage:

try {
    $walletA = new DigitalWallet(100);
    $walletB = new DigitalWallet(50);

    $walletA->deposit(30);
    $walletB->withdraw(20);

    echo "Wallet A Balance: " . $walletA->getBalance() . "<br>";
    echo "Wallet B Balance: " . $walletB->getBalance() . "<br>";

    $walletA->transfer($walletB, 25);

    echo "Wallet A Balance after transfer: " . $walletA->getBalance() . "<br>";
    echo "Wallet B Balance after transfer: " . $walletB->getBalance() . "<br>";
} catch (Exception $e) {
    echo "Error: " . $e->getMessage();
}
  Files folder image Files (1)  
File Role Description
Plain text file PHP-digital-wallet.php Class Main file

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:66
This week:0
All time:10,366
This week:89Up