conveylaw/portal-integration

PHP SDK to integrate with the Convey365 Panel Management Portal as an introducer

1.1 2021-05-20 11:29 UTC

This package is auto-updated.

Last update: 2024-05-20 17:41:07 UTC


README

This is an implementation of a client to the Convey365 Panel Management Portal Introducer API in PHP.

You will require a firm private api key which may be provided by contacting our NBT or IT team.

Install

Via Composer

$ composer require conveylaw/PortalIntegration

You may need to configure the autoload if you haven't already:

require_once('vendor/autoload.php');

Usage

$options = new conveylaw\IntroducerApiOptions($YOUR_PRIVATE_FIRM_API_KEY);
$api = conveylaw\PortalIntegration::getInstance($options);

// If you have been assigned any cases outside of the API you can query for them using this call
$convApiExportNewCases = $api->listInstructedCases();
if(!empty($convApiExportNewCases->getExports())) {
    // Import the cases
    $api->confirm($convApiExportNewCases->exportId);
}

// This will give you an array of ConvApiObjects that are updates to the cases that are assigned to you
$convApiExportCaseUpdates = $api->listCaseUpdates();
if(!empty($convApiExportCaseUpdates->getExports())) {
    // Import the case updates
    $api->confirm($convApiExportNewCases->exportId);
}

// This will create a new case using the ConvApiObjects that you provide
$convApiObjectsArray = [];
$matter = new ConvSaleTransaction();
$matter->setIntroducerReference("YOUR_REF");
$address = new ConvAddress();
$address->setProperty("34");
$address->setStreet("Stow Hill");
$address->setTown("Newport");
$address->setPostcode("NP20 1JE");
$matter->setAddress($address);
$matter->setAmount(120000);
$matter->setTenure(ConvTenureType::FREEHOLD);
$matter->setMortgage(true);
array_push($convApiObjectsArray, $matter);

$client = new ConvClient();
$client->setIntroducerReference("YOUR_REF");
$clientAddress = new ConvAddress();
$clientAddress->setProperty("34");
$clientAddress->setStreet("Stow Hill");
$clientAddress->setTown("Newport");
$clientAddress->setPostcode("NP20 1JE");
$client->setAddress($clientAddress);
$client->setTitle("Mr");
$client->setForename("Test");
$client->setSurname("Client");
$client->setTelephone("Telephone");
$client->setEmail("test@testington.com");
$client->setMobile("07123456789");
array_push($convApiObjectsArray, $client);

$note = new ConvNote();
$note->setIntroducerReference("YOUR_REF");
$note->setAuthor("Bob Jones");
$note->setNote("This is a test note");
$note->setTransactionType(ConvTransactionType::SALE);
array_push($convApiObjectsArray, $note);

$matterRef = $api->importCase($convApiObjectsArray);
//store the returned matter reference

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Security

If you discover any security related issues, please email ned@conveylaw.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.