Install via cli
php artisan module:install kylemassacre-mcc/bank
Open up app/Providers/AppServiceProvider.php and add in the register method:
$this->app->bind([
...
\Modules\Bank\Providers\BankServiceProvider::class
]);
Run the artisan command:
php artisan vendor:publish --provider="Modules\Bank\Providers\BankServiceProvider"
Method | Endpoint | Route Name |
---|---|---|
GET/HEAD | /api/cyberbank/buy | cyber.buy |
POST | /api/cyberbank/deposit | cyber.deposit |
POST | /api/cyberbank/withdraw | cyber.withdraw |
GET/HEAD | /api/bank/buy | bank.buy |
POST | /api/bank/deposit | bank.deposit |
POST | /api/bank/withdraw | bank.withdraw |
{
"success": {
"message": "You have withdrew $1 from your account",
"txn_details": {
"amount": "$2",
"past_balance": "$5",
"new_balance": "$3",
"fees": "$1"
}
}
}
{
"success": {
"message": "You have deposited $1 into your account",
"txn_details": {
"amount": "$2",
"past_balance": "$3",
"new_balance": "$4",
"fees": "$1"
}
}
}
Malformed Amount
{
"message": "422 Unprocessable Entity",
"errors": {
"amount": [
"You must provide a valid transaction amount",
"Your transaction amount must be at least $2"
]
}
Not enough funds
{
"message": "You don't have enough funds to put that in your bank",
"status_code": 200,
}
{
"message": "You don't have enough funds in your Cyber Bank",
"status_code": 200,
}
No Bank
{
"message": "You must own a Cyber Bank",
"status_code": 200,
}
Purchase Bank
{
"success": "You have purchased a Bank"
}
Can't afford Bank
{
"message": "You do not have $10,000,000 to open an account",
"status_code": 200,
}
Already Own Bank
{
"message": "You already own a Bank",
"status_code": 200,
}