PHPackages                             odesenvolvedor/clearsale-php-sdk - 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. odesenvolvedor/clearsale-php-sdk

ActiveLibrary[API Development](/categories/api)

odesenvolvedor/clearsale-php-sdk
================================

ClearSale API Client

1.2.6(6y ago)33.6k3MITPHPPHP &gt;=5.6

Since Nov 21Pushed 5y ago1 watchersCompare

[ Source](https://github.com/odesenvolvedor/clearsale-php-sdk)[ Packagist](https://packagist.org/packages/odesenvolvedor/clearsale-php-sdk)[ Docs](https://github.com/odesenvolvedor/clearsale-php-sdk)[ RSS](/packages/odesenvolvedor-clearsale-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

clearsale-php-sdk
=================

[](#clearsale-php-sdk)

This package is designed for integration with the ClearSale API

Clearsale is a Brazilian fraud risk management company operating in the physical and virtual world, with solutions for e-commerce, credit, collection and sales recovery.

### Requirements

[](#requirements)

- PHP &gt;= 5.6

### Install

[](#install)

```
composer require odesenvolvedor/clearsale-php-sdk

```

### Usage

[](#usage)

```
require_once __DIR__ . '/../autoload.php';

try {
    $environment = new ClearSale\Environment\Environment(new ClearSale\Environment\Sandbox());

    $auth = new \ClearSale\Auth\Login('user', 'password');

    $orderRequest = new \ClearSale\Request\ClearSaleOrderRequest($environment, $auth);

    $orderCode = 'ORDER_EXAMPLE_2_0_3';

    $billingAddress = new \ClearSale\Address();
    $billingAddress->setStreet('Street name')
                    ->setNumber('1')
                    ->setAdditionalInformation('Additional information')
                    ->setCountry('Brazil')
                    ->setState('SP')
                    ->setCity('São Paulo')
                    ->setCounty('County name')
                    ->setReference('Address reference')
                    ->setZipcode('00000000');

    $phone1 = new ClearSale\Phone();
    $phone1->setType(\ClearSale\Phone::HOME)
            ->setDdi(55)
            ->setDdd(11)
            ->setNumber(333333333);

    $phone2 = new ClearSale\Phone();
    $phone2->setType(\ClearSale\Phone::MOBILE)
            ->setDdi(55)
            ->setDdd(11)
            ->setNumber(999999999);

    $phones = [
                $phone1,
                $phone2
            ];

    $card = new ClearSale\Card();
    $card->setNumber('000000xxxxxx0001')
            ->setHash('12345678945612301234569874563210')
            ->setBin('000000')
            ->setEnd('0001')
            ->setType(ClearSale\Card::VISA)
            ->setValidityDate('12/2022')
            ->setOwnerName('Owner Card Name')
            ->setDocument('1234567890');

    $payment1 = new \ClearSale\Payment();
    $payment1->setSequential(1)
            ->setDate('2019-01-01')
            ->setValue(37.00)
            ->setType(1)
            ->setInstallments(1)
            ->setInterestRate(10)
            ->setInterestValue(2.00)
            ->setCurrency(986)
            ->setVoucherOrderOrigin('123456')
            ->setCard($card)
            ->setAddress($billingAddress);
    $payments = [
        $payment1
    ];

    $item1 = new ClearSale\Item();
    $item1->setCode('100')
            ->setName('Item Description')
            ->setValue(15.00)
            ->setAmount(1)
            ->setCategoryID(1)
            ->setCategoryName('Item category name');

    $items = [
        $item1
    ];

    $order = new \ClearSale\Order();
    $order->setCode($orderCode)
            ->setSessionId(md5(uniqid(rand())))
            ->setDate('2019-01-01')
            ->setEmail('email@email.com.br')
            ->setTotalValue(37.00)
            ->setNumberOfInstallments(1)
            ->setIp('192.168.0.1')
            ->setStatus(ClearSale\Status::STATUS_NEW)
            ->setProduct($order::PRODUCT_TICKETS)
            ->getBilling()
                ->setClientID('Cliente123')
                ->setType(\ClearSale\Billing::PERSON_NATURAL)
                ->setPrimaryDocument('12345678910')
                ->setSecondaryDocument('12345678')
                ->setName('Complete Client Name')
                ->setBirthDate('1985-06-11')
                ->setEmail('email@example.com')
                ->setGender(\ClearSale\Gender::MALE);

    $order->getBilling()
            ->setAddress($billingAddress)
            ->setPhones($phones);

    $order->getShipping()
                ->setClientID('Cliente123')
                ->setType(\ClearSale\Billing::PERSON_NATURAL)
                ->setPrimaryDocument('12345678910')
                ->setSecondaryDocument('12345678')
                ->setName('Complete Client Name')
                ->setBirthDate('1985-06-11')
                ->setEmail('email@example.com')
                ->setGender(\ClearSale\Gender::MALE)
                ->setDeliveryType(\ClearSale\Delivery::NORMAL)
                ->setDeliveryTime('2 dias úteis')
                ->setPickUpStoreDocument('12345678910')
                ->setPrice(22.00)
                ->getAddress()
                    ->setStreet('Street name')
                    ->setNumber('1')
                    ->setAdditionalInformation('Additional information')
                    ->setCountry('Brazil')
                    ->setState('SP')
                    ->setCity('São Paulo')
                    ->setCounty('County name')
                    ->setReference('Address reference')
                    ->setZipcode('00000000');

    $order->getShipping()->setPhones($phones);

    $order->setPayments($payments)
          ->setItems($items);

    print_r($orderRequest->send($order));
} catch (\ClearSale\Request\ClearSaleRequestException $exception) {
    $error = $exception->getClearSaleError();
    echo $error->getMessage();
}
```

=== doar-paypal-brasil ===
==========================

[](#-doar-paypal-brasil-)

#### Contributors: Fernando Campos (odesenvolvedor)

[](#contributors-fernando-campos-odesenvolvedor)

#### Donate account PayPal

[](#donate-account-paypal)

[![QR Code](https://user-images.githubusercontent.com/24375017/95643906-d4fb4880-0a88-11eb-9d2f-944d4d686fff.png)](https://user-images.githubusercontent.com/24375017/95643906-d4fb4880-0a88-11eb-9d2f-944d4d686fff.png)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.1% 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

Unknown

Total

1

Last Release

2370d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fa4ef0b9af2671a8ffb2a2a02bbd4a63ac33ff04448d044626f49c0e548db93e?d=identicon)[odesenvolvedor](/maintainers/odesenvolvedor)

---

Top Contributors

[![odesenvolvedor](https://avatars.githubusercontent.com/u/24375017?v=4)](https://github.com/odesenvolvedor "odesenvolvedor (51 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

---

Tags

ClearSale

### Embed Badge

![Health badge](/badges/odesenvolvedor-clearsale-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/odesenvolvedor-clearsale-php-sdk/health.svg)](https://phpackages.com/packages/odesenvolvedor-clearsale-php-sdk)
```

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)

PHPackages © 2026

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