Download the PHP package divido/divido-php without Composer

On this page you can find all versions of the php package divido/divido-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 divido-php

Divido API

This is the documentation for the Divido API.

Sign up for an account to get instant access to our sandbox environment.

Current version: v1.15

Getting started

There are several distinct parts of a complete integration with the Divido API:

Deal Calculator

Calculate APR, monthly repayments, duration etc

Finances

List Rate Card and all financial products available for a specific merchant.

Credit Request

Create a new credit proposal and return an url to application form

Finalize Credit Request

Finalize an existing accepted credit application, will update the loan agreement and return an url to the contract signing.

Activation

Activate whole or part of application

Cancellation

Cancel a deactivated application

Refund

Refund a part or whole of an activated application

List all applications

Returns a list of your applications. The applications are returned sorted by creation date, with the most recently created applications appearing first.

Retrieve an application

Retrieves the details of an existing application. Supply the application ID and the API will return the corresponding application.

Reporting / List all payment batches

Retrieves all payment batches.

Reporting / Retrieve records from a payment batch

Retrieves the content of a payment batch. Supply the batch ID and the API will return all records.

Change log

2018-14-03

2017-11-03

2017-04-21

2017-03-25

2017-03-13

2016-12-20

2016-11-28

2016-11-16

2016-11-07

2016-11-02

2016-11-01

2016-10-30

2016-10-18

2016-09-27

2016-06-28

2016-01-28

2015-06-21

Offical Libraries

We strongly encourage use of our official libraries for accessing the Divido API. Our official libraries are listed below, as well as community supported libraries.

PHP

Install from source

git clone https://github.com/DividoFinancialServices/divido-api-php.git

Community libraries

Please submit a pull request to this page to add any missing libraries that should be featured here. Please note that Divido does not offer any support for community libraries.

Magento 1.*

Magento 2

WooCommerce

OpenCart

Using the API

API endpoints

To use the Divido API to query data, you will need to send a request to the correct endpoint. Request endpoints should depend on whether you wish to query the live or sandbox environment:

HTTP response codes

You may encounter the following response codes. Any unsuccessful response codes will contain more information to help you identify the cause of the problem.

Webhooks

To alert you of any changes in the status of your resources, Divido provides webhooks. These are POST requests to your server that are sent as soon as a resource changes status. The body of the request contains details of the change.

List of IP addresses

52.211.249.159 production

54.72.119.96 production

52.211.116.109 production

52.212.234.209 production

34.249.63.178 sandbox

Request

The API server will send a POST request to the response_url associated with the application or webhook_url set by Divido support team.

Parameters

application Application ID

proposal Proposal ID

reference Third party reference (if supplied as part of the application)

status New status

metadata Metadata (if supplied as part of the application)

Example Request

JSON example

Possible statuses

Resources

Finances

Returns an array with all finance options available for merchant

Example Request

GET https://secure.divido.com/v1/finances?merchant={MERCHANT}&country={COUNTRY} HTTP/1.1

Example Response

JSON example

Parameters

merchant

country - The country code (Optional, String)

Deal Calculator

The deal calculator calculates the payment terms for various terms and deposits.

Example Request

GET https://secure.divido.com/v1/dealcalculator?merchant={MERCHANT}&amount={AMOUNT}&deposit={deposit}&country={country}&finance={FINANCE} HTTP/1.1

Example Response

JSON example

Parameters

merchant

amount

Credit Request

The credit request creates a new proposal and return a URL to the Divido application form.

Example Request

POST https://secure.divido.com/v1/creditrequest HTTP/1.1

Example Response

JSON example

Parameters

merchant

deposit - The value of the deposit. (Required, Float)

finance - The finance code (Required, String)

directSign - Whether or not to immediately go to signing after approval (Optional, Boolean, Default is true)

country - The country code (Required, String)

language - The country code (Required, String)

currency - The currency code (Required, String)

amount - Order total in same currency as proposal. Used to validate the total from product line items. (Optional, Float)

