ratespecial / credit-agency-rent
Library to generate fixed-length credit agency rent reporting files (Equifax Insight, Experian Rental Exchange)
Package info
bitbucket.org/rscode/lib.credit-agency-rent
pkg:composer/ratespecial/credit-agency-rent
Requires
- php: ^8.3
- gugglegum/clv-rw: ^2.0
- nesbot/carbon: ^3.6
Requires (Dev)
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^11.2
- squizlabs/php_codesniffer: ^3.7
- swisnl/phpstan-bitbucket: ^0.3.0
README
Generates fixed-length files for submitting rent payment data to credit agencies. Supports both Equifax Consumer Insight and Experian Rental Exchange formats.
Equifax Consumer Insight
Based on File Layout Guide v16. Each file has a batch date (YYYYMM) and produces 518-byte records.
Empty dates in an InsightRow object should be set to 0, which writes 00000000 in the output.
Example
use RateSpecial\CreditAgencyRent\EquifaxInsight\InsightFile;
use RateSpecial\CreditAgencyRent\EquifaxInsight\InsightRow;
use RateSpecial\CreditAgencyRent\EquifaxInsight\Enums\AccountType;
use RateSpecial\CreditAgencyRent\EquifaxInsight\Enums\CompanyType;
use RateSpecial\CreditAgencyRent\EquifaxInsight\Enums\CurrentStatus;
use RateSpecial\CreditAgencyRent\EquifaxInsight\Enums\CurrentBalanceSign;
use RateSpecial\CreditAgencyRent\EquifaxInsight\Enums\Flags;
use RateSpecial\CreditAgencyRent\EquifaxInsight\Enums\RepaymentFrequency;
use RateSpecial\CreditAgencyRent\EquifaxInsight\Enums\SpecialIndicator;
$file = new InsightFile();
$file->portfolioNumber = '99999999';
$file->companyType = CompanyType::BANK_FINANCE;
$file->batchDate = Carbon::now();
$row = new InsightRow();
$row->accountType = AccountType::PROPERTY_RENTAL;
$row->accountNumber = '1234abc';
$row->startDate = 20230418;
$row->endDate = '02/24/2019';
$row->defaultDate = 0;
$row->birthDate = Carbon::now();
$row->creditLimit = 333888;
$row->flags = Flags::DEBT_MANAGEMENT;
$row->transientAssociation = 'T';
$row->specialIndicator = SpecialIndicator::ADDRESS_CHANGE;
$row->currentBalance = 234324;
$row->currentBalanceSign = CurrentBalanceSign::CREDIT;
$row->defaultBalance = 12;
$row->startBalance = 99;
$row->repaymentValue = 13221;
$row->repaymentPeriod = 322;
$row->repaymentFrequency = RepaymentFrequency::WEEKLY;
$row->currentStatus = CurrentStatus::SETTLED;
$row->nameDetails = 'JOHN DOE';
$row->address1 = '123 fake street';
$row->address2 = 'Test Town';
$row->address3 = 'Test County';
$row->postcode = 'TT145TF';
$row->newAccountNumber = 'abc999';
$row->usersOwnData = 'foobar';
$file->addRow($row);
$content = $file->create(); // returns file contents as a string
Experian Rental Exchange
Based on the Rental Exchange File Specification for Open Banking v2.5. Each file has a data month (MMMCCYY) and produces 2100-byte records. Dates use DDMMCCYY format.
Example
use Carbon\Carbon;
use RateSpecial\CreditAgencyRent\ExperianRentalExchange\RentalExchangeFile;
use RateSpecial\CreditAgencyRent\ExperianRentalExchange\RentalExchangeRow;
use RateSpecial\CreditAgencyRent\ExperianRentalExchange\Enums\PaymentStatus;
$file = new RentalExchangeFile();
$file->sourceCode = '12345';
$file->companyName = 'ABC Housing Association';
$file->dataMonth = new Carbon('2023-03-01');
$row = new RentalExchangeRow();
$row->tenancyReference = 'TEN001';
$row->paymentStatus = PaymentStatus::UP_TO_DATE;
$row->tenancyStartDate = new Carbon('2022-06-15');
$row->rentalAmount = 850;
$row->dateOfBirth = new Carbon('1985-12-01');
$row->setName('Mr', 'John', 'Smith', 'David');
$row->setAddress('5 Main Street', 'NG8 1JD', 'Wollaton', 'Nottingham');
$file->addRow($row);
$content = $file->create(); // returns file contents as a string