bank-card-info
银行卡信息获取、验证
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:
- File bug reports using the issue tracker.
- Answer questions or fix bugs on the issue tracker.
- 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