抵押债券 / 客户端
一个实现抵押债券API的客户端。
v2.0.1
2019-10-16 13:20 UTC
Requires
- ext-soap: *
- laravel/framework: ^6.0
- nesbot/carbon: ~1.0 | ~2.0
README
这是一个消费抵押债券SOAP API的包,用于将客户数据推送到其系统并提取以信号形式的重要信息。
实现
实现自己的抵押联盟配置版本并将其绑定到合约。
发布
有一个示例配置文件可以与以下内容一起发布
php artisan vendor:publish --provider='MortgageUnion\ServiceProvider' --tag='config'
此配置包含顾问和合作伙伴凭证。
顾问凭证
顾问凭证是用户在hypotheekbond.nl网站上的登录凭证。这些凭证用于追踪哪个用户创建了客户。
合作伙伴凭证
合作伙伴凭证是您的API用户名和密钥。这些凭证需要在抵押债券处请求。请求可以发送到servicedesk@hypotheekbond.nl。
示例
示例推送使用
$customer = new \MortgageUnion\Models\Customer([ 'name' => 'Vries', 'suffix' => 'de', 'initials' => 'A', 'firstName' => 'Anton', ]); $customerRepository = app()->make(MortgageUnion\Repositories\CustomerRepository::class); $customerRepository->createOrUpdate($customer);
示例信号使用
$signalRepository = app()->make(MortgageUnion\Repositories\SignalRepository::class) $signalRepository->getSignals();
示例配置实现:配置包含顾问和合作伙伴凭证。
class MortgageUnionConfig implements \MortgageUnion\Config\Contracts\MortgageUnionConfig { /** * @var Repository */ private $configRepository; /** * MortgageUnionConfig constructor. * @param Repository $configRepository */ public function __construct(ConfigRepository $configRepository) { $this->configRepository = $configRepository; } public function getAdvisorUser() { return $this->configRepository->get('hypotheekbond_adviseur'); } public function getAdvisorPassword() { return $this->configRepository->get('hypotheekbond_adviseurPassword'); } ingle public function getPartnerUser() { return $this->configRepository->get('hypotheekbond.partner'); } public function getPartnerPassword() { return $this->configRepository->get('hypotheekbond.partnerPassword'); } public function getURI() { return $this->configRepository->get('hypotheekbond.uri'); } public function getWSDL() { return $this->configRepository->get('hypotheekbond.wsdl'); } }
示例登录实现
public function controllerMethodHypotheekbondLogin(\MortgageUnion\Repositories\AuthRepository $authRepository) { $result = $authRepository->singleClickLogin(); if ($result instanceof SoapFault) { return abort(500, "Could not authenticate"); } return redirect()->to($result); }