PHPackages                             igedeon/laravel-wompi - 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. igedeon/laravel-wompi

ActiveLibrary[Payment Processing](/categories/payments)

igedeon/laravel-wompi
=====================

Laravel integration for Wompi Colombia Web Checkout payment gateway

v1.0.1(6d ago)07↓100%MITPHPPHP ^8.4CI passing

Since Mar 17Pushed 6d agoCompare

[ Source](https://github.com/IGedeon/laravel-wompi)[ Packagist](https://packagist.org/packages/igedeon/laravel-wompi)[ RSS](/packages/igedeon-laravel-wompi/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (7)Versions (3)Used By (0)

Wompi Laravel
=============

[](#wompi-laravel)

[![Tests](https://github.com/igedeon/laravel-wompi/actions/workflows/tests.yml/badge.svg)](https://github.com/igedeon/laravel-wompi/actions/workflows/tests.yml)[![Latest Version on Packagist](https://camo.githubusercontent.com/7311c3194e45e7908875d7782d5e23105b7360da09a271d56c928b9d5b697561/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f69676564656f6e2f6c61726176656c2d776f6d70692e737667)](https://packagist.org/packages/igedeon/laravel-wompi)[![Total Downloads](https://camo.githubusercontent.com/f98150e03ccb5a0711e538b795e94792eac7adab6afa86381bdd62efcb48d83f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f69676564656f6e2f6c61726176656c2d776f6d70692e737667)](https://packagist.org/packages/igedeon/laravel-wompi)[![PHP Version](https://camo.githubusercontent.com/8616f251efe082a427cc10d1a526cfefb63f37a0d408dad951f04cf2faec282d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f69676564656f6e2f6c61726176656c2d776f6d70692e737667)](https://packagist.org/packages/igedeon/laravel-wompi)[![License](https://camo.githubusercontent.com/cbbca10b22ffd86d767ed61a7306f4ce2f39d77db8fd3666b254bced9d5d8efc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f69676564656f6e2f6c61726176656c2d776f6d70692e737667)](https://packagist.org/packages/igedeon/laravel-wompi)

Paquete Laravel para integrar [Wompi Colombia](https://wompi.co) en modalidad **Web Checkout**: links de pago, widget embebido, redirección, consulta de transacciones y webhooks con verificación de firma.

Requisitos
----------

[](#requisitos)

- PHP 8.4+
- Laravel 12+

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

[](#instalación)

```
composer require igedeon/laravel-wompi
```

Publicar la configuración:

```
php artisan vendor:publish --tag=wompi-config
```

Configuración
-------------

[](#configuración)

Agrega las siguientes variables a tu archivo `.env`:

```
WOMPI_ENVIRONMENT=sandbox
WOMPI_PUBLIC_KEY=pub_test_xxxxxxxxxxxxxxxx
WOMPI_PRIVATE_KEY=prv_test_xxxxxxxxxxxxxxxx
WOMPI_EVENTS_SECRET=test_events_xxxxxxxxxxxxxxxx
WOMPI_INTEGRITY_SECRET=test_integrity_xxxxxxxxxxxxxxxx
```

Para producción, cambia el ambiente y usa las llaves correspondientes:

```
WOMPI_ENVIRONMENT=production
WOMPI_PUBLIC_KEY=pub_prod_xxxxxxxxxxxxxxxx
WOMPI_PRIVATE_KEY=prv_prod_xxxxxxxxxxxxxxxx
WOMPI_EVENTS_SECRET=prod_events_xxxxxxxxxxxxxxxx
WOMPI_INTEGRITY_SECRET=prod_integrity_xxxxxxxxxxxxxxxx
```

### Opciones adicionales

[](#opciones-adicionales)

```
WOMPI_WEBHOOK_PATH=wompi/webhook    # Ruta del webhook (por defecto: wompi/webhook)
WOMPI_CURRENCY=COP                  # Moneda por defecto
```

Uso
---

[](#uso)

### Links de pago

[](#links-de-pago)

#### Crear un link de pago

[](#crear-un-link-de-pago)

```
use IGedeon\WompiLaravel\Facades\Wompi;
use IGedeon\WompiLaravel\DTOs\PaymentLinkData;

$link = Wompi::paymentLinks()->create(new PaymentLinkData(
    name: 'Orden #123',
    description: 'Compra de productos',
    singleUse: true,
    collectShipping: false,
    amountInCents: 5000000, // $50,000 COP
));

// URL para compartir con el cliente
$url = $link->checkoutUrl();
// https://checkout.wompi.co/l/abc-123-def

// ID del link
$id = $link->id;
```

#### Parámetros opcionales

[](#parámetros-opcionales)

```
$link = Wompi::paymentLinks()->create(new PaymentLinkData(
    name: 'Orden #456',
    description: 'Suscripción mensual',
    singleUse: false,
    collectShipping: true,
    amountInCents: 15000000,
    currency: 'COP',
    expiresAt: '2026-12-31T23:59:59.000Z',
    redirectUrl: 'https://mitienda.com/gracias',
    imageUrl: 'https://mitienda.com/logo.png',
    sku: 'PROD-456',
    taxes: [
        ['type' => 'VAT', 'amount_in_cents' => 2380952],
    ],
));
```

#### Consultar un link de pago

[](#consultar-un-link-de-pago)

```
$link = Wompi::paymentLinks()->find('abc-123-def');

echo $link->name;
echo $link->amountInCents;
echo $link->active; // true o false
```

### Transacciones

[](#transacciones)

#### Consultar una transacción

[](#consultar-una-transacción)

```
use IGedeon\WompiLaravel\Enums\TransactionStatus;

$transaction = Wompi::transactions()->find('12345-txn-id');

echo $transaction->id;
echo $transaction->status;          // TransactionStatus enum
echo $transaction->amountInCents;
echo $transaction->reference;
echo $transaction->paymentMethodType;

if ($transaction->status === TransactionStatus::Approved) {
    // Pago exitoso
}

// Verificar si el estado es final
if ($transaction->status->isFinal()) {
    // No cambiará más
}
```

#### Estados de transacción

[](#estados-de-transacción)

EstadoDescripciónFinal`PENDING`En procesoNo`APPROVED`Pago exitosoSí`DECLINED`RechazadaSí`VOIDED`AnuladaSí`ERROR`Error internoSí### Información del comercio

[](#información-del-comercio)

```
$merchant = Wompi::merchants()->get();

echo $merchant->name;
echo $merchant->legalName;
echo $merchant->acceptanceToken;           // Token de aceptación de términos
echo $merchant->acceptancePersonalAuth;    // Token de autorización de datos personales
```

### Widget de pago (Blade)

[](#widget-de-pago-blade)

Incluye el widget de Wompi directamente en tus vistas Blade. La firma de integridad se genera automáticamente en el servidor.

```

```

#### Con datos del cliente y expiración

[](#con-datos-del-cliente-y-expiración)

```

```

### Formulario de redirección (Blade)

[](#formulario-de-redirección-blade)

Si prefieres redirigir al usuario a la página de Wompi en lugar de usar el widget embebido:

```

    Pagar con Wompi

```

### Firma de integridad (manual)

[](#firma-de-integridad-manual)

Si necesitas generar la firma de integridad manualmente (por ejemplo, para una integración JavaScript personalizada):

```
$hash = Wompi::integrityHash(
    reference: 'orden-123',
    amountInCents: 5000000,
    currency: 'COP',
);

// Con tiempo de expiración
$hash = Wompi::integrityHash(
    reference: 'orden-123',
    amountInCents: 5000000,
    currency: 'COP',
    expirationTime: '2026-12-31T23:59:59.000Z',
);
```

Webhooks
--------

[](#webhooks)

El paquete registra automáticamente una ruta POST en `/wompi/webhook` (configurable) que:

1. Verifica la firma SHA-256 del evento
2. Despacha eventos de Laravel según el estado de la transacción

### Configuración en Wompi

[](#configuración-en-wompi)

En el dashboard de Wompi, configura la URL de eventos apuntando a:

```
https://tudominio.com/wompi/webhook

```

### Escuchar eventos

[](#escuchar-eventos)

Registra listeners en tu aplicación para reaccionar a los eventos:

```
// app/Providers/EventServiceProvider.php o usando el atributo #[Listener]

use IGedeon\WompiLaravel\Events\TransactionApproved;
use IGedeon\WompiLaravel\Events\TransactionDeclined;
use IGedeon\WompiLaravel\Events\TransactionVoided;
use IGedeon\WompiLaravel\Events\TransactionError;
use IGedeon\WompiLaravel\Events\WompiWebhookReceived;
```

```
// Ejemplo de listener
class ConfirmOrderListener
{
    public function handle(TransactionApproved $event): void
    {
        $transaction = $event->transaction;

        // $transaction->id
        // $transaction->reference
        // $transaction->amountInCents
        // $transaction->status (TransactionStatus::Approved)
        // $transaction->raw (array completo de la respuesta)
    }
}
```

### Eventos disponibles

[](#eventos-disponibles)

EventoCuándo se dispara`WompiWebhookReceived`Siempre (para logging/auditoría)`TransactionApproved`Transacción aprobada`TransactionDeclined`Transacción rechazada`TransactionVoided`Transacción anulada`TransactionError`Error en la transacción### Middleware adicional

[](#middleware-adicional)

Puedes agregar middleware adicional a la ruta del webhook vía configuración:

```
// config/wompi.php
'webhook' => [
    'path'       => 'wompi/webhook',
    'middleware'  => ['throttle:60,1'],
],
```

Personalización de vistas
-------------------------

[](#personalización-de-vistas)

Publica las vistas para personalizarlas:

```
php artisan vendor:publish --tag=wompi-views
```

Las vistas se copiarán a `resources/views/vendor/wompi/`.

Manejo de errores
-----------------

[](#manejo-de-errores)

El paquete lanza excepciones específicas:

```
use IGedeon\WompiLaravel\Exceptions\ApiException;
use IGedeon\WompiLaravel\Exceptions\InvalidConfigurationException;
use IGedeon\WompiLaravel\Exceptions\InvalidSignatureException;

try {
    $link = Wompi::paymentLinks()->create($data);
} catch (ApiException $e) {
    $e->getMessage();      // Mensaje de error
    $e->statusCode;        // Código HTTP (401, 422, 500, etc.)
    $e->responseBody;      // Array con la respuesta completa de Wompi
} catch (InvalidConfigurationException $e) {
    // Falta una llave en la configuración
}
```

Testing
-------

[](#testing)

```
./vendor/bin/pest
```

Para usar en tus propios tests con `Http::fake()`:

```
use Illuminate\Support\Facades\Http;

Http::fake([
    '*/payment_links' => Http::response([
        'data' => [
            'id' => 'test-link-id',
            'name' => 'Test',
            'description' => 'Test',
            'single_use' => true,
            'collect_shipping' => false,
            'amount_in_cents' => 5000000,
            'currency' => 'COP',
            'active' => true,
        ],
    ]),
]);
```

Licencia
--------

[](#licencia)

MIT

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance98

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

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

2

Last Release

6d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bd50c731012ef95d6ae90f5f4bd7e90575c1684815871330d52dfb5074a7d573?d=identicon)[IGedeon](/maintainers/IGedeon)

---

Top Contributors

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

---

Tags

colombialaravelpaymentphpwompilaravelpaymentgatewaycheckoutWompicolombia

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/igedeon-laravel-wompi/health.svg)

```
[![Health](https://phpackages.com/badges/igedeon-laravel-wompi/health.svg)](https://phpackages.com/packages/igedeon-laravel-wompi)
```

###  Alternatives

[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4843.9k](/packages/sebdesign-laravel-viva-payments)[omalizadeh/laravel-multi-payment

A driver-based laravel package for online payments via multiple gateways

491.1k](/packages/omalizadeh-laravel-multi-payment)[parsisolution/gateway

A Laravel package for connecting to all Iraninan payment gateways

231.7k](/packages/parsisolution-gateway)[sostheblack/moip

Laravel Package for Moip.

171.9k](/packages/sostheblack-moip)[dena-a/iran-payment

a Laravel package to handle Internet Payment Gateways for Iran Banking System

322.4k](/packages/dena-a-iran-payment)

PHPackages © 2026

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