PHPackages                             descubraomundo/omnipay-pagarme - 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. descubraomundo/omnipay-pagarme

ActiveLibrary[Payment Processing](/categories/payments)

descubraomundo/omnipay-pagarme
==============================

Pagarme driver for the Omnipay payment processing library

v3.1(6y ago)2544.3kMIT

Since Aug 7Compare

[ Source](https://github.com/descubraomundo/omnipay-pagarme)[ Packagist](https://packagist.org/packages/descubraomundo/omnipay-pagarme)[ Docs](https://github.com/descubraomundo/omnipay-pagarme)[ RSS](/packages/descubraomundo-omnipay-pagarme/feed)WikiDiscussions Synced today

READMEChangelog (8)Dependencies (4)Versions (15)Used By (0)

Omnipay: Pagar.Me
=================

[](#omnipay-pagarme)

**Pagar.Me gateway for the Omnipay PHP payment processing library**

[![Build Status](https://camo.githubusercontent.com/16880860dff1fdab9bcb1ebd3c5044f091a199a002f2859798b3f4634a9dbf71/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f64657363756272616f6d756e646f2f6f6d6e697061792d70616761726d652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/descubraomundo/omnipay-pagarme) [![Code Climate](https://camo.githubusercontent.com/ccb24fcec0b67ad444cfc3f684a21fe7e3d32a0a038c9a96d15b4d1b23d3b9c8/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f64657363756272616f6d756e646f2f6f6d6e697061792d70616761726d652f6261646765732f6770612e737667)](https://codeclimate.com/github/descubraomundo/omnipay-pagarme) [![Test Coverage](https://camo.githubusercontent.com/3e7f8fc43398d71fd2b7196ac6b0dcbea8da475a1c05c38cf94c855ec16196a6/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f64657363756272616f6d756e646f2f6f6d6e697061792d70616761726d652f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/descubraomundo/omnipay-pagarme/coverage)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b75f9641fa1e510c240a7323715aa4fa7f14a66deed90cfc7aa84a734338530f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64657363756272616f6d756e646f2f6f6d6e697061792d70616761726d652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/descubraomundo/omnipay-pagarme)[![Total Downloads](https://camo.githubusercontent.com/d324600e9934bbac488d7ff39ebe8a5beb669e4b7a482d47c564681c92fe91c0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64657363756272616f6d756e646f2f6f6d6e697061792d70616761726d652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/descubraomundo/omnipay-pagarme)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

[Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements Pagar.Me support for Omnipay.

Install
-------

[](#install)

Via Composer

```
$ composer require descubraomundo/omnipay-pagarme
```

Basic Usage
-----------

[](#basic-usage)

The following gateways are provided by this package:

- [Pagar.Me](https://pagar.me/)

For general usage instructions, please see the main [Omnipay](https://github.com/thephpleague/omnipay) repository.

### Example with Credit Card

[](#example-with-credit-card)

```
// Create a gateway for the Pagarme Gateway
  // (routes to GatewayFactory::create)
  $gateway = Omnipay::create('Pagarme');

  // Initialise the gateway
  $gateway->initialize(array(
      'apiKey' => 'MyApiKey',
  ));

  // Create a credit card object
  // This card can be used for testing.
  $card = new CreditCard(array(
              'firstName'    => 'Example',
              'lastName'     => 'Customer',
              //'name'         => 'Example Customer',
              'birthday'     => '1988-02-28',
              'gender'       => 'M',
              'number'       => '4242424242424242',
              'expiryMonth'  => '01',
              'expiryYear'   => '2020',
              'cvv'          => '123',
              'email'        => 'customer@example.com',
              'address1'     => 'Street name, Street number, Complementary',
              'address2'     => 'Neighborhood',
              'postcode'     => '05443100',
              'phone'        => '19 3242 8855',
              'holder_document_number' => '246.375.149-23', // CPF or CNPJ
  ));

  // Do an authorize transaction on the gateway
  $transaction = $gateway->authorize(array(
      'amount'           => '10.00',
      'soft_descriptor'  => 'test', // 13 characters allowed
      'payment_method'   => 'credit_card',
      'installments'     => 5,
      'postback_url'     => 'http://application.com/api/',
      'card'             => $card,
      // 'card_hash'      => 'card_k5sT...',
      // 'card_id'        => 254786,
      'metadata'         => array(
                                'product_id' => 'ID1111',
                                'invoice_id' => 'IV2222',
                            ),
  ));
  $response = $transaction->send();
  if ($response->isSuccessful()) {
      echo "Authorize transaction was successful!\n";
      $sale_id = $response->getTransactionReference();
      $customer_id = $response->getCustomerReference();
      $card_id = $response->getCardReference();
      echo "Transaction reference = " . $sale_id . "\n";
  }
```

### Example with Boleto

[](#example-with-boleto)

```
// Create a gateway for the Pagarme Gateway
  // (routes to GatewayFactory::create)
  // Create array with customer data
  $customer = array(
              'firstName'    => 'Example',
              'lastName'     => 'Customer',
              //'name'         => 'Example Customer',
              'email'        => 'customer@example.com',
              'address1'     => 'Street name, Street number, Complementary',
              'address2'     => 'Neighborhood',
              'postcode'     => '05443100',
              'phone'        => '19 3242 8855',
              'holder_document_number => '246.375.149-23', // CPF or CNPJ
  ));

  // Do an authorize transaction on the gateway
  $transaction = $gateway->authorize(array(
      'amount'           => '10.00',
      'soft_descriptor'  => 'test',
      'payment_method'   => 'boleto',
      'postback_url'     => 'http://application.com/api/',
      'customer'         => $customer,
      'metadata'         => array(
                                'product_id' => 'ID1111',
                                'invoice_id' => 'IV2222',
                            ),
  ));
  $response = $transaction->send();
  if ($response->isSuccessful()) {
      echo "Authorize Boleto transaction was successful!\n";
      $sale_id = $response->getTransactionReference();
      $boleto = $response->getBoleto();
      echo "Boleto Url = " . $boleto['boleto_url'];
      echo "Boleto Barcode = " . $boleto['boleto_barcode'];
      echo "Boleto Expiration Date = " . $boleto['boleto_expiration_date'];
      echo "Transaction reference = " . $sale_id . "\n";
  }
```

Docs
----

[](#docs)

Read the full Classes Documentation [here](http://descubraomundo.github.io/omnipay-pagarme)

Test Mode
---------

[](#test-mode)

Pagar.Me accounts have test-mode API keys as well as live-mode API keys. Data created with test-mode credentials will never hit the credit card networks and will never cost anyone money.

Unlike some gateways, there is no test mode endpoint separate to the live mode endpoint, the Pagar.Me API endpoint is the same for test and for live.

Support
-------

[](#support)

If you are having general issues with Omnipay, we suggest posting on [Stack Overflow](http://stackoverflow.com/). Be sure to add the [omnipay tag](http://stackoverflow.com/questions/tagged/omnipay) so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a [mailing list](https://groups.google.com/forum/#!forum/omnipay) which you can subscribe to.

If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/descubraomundo/omnipay-pagarme/issues), or better yet, fork the library and submit a pull request.

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity71

Established project with proven stability

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 ~114 days

Recently: every ~180 days

Total

14

Last Release

2495d ago

Major Versions

v1.4.0 → 2.x-dev2017-09-15

v1.4.1 → v2.4.12017-09-15

v2.4.1 → v3.02019-08-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d0a2a9c76a119d1fc79a79ba5a3eaabf1292ae867e0fd1043bd3945309c2c09?d=identicon)[descubraomundo](/maintainers/descubraomundo)

---

Tags

paymentgatewaypaymerchantomnipaypagar.me

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/descubraomundo-omnipay-pagarme/health.svg)

```
[![Health](https://phpackages.com/badges/descubraomundo-omnipay-pagarme/health.svg)](https://phpackages.com/packages/descubraomundo-omnipay-pagarme)
```

###  Alternatives

[lokielse/omnipay-alipay

Alipay gateway for Omnipay payment processing library

586422.8k11](/packages/lokielse-omnipay-alipay)[omnipay/mollie

Mollie driver for the Omnipay payment processing library

631.8M10](/packages/omnipay-mollie)[sudiptpa/omnipay-nabtransact

National Australia Bank (NAB) Transact driver for the Omnipay payment processing library.

1019.5k](/packages/sudiptpa-omnipay-nabtransact)[lucassmacedo/omnipay-mercadopago

MercadoPago gateway for OmniPay

155.4k](/packages/lucassmacedo-omnipay-mercadopago)

PHPackages © 2026

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