tjphippen/hart 问题修复 & 功能扩展

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

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

tjphippen/hart

Composer 安装命令:

composer require tjphippen/hart

包简介

Hart Credit Reports for Laravel 5

README 文档

README

Latest Stable Version Total Downloads

Installation

Add the following to your composer.json file.

"tjphippen/hart": "0.1.*@dev"

Then run composer install or composer update to download and install.

You'll then need to register the service provider in your config/app.php file within providers.

'providers' => array(
    'Tjphippen\Hart\HartServiceProvider',
)

This package includes a auto registered facade which provides the static syntax for running/retrieving credit reports.

Create configuration file using artisan

$ php artisan vendor:publish

The configuration file will be published to config/hart.php which must be completed to make connections to the API. In order to use this package you must first have account credentials to access the API provided by Hart Software

    /**
     * Environment (development or production)
     */
    'env' => 'development',

    /**
     * Hart Account
     */
    'account' => '',

    /**
     * Hart Password
     */
    'passwd' => '',
...

Examples

Run Credit Report

You may send an array with the persons details like below

Hart::getCredit(array(
   'name' => 'John Doe', 
   'address' => '123 Fake Street',
   'city' => 'Faketown',
   'state' => 'CA',
   'zip' => '55555',
   'dob' => '08/25/1991',
   'ssn' => '123456789',
   );

Or simply use an object returned by an Eloquent model.

$customer = Customer::findOrFail($customerId); // Model not included :P
Hart::getCredit($customer);

Get Previous Report by Token

$token = 'XXXXXXXXXXXXXX...';
Hart::getByToken(['token' => $token]);

Currently both functions return a full response object. I've added a chainable ->parse() method to return the following.

{
    "transaction": "995284100",
    "token": "F94OtZHJKthWudshcdnJI3YLRRwaappmIYo2Dp...",
    "score": 566,
    "reasons": [
        "Serious delinquency, and derogatory public record or collection files",
        "Number of accounts with delinquency",
        "Time since delinquency is too recent or unknown"
    ]
}

Or you can return a full SimpleXMLElement and parse to fit your needs.

Hart::getCredit($customer)->xml;

Change Log

v0.1.0

  • Released

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-08-31