PHPackages                             verdadeiro-mestre/omnipay-cielo - 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. [Payment Processing](/categories/payments)
4. /
5. verdadeiro-mestre/omnipay-cielo

ActiveLibrary[Payment Processing](/categories/payments)

verdadeiro-mestre/omnipay-cielo
===============================

Gateway de pagamentos Cielo

v1.0.0(2y ago)04MITPHP

Since Feb 29Pushed 2y ago1 watchersCompare

[ Source](https://github.com/VerdadeiroMestre/omnipay-cielo)[ Packagist](https://packagist.org/packages/verdadeiro-mestre/omnipay-cielo)[ RSS](/packages/verdadeiro-mestre-omnipay-cielo/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Omnipay: Cielo
==============

[](#omnipay-cielo)

(Versão imcompleta de teste)

Este projeto visa implementar o gateway de pagamentos da Cielo no padrão [Omnipay](https://github.com/omnipay/omnipay).

Instalação
----------

[](#instalação)

A instalação é feita via [Composer](http://getcomposer.org/). Instale esse pacote juntamente com o pacote base do Omnipay (`league/omnipay`).

```
composer require league/omnipay verdadeiro-mestre/omnipay-cielo

```

Como usar
---------

[](#como-usar)

O seguinte gateway é fornecido por este pacote:

- [Cielo](https://cielo.com.br/)

para a documentação das APIs da Cielo acesse:

#### Organização

[](#organização)

Foram criadas algumas **classes** para facilitar a organização dos dados:

```
use Omnipay\Cielo\Models\Address;
use Omnipay\Cielo\Models\Customer;
use Omnipay\Cielo\Models\CreditCard; //A classe CreditCard do Omnipay\Common não atendia aos uso necessário
use Omnipay\Cielo\Models\Payment;
```

### Exemplos de utilização

[](#exemplos-de-utilização)

#### Realizando transação com cartão de crédito

[](#realizando-transação-com-cartão-de-crédito)

```
//Criando o gateway da Cielo por meio do Omnipay
$gateway = Omnipay::create("Cielo");

// inicializando o gateway
$gateway->initialize(array(
    "merchantId"        => "MyMerchantId",
    "merchantKey"       => "MyMerchantKey",
));

$address = new Address(array(
      "Street"          => "Rua Teste",
      "Number"          => "123",
      "Complement"      => "AP 123",
      "ZipCode"         => "12345987",
      "District"        => "Centro"
      "City"            => "Rio de Janeiro",
      "State"           => "RJ",
      "Country"         => "BRA"
));

$customer = new Customer(array(
      "Name"            => "Comprador Teste",
      "Identity"        => "1234567890",
      "Address"         => $address
));

$card = new CreditCard(array(
    "Holder"            => "Teste Holder",
    "CardNumber"        => "4012888888881881",
    "SecurityCode"      => "123",
    "ExpirationDate"    => "12/2030",
    "SaveCard"          => "false",
    "Brand"             => "Visa",
));

$payment = new Payment(array(
    "Type"              => "CreditCard",
    "Amount"            => "10.00",
    "Installments"      => 1,
    "CreditCard"        => $card,
));

//Realizando a transação
// o metodo purchase realiza a transação
// e o metodo authorize apenas autoriza a transação
$response = $gateway->purchase(array(
    "MerchantOrderId"   => "123456",
    "Customer"          => $customer,
    "Payment"           => $payment
))->send();

if($response->isSuccessful()){
    return $response->getData();
}
```

#### Realizando transação com boleto

[](#realizando-transação-com-boleto)

```
//Criando o gateway da Cielo por meio do Omnipay
$gateway = Omnipay::create("Cielo");

// inicializando o gateway
$gateway->initialize(array(
    "merchantId"        => "MyMerchantId",
    "merchantKey"       => "MyMerchantKey",
));

$address = new Address(array(
      "Street"          => "Rua Teste",
      "Number"          => "123",
      "Complement"      => "AP 123",
      "ZipCode"         => "12345987",
      "District"        => "Centro",
      "City"            => "Rio de Janeiro",
      "State"           => "RJ",
      "Country"         => "BRA"
));

$customer = new Customer(array(
      "Name"            => "Comprador Teste",
      "Identity"        => "1234567890",
      "Address"         => $address
));

$payment = new Payment(array(
    "Type"              => "Boleto",
    "Amount"            => 15700,
    "Provider"          => "Bradesco2",
    "Address"           => "Rua Teste",
    "BoletoNumber"      => "123",
    "Assignor"          => "Empresa Teste",
    "Demonstrative"     => "Desmonstrative Teste",
    "ExpirationDate"    => "2020-12-31",
    "Identification"    => "11884926754",
    "Instructions"      => "Aceitar somente até a data de vencimento, após essa data juros de 1% dia."
));

//Realizando a transação
// o metodo purchase realiza a transação
// e o metodo authorize apenas autoriza a transação
$response = $gateway->purchase(array(
    "MerchantOrderId"   => "123456",
    "Customer"          => $customer,
    "Payment"           => $payment
))->send();

if($response->isSuccessful()){
    return $response->getData();
}
```

#### Tokenização de cartão

[](#tokenização-de-cartão)

```
//Criando o gateway da Cielo por meio do Omnipay
$gateway = Omnipay::create("Cielo");

// inicializando o gateway
$gateway->initialize(array(
    "merchantId"        => "MyMerchantId",
    "merchantKey"       => "MyMerchantKey",
));

$response = $gateway->createCardToken(array(
    "CustomerName"      => "Armando",
    "CardNumber"        => "4012888888881881",
    "Holder"            => "Teste Holder",
    'ExpirationDate'    => '12/2030',
    'Brand'             => 'Visa'
))->send();

if($response->isSuccessful()){
    return $response->getData();
}
```

### Modo de teste

[](#modo-de-teste)

Para ativar o modo sandbox das APIs da Cielo faça da seguinte forma:

```
$gateway->initialize(array(
    "testMode"      => true,    //Habilita o modo sandbox
    "merchantId"        => "MyMerchantId",
    "merchantKey"       => "MyMerchantKey",
));
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

803d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/79837bd9432e575c99be9d8d8e31dd76de9bd15e5031092c8a90e06dc5c4ffdf?d=identicon)[VerdadeiroMestre](/maintainers/VerdadeiroMestre)

---

Top Contributors

[![VerdadeiroMestre](https://avatars.githubusercontent.com/u/69682614?v=4)](https://github.com/VerdadeiroMestre "VerdadeiroMestre (1 commits)")

### Embed Badge

![Health badge](/badges/verdadeiro-mestre-omnipay-cielo/health.svg)

```
[![Health](https://phpackages.com/badges/verdadeiro-mestre-omnipay-cielo/health.svg)](https://phpackages.com/packages/verdadeiro-mestre-omnipay-cielo)
```

###  Alternatives

[league/omnipay

Omnipay payment processing library

6.1k9.7M166](/packages/league-omnipay)[silverstripe/silverstripe-omnipay

SilverStripe Omnipay Payment Module

38106.0k15](/packages/silverstripe-silverstripe-omnipay)

PHPackages © 2026

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