PHPackages                             krugerdavid/laravel-bancard - 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. krugerdavid/laravel-bancard

ActiveLibrary

krugerdavid/laravel-bancard
===========================

Laravel integration for Bancard VPOS 2.0 (Single Buy, Cards, Charge)

v1.0.0(2w ago)00MITPHPPHP ^8.1CI passing

Since Mar 9Pushed 2w agoCompare

[ Source](https://github.com/krugerdavid/laravel-bancard)[ Packagist](https://packagist.org/packages/krugerdavid/laravel-bancard)[ RSS](/packages/krugerdavid-laravel-bancard/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (5)Versions (2)Used By (0)

Bancard VPOS 2.0 for Laravel
============================

[](#bancard-vpos-20-for-laravel)

Laravel integration for Bancard VPOS 2.0 (Single Buy, Cards, Charge). Basado en la [documentación oficial Bancard](https://comercios.bancard.com.py) eCommerce Single Buy v1.22.

Requisitos
----------

[](#requisitos)

- PHP 8.1+
- Laravel 10, 11 o 12
- GuzzleHTTP 7.x

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

[](#instalación)

```
composer require krugerdavid/laravel-bancard
```

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

[](#configuración)

Publicar la config:

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

Variables de entorno (.env):

```
BANCARD_PUBLIC_KEY=tu_clave_publica_32_caracteres
BANCARD_PRIVATE_KEY=tu_clave_privada_40_caracteres
BANCARD_STAGING=true
BANCARD_TIMEOUT=30

```

Uso
---

[](#uso)

### Pago ocasional (Single Buy)

[](#pago-ocasional-single-buy)

Inicia un pago y obtén el `process_id` para el iframe de checkout:

```
use KrugerDavid\Bancard\Facades\Bancard;

$result = Bancard::singleBuy(
    shopProcessId: 54322,
    amount: '10330.00',
    description: 'Ejemplo de pago',
    returnUrl: 'https://tusitio.com/finish'
);

// $result['process_id'] → usar en Bancard.Checkout.createForm()
// $result['status'] → 'success'
```

Opciones adicionales:

```
Bancard::singleBuy(54322, '10330.00', 'Pago', 'https://x.com/finish', [
    'cancel_url' => 'https://x.com/cancel',
    'additional_data' => '099VS ORO000045',  // promociones
    'iva_amount' => '1033.00',
    'preauthorization' => 'S',
    'extra_response_attributes' => ['payment_card_type'],
]);
```

### Pago con Zimple

[](#pago-con-zimple)

```
$result = Bancard::singleBuyZimple(
    shopProcessId: 54322,
    amount: '10330.00',
    description: 'Pago Zimple',
    returnUrl: 'https://tusitio.com/finish',
    userPhone: '0981123456'
);
```

### Iframe de checkout

[](#iframe-de-checkout)

Incluir el script e inicializar el formulario:

```

  window.onload = function() {
    Bancard.Checkout.createForm('iframe-container', '{{ $processId }}', {});
  };

```

Librería: [bancard-checkout-js](https://github.com/Bancard/bancard-checkout-js)

### Rollback (reversa)

[](#rollback-reversa)

```
$result = Bancard::rollback(12313);
// $result['status'] === 'success'
```

### Consultar confirmación

[](#consultar-confirmación)

```
$result = Bancard::getConfirmation(12313);
// $result['confirmation']['response'] → 'S' (aprobado) o 'N'
// $result['confirmation']['response_code'] → '00' (aprobada)
```

### Catastro de tarjeta (Cards New)

[](#catastro-de-tarjeta-cards-new)

```
$result = Bancard::cardsNew(
    cardId: 1,
    userId: 966389,
    userCellPhone: '0919876543',
    userMail: 'usuario@mail.com',
    returnUrl: 'https://tusitio.com/cards/result'
);
// Usar $result['process_id'] con Bancard.Cards.createForm()
```

### Listar tarjetas del usuario

[](#listar-tarjetas-del-usuario)

```
$result = Bancard::usersCards(966389);
// $result['cards'] → array de tarjetas con alias_token
```

### Pago con token (Charge)

[](#pago-con-token-charge)

```
$result = Bancard::charge(
    60361,
    '723215.00',
    $aliasToken,  // de usersCards
    [
        'return_url' => 'https://tusitio.com/result',
        'number_of_payments' => 1,
    ]
);
```

### Eliminar tarjeta

[](#eliminar-tarjeta)

```
$result = Bancard::deleteCard(966389, $aliasToken);
```

### Verificar token de confirmación (webhook)

[](#verificar-token-de-confirmación-webhook)

Bancard envía un POST a tu URL de confirmación. Verifica el token:

```
$isValid = Bancard::verifyConfirmToken(
    $shopProcessId,
    $amount,
    $receivedToken
);
```

Inyección de dependencias
-------------------------

[](#inyección-de-dependencias)

```
use KrugerDavid\Bancard\BancardManager;

class PaymentController
{
    public function __construct(
        private BancardManager $bancard
    ) {}

    public function checkout()
    {
        $result = $this->bancard->singleBuy(...);
    }
}
```

Factura electrónica (Billing)
-----------------------------

[](#factura-electrónica-billing)

Para enviar datos de facturación:

```
use KrugerDavid\Bancard\DTOs\Billing;
use KrugerDavid\Bancard\DTOs\BillingDetail;

$billing = new Billing(
    clientRuc: '123456-1',
    clientName: 'JUAN GONZALEZ',
    clientEmail: 'juan@mail.com',
    commerceStamp: '12559969',
    commerceExpeditionPoint: '001',
    commerceEstablishment: '002',
    details: [
        new BillingDetail('Item 1', '10000.00', 10, 1),
        new BillingDetail('Item 2', '330.00', 10, 1),
    ]
);

Bancard::singleBuy(54322, '10330.00', 'Pago', 'https://x.com', [
    'billing' => $billing,
]);
```

Operaciones implementadas
-------------------------

[](#operaciones-implementadas)

OperaciónEndpointMétodoSingle Buysingle\_buyPOSTSingle Buy Zimplesingle\_buyPOSTRollbacksingle\_buy/rollbackPOSTGet Confirmationsingle\_buy/confirmationsPOSTCards Newcards/newPOSTUsers Cardsusers/{id}/cardsPOSTChargechargePOSTDelete Cardusers/{id}/cardsDELETECréditos
--------

[](#créditos)

- [David Krüger](https://github.com/krugerdavid)

Licencia
--------

[](#licencia)

MIT

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance97

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

14d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

laravelpaymentsvposParaguaykrugerdavidbancard

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/krugerdavid-laravel-bancard/health.svg)

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

###  Alternatives

[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)

PHPackages © 2026

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