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 1mo ago

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

25

—

LowBetter than 37% of packages

Maintenance48

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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

383d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/db31e342109dc1c5465cd6940a032b373eecbd46f766e484b94071904791626f?d=identicon)[b2pagos](/maintainers/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

[imdhemy/google-play-billing

Google Play Billing

491.3M5](/packages/imdhemy-google-play-billing)[bitpay/sdk

Complete version of the PHP library for the new cryptographically secure BitPay API

42337.5k4](/packages/bitpay-sdk)[paypayopa/php-sdk

PHP SDK for PayPay Open Payment API

18279.6k3](/packages/paypayopa-php-sdk)[buckaroo/sdk

Buckaroo payment SDK

12189.1k9](/packages/buckaroo-sdk)[yanlongli/app-store-server-api

PHP client for App Store Server API. Manage your customers’ App Store transactions from your server.The App Store Server API is a REST API that you call from your server to request and provide information about your customers' in-app purchases. The App Store signs the transaction and subscription renewal information that this API returns using the JSON Web Signature (JWS) specification.App Store Server API is independent of the app’s installation status on the customer’s devices. The App Store server returns information based on the customer’s in-app purchase history regardless of whether the customer installed, removed, or reinstalled the app on their devices.To request transaction and subscription status information with this API, provide any original transaction identifier that belongs to the customer. The transaction history API responds with a complete list of transactions, 20 at a time, starting with the oldest first. The subscription status API returns the status for all of the customer’s subscriptions, organized by their subscription group identifier.Use the Send Consumption Information endpoint to send information to the App Store when customers request a refund for a consumable in-app purchase, after you receive the CONSUMPTION\_REQUEST App Store server notification. Your data helps inform refund decisions.

2532.0k](/packages/yanlongli-app-store-server-api)[contica/facturador-electronico-cr

Un facturador de código libre para integrar facturación electrónica en Costa Rica a un proyecto PHP

2128.8k](/packages/contica-facturador-electronico-cr)

PHPackages © 2026

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