PHPackages                             b2pagos/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. [Payment Processing](/categories/payments)
4. /
5. b2pagos/sdk

ActiveLibrary[Payment Processing](/categories/payments)

b2pagos/sdk
===========

PHP SDK for integrating with the B2PAGOS payment gateway

v1.0.2(1y ago)00MITPHPPHP &gt;=7.4

Since Apr 30Pushed 1y ago2 watchersCompare

[ Source](https://github.com/b2pagos/sdk-php)[ Packagist](https://packagist.org/packages/b2pagos/sdk)[ RSS](/packages/b2pagos-sdk/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (3)Versions (4)Used By (0)

B2PAGOS PHP SDK
===============

[](#b2pagos-php-sdk)

SDK oficial en PHP para integrarse con la pasarela de pagos **B2PAGOS** de forma sencilla, segura y moderna.

[![Packagist Version](https://camo.githubusercontent.com/aae7e09985d0fbb01bee28fa49b4b2f2153cbc0febebca170f111f58edab18d7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62327061676f732f73646b)](https://camo.githubusercontent.com/aae7e09985d0fbb01bee28fa49b4b2f2153cbc0febebca170f111f58edab18d7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62327061676f732f73646b)[![License](https://camo.githubusercontent.com/5ec6e987528a891252599f09dcaddc37be4a38b1fa66e2be77344e28d00eaf7d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f62327061676f732f73646b)](https://camo.githubusercontent.com/5ec6e987528a891252599f09dcaddc37be4a38b1fa66e2be77344e28d00eaf7d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f62327061676f732f73646b)

---

✨ Características
-----------------

[](#-características)

- Crear transacciones (payment links)
- Autenticación vía JWT o credenciales (user/pass)
- Encriptación de tarjetas vía RSA
- Firmas HMAC para integridad
- 100% orientado a objetos y tipado fuerte
- Compatible con PHP 7.4+ y PHP 8.x

---

📦 Instalación
-------------

[](#-instalación)

```
composer require b2pagos/sdk
```

O si estás en desarrollo local:

```
"repositories": [
  {
    "type": "path",
    "url": "../sdk"
  }
],
"require": {
  "b2pagos/sdk": "*"
}
```

---

🚀 Uso rápido
------------

[](#-uso-rápido)

```
use B2Pagos\B2PClient;

$client = new B2PClient([
    'accountKey' => 'tu-account-key',
    'integrityKey' => 'tu-integrity-key',
    'username' => 'tu-email@b2pagos.com',
    'password' => 'tu-password',
    'apiUrl' => 'https://sandbox.b2pagos.com',
    'verifySSL' => false // true en producción
]);

$transaction = $client->createTransaction([
    'accountId'   => 'acct_123',
    'reference'   => 'ref_456',
    'description' => 'Compra online',
    'amount'      => 10000,
    'taxValue'    => 0,
    'taxBase'     => 0,
    'currency'    => 'COP'
]);

print_r($transaction);
```

---

📊 Métodos disponibles
---------------------

[](#-métodos-disponibles)

MétodoDescripción`createTransaction()`Crea un link de pago`getUserToken()`Login por email y password`getJwt()`Genera JWT con `integrityKey``EncryptionUtils::encryptRSA()`Encripta datos con RSA`EncryptionUtils::getPublicKey()`Obtiene la clave pública desde API`SignatureUtils::generateSignature()`Firma HMAC-SHA256 de un payload---

🔐 Seguridad
-----------

[](#-seguridad)

- Las claves deben mantenerse privadas.
- En sandbox puedes usar `verifySSL => false`, en producción siempre `true`.
- Tokens tienen expiración corta (30 segundos).

---

🔬 Requisitos
------------

[](#-requisitos)

- PHP &gt;= 7.4
- Extensiones: `curl`, `openssl`, `mbstring`, `json`

---

🤝 Contribuir
------------

[](#-contribuir)

¡Pull requests bienvenidos! Crea un `issue` primero si quieres discutir una funcionalidad o bug.

---

📝 Licencia
----------

[](#-licencia)

MIT License - B2Pagos (c) 2025

---

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance45

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity40

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

Every ~0 days

Total

3

Last Release

429d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/209556837?v=4)[b2pagos](/maintainers/b2pagos)[@b2pagos](https://github.com/b2pagos)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/b2pagos-sdk/health.svg)

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

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k108.5M884](/packages/laravel-socialite)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[ellaisys/aws-cognito

Laravel Authentication using AWS Cognito (Web and API)

123256.9k1](/packages/ellaisys-aws-cognito)[firefly-iii/data-importer

Firefly III Data Import Tool.

8045.8k](/packages/firefly-iii-data-importer)

PHPackages © 2026

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