Download the PHP package katsana/insurance-sdk-php without Composer

On this page you can find all versions of the php package katsana/insurance-sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package insurance-sdk-php

KATSANA Insurance Renewal SDK for PHP

Build Status Latest Stable Version Total Downloads Latest Unstable Version License Coverage Status

Installation

To install through composer, simply put the following in your composer.json file:

Quick Installation

Above installation can also be simplify by using the following command:

composer require "php-http/guzzle6-adapter" "katsana/insurance-sdk-php=^0.2"

HTTP Adapter

Instead of utilizing php-http/guzzle6-adapter you might want to use any other adapter that implements php-http/client-implementation. Check Clients & Adapters for PHP-HTTP.

Getting Started

Creating Client

You can start by creating a client by using the following code (which uses php-http/guzzle6-adapter and php-http/discovery to automatically pick available adapter installed via composer):

Authenticate Using Client Credential Grant

Once you initiate the client, you need to get an Access Token before using the services. All you need to do is:

Additionally, if you already have an Access Token, you can initiate a client with existing Access Token. You can initiate the client using the following code:

Handling Response

Every API request using the API would return an instance of Katsana\Insurance\Response which can fallback to \Psr\Http\Message\ResponseInterface, this allow developer to further inspect the response.

As an example:

Getting the Response

You can get the raw response using the following:

However we also create a method to parse the return JSON string to array.

Checking the Response HTTP Status

You can get the response status code via:

Checking the Response Header

You can also check the response header via the following code:

Using the API

There are two way to request an API:

Using API Resolver

This method allow you as the developer to automatically select the current selected API version without having to modify the code when KATSANA release new API version.

This would resolve an instance of Katsana\Insurance\One\Insurer class (as v1 would resolve to One namespace).

Explicit API Resolver

This method allow you to have more control on which version to be used.

Usages

Get List of Insurers

Use this API to get a complete list of available Insurers.

Code Example

Response Parameters

Parameters Type Description
country_code string The country code, e.g: MY
name string Insurer name
partner boolean Whether we can make renewal
product_code string|null Product code
Response Sample

Create Draft Quotation

Use this API to create a motor insurance renewal quotation draft.

Code Example

Request Parameters

Parameter Type Rule Description
$plateNumber string required The vehicle license plate.
$insurerCode string required Insurer's Product Code.
$ownerInformation['fullname'] string required Driver's fullname.
$ownerInformation['birthdate'] string required Driver's birth date in Y-m-d format.
$ownerInformation['email'] string required Driver's e-mail address.
$ownerInformation['nric'] string required Driver's National Registration Identity Card (NRIC) ID.
$ownerInformation['phone_no'] string required Driver's phone number.
$ownerInformation['postcode'] string required Driver's current address postcode.
$insuranceInformation['ended_at'] string required Current vehicle insurance expiry date in Y-m-d format.
$vehicleInformation['maker'] string optional Vehicle's maker. E.g Proton, Perodua, Honda etc.
$vehicleInformation['model'] string optional Vehicle's maker. E.g Iriz, Persona, MyVi, Civic, Vios etc.
$vehicleInformation['year_manufactured'] integer optional Vehicle's year of manufactured.
$vehicleInformation['chasis_number'] string optional Vehicle's chassis number.
$vehicleInformation['engine_number'] string optional Vehicle's engine number.
$sumCovered float optional Total sum covered for the vehicle in MYR.
$addons['windscreen'] float optional Total covered for windscreen coverage.
$addons['flood'] boolean optional Enable basic flood coverage.
$addons['extended_flood'] boolean optional Enable extended flood coverage.
$addons['under_repair_compensation'] boolean optional ...
$addons['passenger_negligence_liability'] boolean optional ...

Response Example

Update Quotation

Use this API to update draft quotation for motor insurance renewal.

Code Example

Request Parameters

Parameter Type Rule Description
$plateNumber string required The vehicle license plate.
$insurerCode string required Insurer's Product Code.
$sumCovered float required Total sum covered for the vehicle in MYR.
$addons['windscreen'] float optional Total covered for windscreen coverage.
$addons['flood'] boolean optional Enable basic flood coverage.
$addons['extended_flood'] boolean optional Enable extended flood coverage.
$addons['under_repair_compensation'] boolean optional ...
$addons['passenger_negligence_liability'] boolean optional ...

Response Example

Save Vehicle Information

Use this API to store and update Vehicle information.

Code Example

Request Parameters

Parameter Type Rule Description
$plateNumber string required The vehicle license plate.
$ownerInformation['fullname'] string required Driver's fullname.
$ownerInformation['birthdate'] string required Driver's birth date in Y-m-d format.
$ownerInformation['email'] string required Driver's e-mail address.
$ownerInformation['nric'] string required Driver's National Registration Identity Card (NRIC) ID.
$ownerInformation['phone_no'] string required Driver's phone number.
$ownerInformation['postcode'] string required Driver's current address postcode.
$insuranceInformation['ended_at'] string required Current vehicle insurance expiry date in Y-m-d format.
$vehicleInformation['maker'] string required Vehicle's maker. E.g Proton, Perodua, Honda etc.
$vehicleInformation['model'] string required Vehicle's maker. E.g Iriz, Persona, MyVi, Civic, Vios etc.
$vehicleInformation['year_manufactured'] integer required Vehicle's year of manufactured.
$vehicleInformation['chasis_number'] string optional Vehicle's chassis number.
$vehicleInformation['engine_number'] string optional Vehicle's engine number.

Response Example

Make Payment

Use this API to make a payment for Insurance Renewal.

Code Example

Request Parameters

Parameter Type Rule Description
$plateNumber string required The vehicle license plate.
$insurerCode string required Insurer's Product Code.
$sumCovered float required Total sum covered for the vehicle in MYR.
$addons['windscreen'] float optional Total covered for windscreen coverage.
$addons['flood'] boolean optional Enable basic flood coverage.
$addons['extended_flood'] boolean optional Enable extended flood coverage.
$addons['under_repair_compensation'] boolean optional ...
$addons['passenger_negligence_liability'] boolean optional ...
$declaration['pds'] boolean required ...
$declaration['ind'] boolean required ...
$declaration['pdpa'] boolean required Required to be true to indicate user has agree to Insurance Renewal PDPA.
$declaration['lapse'] boolean optional Required to be true only if insurance has been expired but within the 90 days lapse duration!

Insurance renewal is not available for insurance that has been expired over 90 days!

Response Example

Notes:

All versions of insurance-sdk-php with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
laravie/codex Version ^4.0 || ^5.0
laravie/codex-security Version ^1.0.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package katsana/insurance-sdk-php contains the following files

Loading the files please wait ....