hedeqiang/bank-card-info

Package description here.

v1.0.0 2022-05-12 02:02 UTC

This package is auto-updated.

Last update: 2024-11-12 07:31:52 UTC


README

银行卡信息获取、验证

StyleCI build status FOSSA Status

Installing

$ composer require hedeqiang/bank-card-info -vvv

Usage

<?php

require __DIR__ .'/vendor/autoload.php';

use Hedeqiang\BankCardInfo\BankCard;

$card = new BankCard();
$response = $card->getInfo('6212260200142520000');
var_dump($response);

返回示例

{
    "validated": true,
    "bank": "ICBC",
    "bankName": "中国工商银行",
    "bankImg": "https://apimg.alipay.com/combo.png?d=cashier&t=ICBC",
    "cardType": "DC",
    "cardTypeName": "储蓄卡"
}

在 Laravel 中使用

可以用两种方式来获取 Hedeqiang\BankCardInfo\BankCard 实例:

方法参数注入

<?php

namespace App\Http\Controllers;

use Hedeqiang\BankCardInfo\BankCard;
use Illuminate\Http\Request;

class BankCardController extends Controller
{
    public function index(Request $request,BankCard $bankCard)
    {
        return $bankCard->getInfo('62122602001000000');
    }
}

服务名访问

<?php

namespace App\Http\Controllers;

use Hedeqiang\BankCardInfo\BankCard;
use Illuminate\Http\Request;

class BankCardController extends Controller
{
    public function index(Request $request,BankCard $bankCard)
    {
        return app('BankCard')->getInfo('62122602001000000');
    }
}

TODO

Contributing

You can contribute in one of three ways:

  1. File bug reports using the issue tracker.
  2. Answer questions or fix bugs on the issue tracker.
  3. Contribute new features or update the wiki.

The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.

参考

License

MIT

FOSSA Status