PHP code example of acrosure / acrosure-php-sdk
1. Go to this page and download the library: Download acrosure/acrosure-php-sdk library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
acrosure / acrosure-php-sdk example snippets
$acrosureClient = new AcrosureClient([
"token" => "<your_api_key>",
"endpointBase" => "<endpoint_base>" // as optional
]);
$application = $acrosureClient->getApplicationManager()->get("<application_id>");
$createdApplication = $acrosureClient->getApplicationManager()->create([
"product_id" => "<product_id>", // code('{}'),
"package_code" => "<package_code>",
"attachments": => []
]);
$updatedApplication = $acrosureClient->getApplicationManager()->update([
"application_id" => "<application_id>", // "package_code": "<package_code>",
"attachments": []
]);
$packages = $acrosureClient->getApplicationManager()->getPackages("<application_id>");
$updatedApplication = $acrosureClient->getApplicationManager()->selectPackage([
"application_id" => "<application_id>",
"package_code" => "<package_code>"
]);
$currentPackage = $acrosureClient->getApplicationManager()->getPackage(
"<application_id>"
);
$submittedApplication = $acrosureClient->getApplicationManager()->submit(
"<application_id>"
);
$confirmedApplication = $acrosureClient->getApplicationManager()->confirm(
"<application_id>"
);
$applications = $acrosureClient->getApplicationManager()->getList(searchParams);
$product = $acrosureClient->getProductManager()->get("<product_id>");
$products = $acrosureClient->getProductManager()->getList(searchParams);
$policy = $acrosureClient->getPolicyManager()->get("<policy_id>");
$policies = $acrosureClient->getPolicyManager()->getList(searchParams);
// Without dependencies
$values = $acrosureClient->getDataManager()->get([
"handler" => "<some_handler>"
]);
// With dependencies
$values = $acrosureClient->getDataManager()->get([
"handler" => "<some_handler>",
"dependencies" => ["<dependency_1>", "<dependency_2>"]
]);
$teamInfo = $acrosureClient->getTeamManager()->getInfo();
$isSignatureValid = $acrosureClient->verifySignature(
"<signature>",
"<raw_data>"
);