定制 dnhb/api-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

dnhb/api-client

最新稳定版本:1.8.0

Composer 安装命令:

composer require dnhb/api-client

包简介

A client for the Hypotheekbond APIs

README 文档

README

Description

Wrapper around the Hypotheekbond API

Example usage

constructing the api client

$auth = Dnhb\ApiClient\Auth\Auth::apiKey("your-api-key");
$client = new Client(new \GuzzleHttp\Client(), $auth);
$api = new Dnhb\ApiClient\Api($client);

simple usage

$constructionAddedValue = $api->calculation()->getConstructionAddedValue();

complex requests

$fixedRatePeriods = [
    new PaymentFixedRatePeriodParameter(10, 2.65)
];
    
$loanParts = [
    new PaymentLoanpartParameter(
        new MortgageType(MortgageType::LINEAR),
        100000.0,
        1,
        $fixedRatePeriods
    )
];
    
$persons = [
    new PaymentPersonParameter(new DateTime('1980-01-01'), 15000),
    new PaymentPersonParameter(new DateTime('1985-01-01'), 35000)
];
    
$payments = $api->calculation()->getMortgagePayments($loanParts, 125000.0, $persons); 
$investment = $payments->getTotal()->getInvestment();
$firstMonthInterest = $response->getPayments()[0]->getInterest();
 

Import requests

$scope = new Scope('Scope');
    
$dossier = new DossierParameter('DossierParameter', $scope);
$dossier->createPerson('ApplicantParameter')
    ->setIsPrimaryContact(true)
    ->setLastName('LastName');
    
$dossierId = $api->import()->insertDossier($scope);

Complex import requests

$scope = new Scope('Scope');
    
$address = new AddressParameter('Address', $scope);
$address->setPostalCode('1000AA')
    ->setHouseNumber('1')
    ->setStreet('Damrak')
    ->setCity('Amsterdam');
    
$dossier = new DossierParameter('DossierParameter', $scope);
$dossier->setClientStatus(new ClientStatus(ClientStatus::PROSPECT))
    ->setMaritalStatus(new MaritalStatus(MaritalStatus::MARRIED_PRENUPTIAL_AGREEMENT))
    ->setNote('This is a note')
    ->addCorrespondenceAddress($address);
    
$dossier->createHouse('HouseParameter')
    ->addAddress($address);
    
$dossier->createPerson('Person1')
    ->setIsPrimaryContact(true)
    ->setLastName('LastName');
    
$dossierId = $api->import()->insertDossier($scope);

Import Parameter relations in two ways

$scope = new Scope('Scope');
    
$dossier = new DossierParameter('BasicDossier', $scope);
$dossier->createPerson('FirstPerson') // Note that createPerson returns a PersonParamater
    ->setIsPrimaryContact(true)
    ->setLastName('First');
    
$person = new PersonParameter('SecondPerson', $scope); // Note that you have to specify the scope
$person->setIsPrimaryContact(false)
    ->setLastName('Second');
        
$dossier->addPerson($person); // Note that you have to create the relation between the person and the dossier
    

The second way is especially usefull for objects that can be used for different Parameter objects, like the AddressParameter which can be related to the DossierParameter (addCorrespondenceAddress()) and the HouseParameter (addAddress())

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2016-12-23