PHPackages                             versatecnologia/maxipago - 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. versatecnologia/maxipago

ActiveLibrary[Payment Processing](/categories/payments)

versatecnologia/maxipago
========================

maxiPago! Smart Payments - PHP library for our payment gateway

093.6k3[1 PRs](https://github.com/versatecnologia/maxipago/pulls)PHP

Since Apr 11Pushed 2y ago2 watchersCompare

[ Source](https://github.com/versatecnologia/maxipago)[ Packagist](https://packagist.org/packages/versatecnologia/maxipago)[ RSS](/packages/versatecnologia-maxipago/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Introduction
------------

[](#introduction)

This PHP library allows for easy integration with the **maxiPago! Smart Payments** API. Our payment platform allows online merchants to accept payments in many countries in Latin America and the US and includes such functionalities as Automated Recurring Billing, "Single-Click" payments, Online Returns, Credit Card Payment Reconciliation, Fraud Tools and more. You can find out more about **maxiPago!** by visiting [www.maxipago.com](http://www.maxipago.com/).

This library has all the functionalities currently available through our XML-based API and can be freely copied and used by Merchants and developers.

You can get a more comprehensive view of our API by looking at our documentation, [which can be downloaded here](http://www.maxipago.com/docs/maxiPago_API_Latest.pdf). If you are looking for a hosted payment page solution, please see the section ***smartPages!*** in the documentation.

Available transaction types
---------------------------

[](#available-transaction-types)

- **Authorization:** checks if the credit card used is valid (number, security code and expiration date) and if the card holder has sufficient funds for that purchase.
- **Capture:** confirms the authorization previously made and completes the transaction. If the transaction is never captured the Merchant does not receive the funds and the Card Holder is never charged.

> *Separating the authorization and capture in two different moments is an excellent way to check if you have the purchased items in stock or to run a fraud check, while still guaranteeing payment.*

- **Sale:** combines the authorization and the capture in a single request. When performing a Sale we send the credit card for authorization and immediately capture that transaction, if approved.
- **Void:** cancels the transaction and no money is charged from the buyer. You can only void a transaction until 11:59pm of the day of capture.
- **Return:** reverses a credit card transaction, taking funds from the Merchant and giving them back to the buyer. This is a financial operation that might take a few days to be completed, depending on your credit card processor.
- **Recurring:** schedules a credit card transaction to be charged at a specific interval, defined by the Merchant.
- **Card On File:** saves a card in our system and returns a unique token, which can be used to process future transactions. **This allows the implementation of "single-click" payments.**
- **Boleto:** *(Brazil only)* Transactions made with Boletos are different than credit card purchases. This creates a boleto and returns an URL to the buyer to access the boleto payment slip. It can be accessed at any time before the boleto expiration and up to 60 days after it has expired.

Installation and setup
----------------------

[](#installation-and-setup)

The library has been tested on **PHP 5.1.6 and up** and consists of the following files:

```
  /lib/
  |-- maxiPago.php
  |-- maxipago
    |-- maxiPagoRequest.php
    |-- maxiPagoRequestBase.php
    |-- maxiPagoResponseBase.php
    |-- maxiPagoServiceBase.php
    |-- maxiPagoTransaction.php
    |-- maxiPagoXmlHandler.php

```

Copy **/lib/maxipago/** to your local server. In your code, include the **maxiPago.php** file, which checks the minimum requirements and includes the other necessary files:

```
require_once "./lib/maxiPago.php"
```

Now, create a new object from the maxiPago class:

```
$maxiPago = new maxiPago;
```

Environment and Credentials
---------------------------

[](#environment-and-credentials)

In order to send requests you will need valid Merchant Credentials. They can be obtained with our Customer Support team.

**maxiPago!** provides a fully functional sandbox environment to simulate the transaction responses. You need to set the environment the transactions will be sent to, which can be done by sending either **"TEST"** or **"LIVE"**.

To set the credentials and environment used to process requests:

```
$maxiPago->setCredentials("100", "merchant_key");
$maxiPago->setEnvironment("TEST");
```

Logging and Debug Mode
----------------------

[](#logging-and-debug-mode)

In June 2013 [Kenny Katzgrau's KLogger](https://github.com/katzgrau/KLogger) was added to this lib, allowing merchants to automatically log the transactions' request and response, following PCI compliance.

To enable logging use the **setLogger()** method, making sure your log file directory permissions are correct. The default logger level is INFO:

```
    $maxiPago->setLogger(dirname(__FILE__).'/logs','INFO');
```

The Debug Mode prints the request and response XML's so you can easily identify any issues with the request. In order to enable debug use the **setDebug()** method:

```
	$maxiPago->setDebug(true);
```

Request
-------

[](#request)

To send a request to **maxiPago!** you need to call one of the methods listed above, passing an array with the request parameters, as such:

```
	$data = array(
		"processorID" => "1",
		"referenceNum" => "ORDER2937283",
		"chargeTotal" => "10.00",
		"number" => "4111111111111111",
		"expMonth" => "07",
		"expYear" => "2017",
		"cvvNumber" => "123"
	);

	$maxiPago->creditCardAuth($data);
```

Response
--------

[](#response)

There are methods to get each piece of information from the response. However, you can also call the **getResult()** method to retrieve all fields in the response as an array:

```
	print_r($maxiPago->getResult());

	Array
	(
	    [authCode] => 123456
	    [orderID] => 0AF90437:013CC42DDE87:F5D0:01E1101A
	    [referenceNum] => ORD29328493
	    [transactionID] => 422570
	    [transactionTimestamp] => 1312156800
	    [responseCode] => 0
	    [responseMessage] => AUTHORIZED
	    [avsResponseCode] =>
	    [cvvResponseCode] =>
	    [processorCode] => A
	    [processorMessage] => APPROVED
	    [errorMessage] =>
	)

```

All request methods
-------------------

[](#all-request-methods)

\#####Credit Card Transactions#####

- Authorization: **creditCardAuth()**
- Capture: **creditCardCapture()**
- Sale (Authorization + Capture): **creditCardSale()**
- Automatically save card: **creditCardAuth() or creditCardSale()**
- Void: **creditCardVoid()**
- Refund: **creditCardRefund()**

\#####Recurring Transactions#####

- Create recurring credit card billing: **createRecurring()**
- Cancel a recurring billing: **cancelRecurring()**

\#####Boleto Transactions#####

- Create boleto payment slip (Brazil only): **boletoSale()**

\#####Reports#####

- Query one single transaction: **pullReport()**
- Query a list of transactions: **pullReport()**
- Flip through pages of a transaction list: **pullReport()**
- Query a pending report: **pullReport()**

\#####Customer Profile / Card On File#####

- Create a profile *(a profile must be created to save a card)*: **addProfile()**
- Update a profile: **updateProfile()**
- Remove a profile: **deleteProfile()**
- Add a credit card: **addCreditCard()**
- Remove a credit card: **deleteCreditCard()**

All response methods
--------------------

[](#all-response-methods)

\#####Request validators#####

- Checks if there was an error in the request: **isErrorResponse()**
- Checks if the request was successful: **isTransactionResponse()**

\#####Main transaction response methods#####

- Gets the Response Code (transactions/orders): **getResponseCode()**
- Gets the Authorization Code, if any was replied: **getAuthCode()**
- Gets the Order ID created: **getOrderID()**
- Gets the Transaction ID created: **getTransactionID()**
- Gets the URL for the Boleto issued *(Brazil only)*: **getBoletoUrl()**
- Gets the Processor Code: **getProcessorCode()**
- Gets the Processor Reference Number: **getProcessorReferenceNumber()**
- Gets the Processor Transaction ID: **getProcessorTransactionID()**
- Gets an array with all response fields: **getResult()**

\#####Other transaction response methods#####

- Gets the AVS Response Code *(US only)*: **getAvsResponseCode()**
- Gets the Command used in the request: **getCommand()**
- Gets the Customer ID created: **getCustomerId()**
- Gets the CVV Response Code *(US only)*: **getCvvResponseCode()**
- Gets the Fraud Score analysis: **getFraudScore()**
- Gets the Response Message: **getMessage()**
- Gets the report's number of pages: **getNumberOfPages()**
- Gets the report's current page: **getPageNumber()**
- Gets the report's page token: **getPageToken()**
- Gets the transaction list as array: **getReportResult()**
- Gets the report's time: **getTime()**
- Gets the Credit Card Token created: **getToken()**
- Gets the number of transactions in a report: **getTotalNumberOfRecords()**
- Gets the Transaction Unix time: **getTransactionTimestamp()**

Documentation and Support
-------------------------

[](#documentation-and-support)

[**maxiPago!**'s full API documentation can be found here](http://www.maxipago.com/docs/maxiPago_API_Latest.pdf).

Our support team is happy to help you with any questions you might have, be it about the functionalities of our platform or about payments in general. They are available to customers and non-customers alike and can be reached at support \[@\] maxipago \[.\] com.

License
-------

[](#license)

Library for integration with the **maxiPago! Payment Gateway**
***Copyright (C) 2013, maxiPago!***

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see .

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/88093c01dfc057f319893882d3f91d20bdaf9b2e1101bb9049fd903f3ca7f1df?d=identicon)[versatecnologia](/maintainers/versatecnologia)

---

Top Contributors

[![leonardoweslei](https://avatars.githubusercontent.com/u/942453?v=4)](https://github.com/leonardoweslei "leonardoweslei (11 commits)")[![tcana1](https://avatars.githubusercontent.com/u/3525362?v=4)](https://github.com/tcana1 "tcana1 (8 commits)")[![rquadling](https://avatars.githubusercontent.com/u/12801?v=4)](https://github.com/rquadling "rquadling (6 commits)")[![JonatanMatschulat](https://avatars.githubusercontent.com/u/2152426?v=4)](https://github.com/JonatanMatschulat "JonatanMatschulat (5 commits)")[![zanaca](https://avatars.githubusercontent.com/u/122560?v=4)](https://github.com/zanaca "zanaca (3 commits)")[![pedrocasado](https://avatars.githubusercontent.com/u/354624?v=4)](https://github.com/pedrocasado "pedrocasado (1 commits)")[![daneoshiga](https://avatars.githubusercontent.com/u/917634?v=4)](https://github.com/daneoshiga "daneoshiga (1 commits)")

### Embed Badge

![Health badge](/badges/versatecnologia-maxipago/health.svg)

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

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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