承接 simplecms/bank 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

simplecms/bank

最新稳定版本:1.0.2

Composer 安装命令:

composer require simplecms/bank

包简介

Laravel Bank Component / 银行大全

README 文档

README

📦 A comprehensive collection of information covering 260 banks as published by UnionPay.

English | 简体中文

Latest Stable Version Latest Unstable Version Code Coverage Total Downloads License

Requirements

Installation

composer require simplecms/bank

Usage

Includes Validation Rule and safe_bank_number method.

Get Bank List

use SimpleCMS\Bank\Facades\Bank; 

Bank::getBankList(); //Returns the complete list
Bank::getOptions(); // Returns as Collection<value:string, name:string>
Bank::getOptions('DC'); // Returns a list of debit card banks. Supports all, DC, CC, SCC, PC

Query and Check

use SimpleCMS\Bank\Facades\Bank; 

Bank::getBankByCode($code); // Retrieve bank information by code
Bank::getBankByName($name); // Retrieve bank information by name
Bank::getBankByBin($bin); // Retrieve bank information by BIN
Bank::getBankByCardNumber($card_number); // Retrieve bank information by card number
Bank::checkBin($bin); // Check the validity of BIN
Bank::checkCardNumber($card_number); // Check the validity of card number

Helpers

$card_number = '62270000000006666';
//Bank card masking
safe_bank_number((string) $card_number, (string) $maskChar = '*', (int) $start = 6, (int) $length = 4); // 622700********6666

Validation

$rules = [
    'bank' => 'bank', //Bank name
    'bank_bin' => 'bank_bin', //Bank BIN
    'bank_card' => 'bank_card', //Bank card number
    'bank_code' => 'bank_code' //Bank code
];
$messages = [
    'bank.bank' => 'The name of bank is incorrect.',
    'bank_bin.bank_bin' => 'The bin code is incorrect.',
    'bank_card.bank_card' => 'The card number is incorrect.',
    'bank_code.bank_code' => 'The code of bank is incorrect.',
];
$data = $request->validate($rules,$messages);

Custom Bank Data

You can customize your own data through the .env file.

Modify Configuration File Path

Add the following code to your .env file:

BANK_PATH='Your bank JSON file address' #Absolute location

JSON Data Format

The data structure follows the format below:

{
    "name": "Bank Name",
    "code": "Bank code identifier",
    "bins": {
        "DC": {  # DC Debit Card
            "19": ["123456", "23456"] # 19 is the card number length, numeric content is the BIN code
        },
        "CC": {  # CC Credit Card
            "18": ["32131", "13123"]
        },
        "SCC": { # Semi-Credit Card
            "16": ["1233", "2345"],
            "17": ["3213", "3322"]
        },
        "PC": { # Prepaid Card
            "15": ["1234"]
        }
    }
}

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-10