kylemassacre-mcc/bank 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kylemassacre-mcc/bank

Composer 安装命令:

composer require kylemassacre-mcc/bank

包简介

A bank module for the MCC api

README 文档

README

For Laravel 5.1

Installation

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"

API Endpoints:

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

Sample Responses

Successful Withdraw
{
  "success": {
    "message": "You have withdrew $1 from your account",
    "txn_details": {
      "amount": "$2",
      "past_balance": "$5",
      "new_balance": "$3",
      "fees": "$1"
    }
  }
}
Successful Deposit
{
  "success": {
    "message": "You have deposited $1 into your account",
    "txn_details": {
      "amount": "$2",
      "past_balance": "$3",
      "new_balance": "$4",
      "fees": "$1"
    }
  }
}
Invalid Responses

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,
}

统计信息

  • 总下载量: 12
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2016-03-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固