PHPackages                             dmorenof/lendismart - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. dmorenof/lendismart

ActiveLibrary[API Development](/categories/api)

dmorenof/lendismart
===================

Lendismart integration API

1.0.10(6y ago)036MITPHP

Since Oct 3Pushed 6y ago1 watchersCompare

[ Source](https://github.com/dmorenof/lendismart)[ Packagist](https://packagist.org/packages/dmorenof/lendismart)[ RSS](/packages/dmorenof-lendismart/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (12)Used By (0)

Lendismart integration API
==========================

[](#lendismart-integration-api)

This is a fast and secure integration for Lendismart, S.L.

This library allows to create and check applications thought the webservice

Installation
------------

[](#installation)

### Composer

[](#composer)

To install the library you must execute the following code

```
composer require dmorenof/lendismart dev-master

```

### Manual

[](#manual)

Download the library from

Include all the files from the "installation path/src"

```
function autoload($path) {
    $items = glob($path . DIRECTORY_SEPARATOR . "*");

    foreach($items as $item) {
        $isPhp = pathinfo($item) ["extension"] === "php";

        if (is_file($item) && $isPhp) {
            require_once $item;
        } elseif (is_dir($item)) {
            autoload($item);
        }
    }
}

autoload($installation_path . DIRECTORY_SEPARATOR . 'src');

```

Usage
-----

[](#usage)

Instance the library

```
$Lendismart = new dmorenof\lendismart\Lendismart\Lendismart();

```

Prepare the authentication and environment

```
$Lendismart->setEndpoint('https://api-staging.lendismart.com/externalAPI/v1');
$Lendismart->setApiKey(AUTH_TOKEN);

```

### Create an application

[](#create-an-application)

Example to create an application

```
 try {
    $Lendismart = new dmorenof\lendismart\Lendismart\Lendismart();
    $Lendismart->setEndpoint('https://api-staging.lendismart.com/externalAPI/v1');
    $Lendismart->setApiKey(AUTH_TOKEN);

    $Application = new dmorenof\lendismart\Lendismart\Structures\Application([
        'goodsType' => 10101,
        'reference' => '2018/J3212',
        'serialNumber' => '11238630119',
        'purchaseAmount' => 2350,
        'requestedAmount' => 2000,
        'maxMonthlyPayment' => 80,
        'feePaymentType' => 1,
        'insurance' => true,
        'noAccount' => false,
        'terms' => [
            [
                'term' => 12,
            ],
        ],
        'gracePeriods' => [
            [
                'gracePeriod' => 0,
            ],
        ],
        'openingFeePcts' => [
            [
                'openingFeePct' => 0.025000000000000001,
            ],
        ],
        'productTypes' => [
            [
                'productType' => 1,
            ],
        ],
        'applicants' => [
            [
                'docIdType' => 1,
                'docIdNumber' => '11111111H',
                'docIdExpirationDate' => '2022-03-25T00:00:00.000Z',
                'firstName' => 'José',
                'surname1' => 'Pérez',
                'surname2' => 'García',
                'birthDate' => '1975-10-17T00:00:00.000Z',
                'nationality' => 65,
                'nativeCountry' => 65,
                'nativeProvince' => '28',
                'nativeCity' => '28079',
                'gender' => 1,
                'maritalStatus' => 1,
                'phoneType1' => 2,
                'phone1' => '611111111',
                'phoneType2' => 1,
                'phone2' => '911111111',
                'email' => 'prueba@prueba.es',
                'housingTenureType' => 1,
                'housingTenureStartDate' => '2008-04-12T00:00:00.000Z',
                'housingExpenses' => 400,
                'occupation' => 1120,
                'workingDayType' => 1,
                'profession' => 1,
                'jobTitle' => 1,
                'industry' => 901,
                'contractStartDate' => '2004-01-21T00:00:00.000Z',
                'companyName' => 'Despacho Prueba SA',
                'companyPhone' => '912222222',
                'companyProvince' => '28',
                'companyCity' => '28079',
                'companyPostalCode' => '28001',
                'monthlyIncome' => 1800.3399999999999,
                'incomeFrequency' => 14,
                'monthlyBonus' => 0,
                'otherMonthlyIncome' => 0,
                'dependentChildren' => 0,
                'dependentAdults' => 0,
                'otherExpenses' => 0,
                'role' => 1,
                'paymentMethod' => 1,
                'accountNumber' => 'ES9420805801101234567891',
                'accountCreationDate' => '2002-02-23T00:00:00.000Z',
                'address' => [
                    'streetType' => 6,
                    'street' => 'Francisco Silvela',
                    'number' => '62',
                    'stairs' => 'C',
                    'floor' => '2',
                    'door' => 'A',
                    'postalCode' => '28018',
                    'province' => '28',
                    'city' => '28079',
                    'locality' => '280790001',
                ],
            ],
        ],
    ]);

    $NewApplicationResponse = $Lendismart->createNewApplication(APP_USER_ID, $Application);
    $application_identifier = $$NewApplicationResponse->appId;
} catch (Exception $exception) {
    echo $exception->getMessage();
}

```

Returns the dmorenof\\lendismart\\Lendismart\\Structures\\NewApplicationResponse object or throws an Exception on error

### Check an application

[](#check-an-application)

Example to check an application

```
try {
    $Lendismart = new dmorenof\lendismart\Lendismart\Lendismart();
    $Lendismart->setEndpoint('https://api-staging.lendismart.com/externalAPI/v1');
    $Lendismart->setApiKey(AUTH_TOKEN);

    $ApplicationResponse = $Lendismart->application($application_identifier, 'long');
    $application_status = $ApplicationResponse->status;
} catch (Exception $exception) {
    echo $exception->getMessage();
}

```

Returns dmorenof\\lendismart\\Lendismart\\Structures\\ApplicationResponse or throws Exception on error

Documentation
=============

[](#documentation)

Lendismart::class
-----------------

[](#lendismartclass)

### Lendismart::setEndpoint(string $endpoint)

[](#lendismartsetendpointstring-endpoint)

Sets the endpoint (root url) of the environment we want to use for future calls:

-  PRODUCTION
-  STAGING

### Lendismart::setApiKey(string $api\_key)

[](#lendismartsetapikeystring-api_key)

Sets the api\_key (authorization token) provided by Lendismart we want to use for future calls

### Lendismart::application(string $application\_id, string $format)

[](#lendismartapplicationstring-application_id-string-format)

$application\_id Lendismart APPLICATION\_ID

$format short|long

Returns dmorenof\\lendismart\\Lendismart\\Structures\\ApplicationResponse or throws Exception on error

### Lendismart::createNewApplication(int $merchant\_id, Application $application)

[](#lendismartcreatenewapplicationint-merchant_id-application-application)

$merchant\_id Lendismart merchant\_id to associate the application

$application new Application object

Returns the dmorenof\\lendismart\\Lendismart\\Structures\\NewApplicationResponse object or throws an Exception on error

### Lendismart::getCallUrl()

[](#lendismartgetcallurl)

Get the called url for debugging reasons

### Lendismart::getPostData()

[](#lendismartgetpostdata)

Get the sent post data for debugging reasons

### Lendismart::getRawResponse()

[](#lendismartgetrawresponse)

Get the raw response for debugging reasons

### Lendismart::getHttpCode()

[](#lendismartgethttpcode)

Get the HTTP code for debugging reasons

### Example

[](#example)

```
try {
    $Lendismart = new dmorenof\lendismart\Lendismart\Lendismart();
    $Lendismart->setEndpoint('https://api-staging.lendismart.com/externalAPI/v1');
    $Lendismart->setApiKey(AUTH_TOKEN);

    $ApplicationResponse = $Lendismart->application($application_identifier, 'long');
    $application_status = $ApplicationResponse->status;
} catch (Exception $exception) {
    echo $exception->getMessage();
} finally {
    if (isset($Lendismart)) {
        echo $Lendismart->getCallUrl();
        echo $Lendismart->getPostData();
        echo $Lendismart->getHttpCode();
        echo $Lendismart->getRawResponse();
    }
}

```

Validation::class
-----------------

[](#validationclass)

Dynamically validates the objects on the Structures creation

Structure classes
-----------------

[](#structure-classes)

- Address
- Applicant
- Application
- ApplicationResponse
- Error
- GracePeriod
- Incident
- NewApplicationResponse
- OpeningFeePct
- ProductType
- Term

On construction evaluates the input array and returns the object

Uses the dictionaries to check valid values

Example:

```
try {
    $Address = new dmorenof\lendismart\Lendismart\Structures\Address([
        'streetType' => 6,
        'street' => 'Francisco Silvela',
        'number' => '62',
        'stairs' => 'C',
        'floor' => '2',
        'door' => 'A',
        'postalCode' => '28018',
        'province' => '28',
        'city' => '28079',
        'locality' => '280790001',
    ]);
} catch (Exception $exception) {
    echo $exception->getMessage();
}

```

Dictionary::class
-----------------

[](#dictionaryclass)

Sets a dictionary

### Dictionary::getById(int $value\_id)

[](#dictionarygetbyidint-value_id)

Gets the string name from an id

Example:

```
try {
    $ApplicationResponse = $Lendismart->application($application_identifier, 'short');
    $application_status = $ApplicationResponse->status;
    $ApplicationStatuses = new dmorenof\lendismart\Lendismart\Dictionaries\ApplicationStatuses();
    $status_text = $ApplicationStatuses->getById($application_status);
} catch (Exception $exception) {
    echo $exception->getMessage();
}

```

Dictionary classes
------------------

[](#dictionary-classes)

- ApplicationStatuses
- Cities
- Countries
- DocIdTypes
- ErrorTypes
- FeePaymentTypes
- Genders
- HousingTenureTypes
- IncidentTypes
- Industries
- JobTitles
- LenderCustomers
- Localities
- MaritalStatuses
- Occupations
- PaymentMethods
- PhoneTypes
- ProductTypes
- Professions
- Provinces
- Relationships
- ResponseCodes
- Roles
- ServiceDurations
- StreetTypes
- UsedSignatureMethods
- WorkingDayTypes

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Total

10

Last Release

2389d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/56082376?v=4)[dmorenof](/maintainers/dmorenof)[@dmorenof](https://github.com/dmorenof)

---

Top Contributors

[![dmorenof](https://avatars.githubusercontent.com/u/56082376?v=4)](https://github.com/dmorenof "dmorenof (28 commits)")

### Embed Badge

![Health badge](/badges/dmorenof-lendismart/health.svg)

```
[![Health](https://phpackages.com/badges/dmorenof-lendismart/health.svg)](https://phpackages.com/packages/dmorenof-lendismart)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93452.6k6](/packages/botman-driver-telegram)[pixelant/pxa-social-feed

Add Facebook, Instagram, and Twitter feeds to your site.

2349.3k](/packages/pixelant-pxa-social-feed)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