reference - Your intenral reference, will be returned in webhooks. (Optional, Float)

customer['firstName'] - Customer first name (Optional, String)

customer['middleNames'] - Customer middle names (Optional, String)

customer['lastName'] - Customer last name (Optional, String)

customer['country'] - Customer country (Optional, String)

customer['address']['text'] - Customer address in one line. We will try to match the address and split it up in street, flat, buildingNumber, buildingName. (Optional, String

customer['address']['postcode'] - Customer postcode (Optional, String

customer['address']['street'] - Customer street (Optional, String)

customer['address']['flat'] - Customer flat (Optional, String)

customer['address']['buildingNumber'] - Customer building number (Optional, String)

customer['address']['buildingName'] - Customer building name (Optional, String)

customer['address']['town'] - Customer town (Optional, String)

customer['address']['monthsAtAddress'] - Customer months at address (Optional, String)

customer['shippingAddress']['postcode'] - Customer postcode (Optional, String

customer['shippingAddress']['street'] - Customer street (Optional, String)

customer['shippingAddress']['flat'] - Customer flat (Optional, String)

customer['shippingAddress']['buildingNumber'] - Customer building number (Optional, String)

customer['shippingAddress']['buildingName'] - Customer building name (Optional, String)

customer['shippingAddress']['town'] - Customer town (Optional, String)

customer['gender'] - Customer gender (Optional, String)

customer['email'] - Customer email (Optional, String)

customer['phoneNumber'] - Customer phone number (Optional, String)

customer['dateOfBirthYear'] - Customer year of birth (Optional, String)

customer['dateOfBirthMonth'] - Customer month of birth (Optional, String)

customer['dateOfBirthDay'] - Customer day of birth (Optional, String)

customer['bank']['sortCode'] - Customer bank sort code (Optional, String)

customer['bank']['accountNumber'] - Customer bank account number (Optional, String)

metadata['key'] - metadata key (Optional, String)

metadata['value'] - metadata value (Optional, String)

products['1']['sku'] - Product SKU (Optional, String)

products['1']['name'] - Product name/description (Optional, String)

products['1']['quantity'] - Product quantity (Optional, String)

products['1']['price'] - Product price in same currency as proposal (Optional, String)

products['1']['vat'] - Product VAT percentage (Optional, String)

products['1']['unit'] - Product unit (Optional, String)

products['1']['image'] - Product image (Optional, String)

products['1']['attributes'] - Product attributes (1=Service fee,2=Shipping fee,3=Payment fee,6=Discount, 10=Price is without VAT, 20=Line item with order VAT sum) (Optional, String)

responseUrl - The URL where we send notification about the payment (Optional, String)

checkoutUrl - A URL which Divido redirects the customer to if they get declined or wish to cancel their application (Optional, String)

redirectUrl - The URL the customer will get redirected to after a successful application (Optional, String)

Finalize Credit Request

Finalize an existing accepted credit application, will update the loan agreement and return an url to the contract signing. This only applies to Credit Requests created directSign = false.

Example Request

POST https://secure.divido.com/v1/creditrequest/finalize HTTP/1.1

Example Response

JSON example

Activation

Activate whole or part of an application and initialise a payout from the underwriter. Activate part of the application by specifing the products that should be activated. If no product data is submitted, the whole application will be activated.

Example Request

POST https://secure.divido.com/v1/activation HTTP/1.1

Example Response

JSON example

Parameters

merchant - Your unique account identifier (Required, String)

application - The application or proposal identifier. (Required, String)

products['1']['sku'] - Product SKU (Optional, String)

products['1']['name'] - Product name/description (Optional, String)

products['1']['quantity'] - Product quantity (Optional, String)

products['1']['price'] - Product price in same currency as proposal (Optional, String)

products['1']['vat'] - Product VAT percentage (Optional, String)

amount - Sum of the activated products (Optional, String)

deliveryMethod - How the goods were delivered, can be either "store" or "delivery" (Required, String)

trackingNumber - If the deliveryMethod is delivery and you have a tracking number (Optional, String)

reference - Your reference to identify the activation (Optional, String)

comment - Comment to the underwriter, can be order number or other information (Optional, String)

Cancellation

Mark an application as cancelled and notify the underwriter, only possible if application is DRAFT, REFERRED, INFO-NEEDED, ACTION-CUSTOMER, ACTION-RETAILER, ACTION-LENDER, ACCEPTED, DEPOSIT-PAID, PARTIALLY-ACTIVATED, SIGNED, READY.

Example Request

POST https://secure.divido.com/v1/cancellation HTTP/1.1

Example Response

JSON example

Parameters

merchant - Your unique account identifier (Required, String)

application - The application or proposal identifier. (Required, String)

products['1']['sku'] - Product SKU (Optional, String)

products['1']['name'] - Product name/description (Optional, String)

products['1']['quantity'] - Product quantity (Optional, String)

products['1']['price'] - Product price in same currency as proposal (Optional, String)

products['1']['vat'] - Product VAT percentage (Optional, String)

products['1']['attributes'] - Product attributes (1=Service,2=Shipping fee,3=Payment fee, 10=Price is without VAT) (Optional, String)

amount - Sum of the refunded items (Optional, String)

reference - Your reference to identify the refund (Optional, String)

comment - Comment to the underwriter, can be order number or other information (Optional, String)

Refund

Refund whole or part of an application, if the application is AWAITING-ACTIVATION, PARTIALLY-ACTIVATED, ACTIVATED or COMPLETED. For partial refund, specify the products that have been refunded. If no product data is submitted the whole application will be refunded.

Example Request

POST https://secure.divido.com/v1/refund HTTP/1.1

Example Response

JSON example

Parameters

merchant - Your unique account identifier (Required, String)

application - The application or proposal identifier. (Required, String)

products['1']['sku'] - Product SKU (Optional, String)

products['1']['name'] - Product name/description (Optional, String)

products['1']['quantity'] - Product quantity (Optional, String)

products['1']['price'] - Product price in same currency as proposal (Optional, String)

products['1']['vat'] - Product VAT percentage (Optional, String)

products['1']['attributes'] - Product attributes (1=Service,2=Shipping fee,3=Payment fee, 10=Price is without VAT) (Optional, String)

amount - Sum of the refunded items (Optional, String)

reference - Your reference to identify the refund (Optional, String)

Example `7321834 `

comment - Comment to the underwriter, can be order number or other information (Optional, String)

Example `Customer returned part of order`

List all applications

Returns a list of your applications. The applications are returned sorted by creation date, with the most recently created applications appearing first.

Example Request

GET https://secure.divido.com/v1/applications?merchant={MERCHANT}&proposal={PROPOSAL}&status={STATUS}&page={PAGE} HTTP/1.1

Example Response

JSON example

{
    "itemsPerPage": 30,
    "page": 1,
    "records": [
        {
              "_activatableAmount": "£ 0",
            "_activatedAmount": "£ 1197.50",
            "_cancelableAmount": "£ 0",
            "_cancelledAmount": "£ 0",
            "_creditAmount": "£ 1197.50",
            "_currentCreditAmount": "£ 1197.50",
            "_depositAmount": "£ 0",
            "_monthlyPaymentAmount": "£ 199.58",
            "_purchasePrice": "£ 1197.50",
            "_refundableAmount": "£ 1197.50",
            "_refundedAmount": "£ 0",
            "_totalRepayableAmount": "£ 1197.48",
            "activatableAmount": 740,
            "activatedAmount": 1197.5,
            "activations": [
                {
                    "_amount": "£ 1197.50",
                    "amount": 1197.5,
                    "comment": "",
                    "date": "2016-10-26 04:20",
                    "deliveryMethod": "delivery",
                    "reference": "9482471",
                    "trackingNumber": ""
                }
            ],
            "agreementDuration": 6,
            "cancelableAmount": 0,
            "cancellations": [],
            "cancelledAmount": 0,
            "channel": {
                "id": "CDDB70595-BFE6-0B7D-EE5B-B09FFC89F98C",
                "name": "Webshop.com",
                "type": "webshop"
            },
            "country": "GB",
            "createdDate": "2016-10-26 04:18",
            "creditAmount": 1197.5,
            "currentCreditAmount": 1197.5,
            "currency": "GBP",
            "deferralPeriod": 0,
            "depositAmount": 0,
            "depositReference": "",
            "depositStatus": "NO-DEPOSIT",
            "directSign": true,
            "email": "[email protected]",
            "finance": {
                "id": "F06895E17-EE96-926E-7137-37BCABB9DCF7",
                "maxDeposit": 50,
                "minAmount": 150,
                "minDeposit": 0,
                "text": "6 Month 0% Interest Free"
            },
            "firstName": "John",
            "history": [
                {
                    "date": "2016-10-26 04:20",
                    "status": "AWAITING-ACTIVATION",
                    "text": "",
                    "type": "status",
                    "user": "James Weston"
                },
                {
                    "date": "2016-10-26 04:18",
                    "status": "SIGNED",
                    "text": "",
                    "type": "status",
                    "user": ""
                },
                {
                    "date": "2016-10-26 04:18",
                    "status": "ACCEPTED",
                    "text": "",
                    "type": "status",
                    "user": ""
                },
                {
                    "date": "2016-10-26 04:18",
                    "status": "",
                    "text": "Customer entered gateway from 10.11.12.1",
                    "type": "",
                    "user": ""
                }
            ],
            "id": "C92F7C65B-5C2D-6544-BB13-3E54243B9875",
            "identityVerified": false,
            "interestRate": 0,
            "interestType": "simple",
            "lastName": "Doe",
            "lender": "Demo",
            "lenderLoanReference": "XY111111",
            "lenderReference": "x22acc2e-2dc4-2ec2-3a7f-x4c5f02a0c3a",
            "metadata": {
                "Invoice Number": "844001",
                "Order Number": "100019"
            },
            "modifiedDate": "2016-10-26 04:20",
            "monthlyPaymentAmount": 199.58,
            "products": [
                {
                    "_price": "£ 1153",
                    "_sum": "£ 1153",
                    "image": "http://www.webshop.com/images/GIB100.png",
                    "name": "Gibson Les Paul Studio Raw Guitar",
                    "price": "1153.00",
                    "quantity": 1,
                    "sku": "GIB100",
                    "sum": "1153.00",
                    "unit": "pcs"
                },
                {
                    "_price": "£ 89",
                    "_sum": "£ 44.50",
                    "image": "",
                    "name": "Restring Upgrade",
                    "price": "89.00",
                    "quantity": 0.5,
                    "sku": "H10",
                    "sum": "44.50",
                    "unit": "hour"
                }
            ],
            "proposal": "PD56030F0-845C-ECF1-6118-0B26EFDCB273",
            "proposalCreator": null,
            "purchasePrice": 1197.5,
            "reference": "test reference",
            "refundableAmount": 1197.50,
            "refundedAmount": 0,
            "refunds": [],
            "status": "AWAITING-ACTIVATION",
            "totalRepayableAmount": 1197.5,
            "url": "https:\/\/secure.divido.com\/token\/0685cx87225604f0b75f53c6b6afe71x"
        },
        {
            ...
        },
        {
            ...
        },
        {
            ...
        }
    ],
    "status": "ok",
    "totalItems": 4
}

Parameters

merchant

Example `live_c31be25be.fb2ee4bc8a66e1ecd797c56f03621102`

country - Filter by country code (Optional, String)

Example `GB`

status - Filter by status (Optional, String)

Example `SIGNED`

proposal - Filter by proposal (Optional, String)

Example `PAA717844-EE9D-78AF-D11C-EDCC1D180F87`

page - Show page, default 1 (Optional, String)

Example `2`

Retrieve an application

Retrieves the details of an existing application. Supply the application ID and the API will return the corresponding application.

Example Request

GET https://secure.divido.com/v1/applications?merchant={MERCHANT}&id={id} HTTP/1.1

Example Response

JSON example

{
    "record": {
          "_activatableAmount": "£ 0",
        "_activatedAmount": "£ 1197.50",
        "_cancelableAmount": "£ 0",
        "_cancelledAmount": "£ 0",
        "_creditAmount": "£ 1197.50",
        "_currentCreditAmount": "£ 1197.50",
        "_depositAmount": "£ 0",
        "_monthlyPaymentAmount": "£ 199.58",
        "_purchasePrice": "£ 1197.50",
        "_refundableAmount": "£ 1197.50",
        "_refundedAmount": "£ 0",
        "_totalRepayableAmount": "£ 1197.48",
        "activatableAmount": 740,
        "activatedAmount": 1197.5,
        "activations": [
            {
                "_amount": "£ 1197.50",
                "amount": 1197.5,
                "comment": "",
                "date": "2016-10-26 04:20",
                "deliveryMethod": "delivery",
                "reference": "9482471",
                "trackingNumber": ""
            }
        ],
        "agreementDuration": 6,
        "cancelableAmount": 0,
        "cancellations": [],
        "cancelledAmount": 0,
        "channel": {
            "id": "CDDB70595-BFE6-0B7D-EE5B-B09FFC89F98C",
            "name": "Webshop.com",
            "type": "webshop"
        },
        "country": "GB",
        "createdDate": "2016-10-26 04:18",
        "creditAmount": 1197.5,
        "currentCreditAmount": 1197.5,
        "currency": "GBP",
        "deferralPeriod": 0,
        "depositAmount": 0,
        "depositReference": "",
        "depositStatus": "NO-DEPOSIT",
        "directSign": true,
        "email": "[email protected]",
        "finance": {
            "id": "F06895E17-EE96-926E-7137-37BCABB9DCF7",
            "maxDeposit": 50,
            "minAmount": 150,
            "minDeposit": 0,
            "text": "6 Month 0% Interest Free"
        },
        "firstName": "John",
        "history": [
            {
                "date": "2016-10-26 04:20",
                "status": "AWAITING-ACTIVATION",
                "text": "",
                "type": "status",
                "user": "James Weston"
            },
            {
                "date": "2016-10-26 04:18",
                "status": "SIGNED",
                "text": "",
                "type": "status",
                "user": ""
            },
            {
                "date": "2016-10-26 04:18",
                "status": "ACCEPTED",
                "text": "",
                "type": "status",
                "user": ""
            },
            {
                "date": "2016-10-26 04:18",
                "status": "",
                "text": "Customer entered gateway from 10.11.12.1",
                "type": "",
                "user": ""
            }
        ],
        "id": "C92F7C65B-5C2D-6544-BB13-3E54243B9875",
        "identityVerified": false,
        "interestRate": 0,
        "interestType": "simple",
        "lastName": "Doe",
        "lender": "Demo",
        "lenderLoanReference": "XY111111",
        "lenderReference": "",
        "metadata": {
            "Invoice Number": "844001",
            "Order Number": "100019"
        },
        "modifiedDate": "2016-10-26 04:20",
        "monthlyPaymentAmount": 199.58,
        "products": [
            {
                "_price": "£ 1153",
                "_sum": "£ 1153",
                "image": "http://www.webshop.com/images/GIB100.png",
                "name": "Gibson Les Paul Studio Raw Guitar",
                "price": "1153.00",
                "quantity": 1,
                "sku": "GIB100",
                "sum": "1153.00",
                "unit": "pcs"
            },
            {
                "_price": "£ 89",
                "_sum": "£ 44.50",
                "image": "",
                "name": "Restring Upgrade",
                "price": "89.00",
                "quantity": 0.5,
                "sku": "H10",
                "sum": "44.50",
                "unit": "hour"
            }
        ],
        "proposal": "PD56030F0-845C-ECF1-6118-0B26EFDCB273",
        "proposalCreator": null,
        "purchasePrice": 1197.5,
        "reference": "test reference",
        "refundableAmount": 1197.50,
        "refundedAmount": 0,
        "refunds": [],
        "status": "AWAITING-ACTIVATION",
        "totalRepayableAmount": 1197.5,
        "url": "https:\/\/secure.divido.com\/token\/0685cx87225604f0b75f53c6b6afe71x"
    },
    "status": "ok"
}

Parameters

merchant

Example `live_c31be25be.fb2ee4bc8a66e1ecd797c56f03621102`

id - Application id (Required, String)

Example `C84047A6D-89B2-FECF-D2B4-168444F5178C`

Reporting / List all payment batches

Retrieves all payment batches.

Example Request

GET https://secure.divido.com/v1/payments?merchant={MERCHANT}¤cy={CURRENCY}&lender={LENDER}&page={PAGE} HTTP/1.1

Example Response

JSON example

{
    "itemsPerPage": 30,
    "page": 1,
    "records": [
        {
            "currency": "GBP",
            "date": "2016-04-14",
            "id": "PB0506EBA-870B-FFC2-FCAB-250D1B1291BD",
            "lender": {
                "id": "L07F46CDF-5296-D190-1F2D-A1B5FD869B72",
                "name": "Demo"
            },
            "merchant": {
                "id": "M7470B82C-B1EE-158F-D965-CFFD3158992A",
                "name": "Sofa & Table"
            },
            "records": 1,
            "totalCreditAmount": 989,
            "totalNetPayment": 1074.165,
            "totalSubsidyAmount": 4.945
        },
        ...,
        ...
    ],
    "status": "ok",
    "totalItems": 3
}

Parameters

merchant

Example `live_c31be25be.fb2ee4bc8a66e1ecd797c56f03621102`

currency - Filter by currency code (Optional, String)

Example `GBP`

lender - Filter by lender ID (Optional, String)

Example `L07F46CDF-5296-D190-1F2D-A1B5FD869B72 `

page - Show page, default 1 (Optional, String)

Example `2`

Reporting / Retrieve records from a payment batch

Retrieves the content of a payment batch. Supply the batch ID and the API will return all records.

Example Request

GET https://secure.divido.com/v1/payments?merchant={MERCHANT}&id={id} HTTP/1.1

Example Response

JSON example

{
    "record": {
        "currency": "GBP",
        "date": "2016-04-14",
        "id": "PB0506EBA-870B-FFC2-FCAB-250D1B1291BD",
        "lender": {
            "id": "L07F46CDF-5296-D190-1F2D-A1B5FD869B72",
            "name": "Demo"
        },
        "totalCreditAmount": 989,
        "totalNetPayment": 1074.165,
        "totalSubsidyAmount": 4.945,
        "transactions": [
            {
                "application": "CDD6CCE0C-8DC5-6EB4-9A08-45520484EB19",
                "creditAmount": 989,
                "customer": "HESELDEN, ANN",
                "depositAmount": 100,
                "finance": {
                    "id": "F927FA596-6C9C-8376-A99B-70AE9A020F6B",
                    "text": "0% 12 month - Demo Bank"
                },
                "netPaymentAmount": 1074.165,
                "purchasePrice": 1089,
                "reference": "267381",
                "subsidyAmount": 4.945
            }
        ]
    },
    "status": "ok"
}

Parameters

merchant

Example `live_c31be25be.fb2ee4bc8a66e1ecd797c56f03621102`

id - Batch id (Required, String)

Example `PB0506EBA-870B-FFC2-FCAB-250D1B1291BD `

All versions of divido-php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.2.0
ext-curl Version *
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 divido/divido-php contains the following files

Loading the files please wait ....