PHPackages                             redberryproducts/laravel-bog-payment - 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. redberryproducts/laravel-bog-payment

ActiveLibrary[Payment Processing](/categories/payments)

redberryproducts/laravel-bog-payment
====================================

This is my package bog-payment

v2.0.1(1mo ago)3932↑128.1%3[2 issues](https://github.com/RedberryProducts/laravel-bog-payment/issues)[6 PRs](https://github.com/RedberryProducts/laravel-bog-payment/pulls)MITPHPPHP ^8.2|^8.3|^8.4|^8.5CI passing

Since Nov 6Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/RedberryProducts/laravel-bog-payment)[ Packagist](https://packagist.org/packages/redberryproducts/laravel-bog-payment)[ Docs](https://github.com/RedberryProducts/laravel-bog-payment)[ GitHub Sponsors](https://github.com/RedberryProducts)[ RSS](/packages/redberryproducts-laravel-bog-payment/feed)WikiDiscussions main Synced yesterday

READMEChangelog (4)Dependencies (22)Versions (21)Used By (0)

BOG Payment Gateway
===================

[](#bog-payment-gateway)

The BOG Payment package provides seamless integration with the Bank of Georgia's payment gateway, enabling Laravel applications to process payments efficiently.

[![Latest Version on Packagist](https://camo.githubusercontent.com/8d23fbe3f9d386d9823c10534db38449223aaa21c060314e4490ecd510d72575/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726564626572727970726f64756374732f6c61726176656c2d626f672d7061796d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/redberryproducts/laravel-bog-payment)[![GitHub Tests Action Status](https://camo.githubusercontent.com/c42c7823a5d8d814aa7bff7c666c1c237ab6f145fb87df0c0fc820d57602a6fb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f726564626572727970726f64756374732f6c61726176656c2d626f672d7061796d656e742f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/redberryproducts/laravel-bog-payment/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/d09b881b98b24a23629a1db8ff64b463e2b7ecac2221880fe303e97ea7577e87/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f726564626572727970726f64756374732f6c61726176656c2d626f672d7061796d656e742f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/redberryproducts/laravel-bog-payment/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/b20e526bd35b9cdeb7206f75588f4ace56b8b537ce9ac9441084f3c125921bb1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726564626572727970726f64756374732f6c61726176656c2d626f672d7061796d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/redberryproducts/laravel-bog-payment)

### Demo

[](#demo)

You can find a demo project [here](https://github.com/nikajorjika/bog-payment-demo)

### Features

[](#features)

- Payment Processing: Initiate and manage transactions through the Bank of Georgia.
- Transaction Status: Retrieve and handle the status of payments.
- Secure Communication: Ensure secure data transmission with the payment gateway.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require redberryproducts/laravel-bog-payment
```

You can publish the config file with:

```
php artisan vendor:publish --tag="bog-payment-config"
```

Once published, the configuration file will be available at:

```
config/bog-payment.php
```

Environment Variables
---------------------

[](#environment-variables)

Add the following variables to your `.env` file to configure the package:

```
BOG_SECRET=[your_client_secret]
BOG_CLIENT_ID=[your_client_id]
BOG_PUBLIC_KEY=[your_public_key] # Can be found at https://api.bog.ge/docs/payments/standard-process/callback
```

You can find up to date `BOG_PUBLIC_KEY` in the Bank of Georgia's [API documentation](https://api.bog.ge/docs/payments/standard-process/callback).

You can also configure additional environment variables as needed. But this is the minimum that you need to implement.

Usage
-----

[](#usage)

### Usage Example: Simple Payment Processing

[](#usage-example-simple-payment-processing)

To initiate a payment, use the `Pay` facade to set the order details and process the transaction:

```
use RedberryProducts\LaravelBogPayment\Facades\Pay;
use App\Models\Transaction;

// Step 1: Create a transaction record
$transaction = Transaction::create([
    'user_id'    => auth()->id(),
    'amount'     => $data['total_amount'],
    'status'     => 'pending', // Initial status
]);

// Step 2: Process the payment
$paymentDetails = Pay::orderId($transaction->id)
    ->redirectUrl(route('bog.v1.transaction.status', ['transaction_id' => $transaction->id]))
    ->amount($transaction->amount)
    ->process();

// Step 3: Update the transaction with payment details
$transaction->update([
    'transaction_id'   => $paymentDetails['id'],
]);

// Step 4: Redirect user to the payment gateway
return redirect($paymentDetails['redirect_url']);
```

here's an example of the response:

```
$paymentDetails = [
    'id' => 'test-id',
    'redirect_url' => 'https://example.com/redirect',
    'details_url' => 'https://example.com/details',
]
```

Save Card
---------

[](#save-card)

### Save card during payment

[](#save-card-during-payment)

To save the card during the payment process, you can use the `saveCard()` method. This method will save the card details for future transactions.

When you want to save card during the payment, you need to do the following:

```
use RedberryProducts\LaravelBogPayment\Facades\Pay;

// SaveCard method will initiate another request that notifies bank to save card details
$response = Pay::orderId($external_order_id)
    ->redirectUrl(route('bog.v1.transaction.status', ['transaction_id' => $transaction->id]))
    ->amount($amount)
    ->saveCard()
    ->process();

// Example response
$response = [
    'id' => 'test-id',
    'redirect_url' => 'https://example.com/redirect',
    'details_url' => 'https://example.com/details',
];
```

When you receive the response, you can save the card details in your database, where `id` is the saved card(parent transaction) id that you would use for later transactions.

### Pay using saved card

[](#pay-using-saved-card)

Once you have saved new payment method id in your database, you can initiate payments on saved cards like so:

```
use RedberryProducts\LaravelBogPayment\Facades\Card;

$response = Pay::orderId($external_order_id)
    ->amount($amount)
    ->chargeCard("test-id");

// Example response
$response = [
    'id' => 'test-id',
    'redirect_url' => 'https://example.com/redirect',
    'details_url' => 'https://example.com/details',
];
```

Functionality above will charge saved card without the user interaction.

Subscriptions
-------------

[](#subscriptions)

To register a subscription payment, you can use the `Pay` facade to set the order details and process the transaction:

```
use RedberryProducts\LaravelBogPayment\Facades\Pay;

// SaveCard method will initiate another request that notifies bank to save card details
$response = Pay::orderId($external_order_id)
    ->redirectUrl(route('bog.v1.transaction.status', ['transaction_id' => $transaction->id]))
    ->amount($amount)
    ->subscribe();

// Save the parent transaction id in your database
$parentTransactionId = $response['id'];

// Charge saved subscription at any time that you need
$response = Pay::orderId($external_order_id)
    ->chargeSubscription($parentTransactionId);
```

This will charge the saved subscription without the user interaction.

Building the payload
--------------------

[](#building-the-payload)

Although the package provides a convenient way to initiate payments, you can also build the payment payload manually using the provided traits.

The BuildsPayment trait helps you build the payload for payments quickly by providing the following methods

Here's how you do it:

```
getPayload(): // Retrieves the current payload array.

orderId($externalOrderId): // Sets the external order ID for the payment.

callbackUrl($callbackUrl): // Sets a custom callback URL for the payment process.

redirectUrl($statusUrl): // Sets both success and fail URLs to the same value for redirection after the payment.

redirectUrls($failUrl, $successUrl): // Sets separate fail and success URLs for redirection after the payment.

saveCard(): // Sets the save card flag to true for the payment.

amount($totalAmount, $currency = 'GEL', $basket = []): // Defines the total amount, currency, and optionally, the basket details for the payment.

// These methods allow for easy customization of the payment payload to suit various payment requirements.
```

### Set `Buyer`

[](#set-buyer)

You can set the buyer details for the payment by using the `setBuyer()` method. This method accepts an array of buyer details, including the buyer's full\_name, masked\_email, and masked\_phone.

here's the example of how you can set the buyer details:

```
use RedberryProducts\LaravelBogPayment\Facades\Pay;

$buyer = [
    'full_name' => 'John Doe',
    'masked_email' => 'john**@gmail.com',
    'masked_phone' => '59512****10',
];

$paymentDetails = Pay::orderId($transaction->id)
            ->redirectUrl(route('bog.v1.transaction.status', ['transaction_id' => $transaction->id]))
            ->amount($data['total_amount'])
            ->buyer($buyer) // Set new buyer details
            ->process();

// Optionally you can set buyer details separately

$paymentDetails = Pay::orderId($transaction->id)
            ->redirectUrl(route('bog.v1.transaction.status', ['transaction_id' => $transaction->id]))
            ->amount($data['total_amount'])
            ->buyerName($buyer['full_name']) // Set new buyer full name
            ->buyerEmail($buyer['masked_email']) // Set new buyer masked email
            ->buyerPhone($buyer['masked_phone']) // Set new buyer masked phone
            ->process();
```

Callback Handling
-----------------

[](#callback-handling)

The package handles callback behavior automatically. When a payment is processed, it will send a POST request to your callback URL with the payment details. The package then verifies the request's signature to ensure its authenticity and fires the RedberryProducts\\LaravelBogPayment\\Events\\TransactionStatusUpdated event, which contains all relevant payment details.

To utilize this functionality, register an event listener in your application to capture and respond to the transaction status updates as needed.

Example: Registering a Listener for Transaction Status Updates Add the following code to your event listener:

```
namespace App\Listeners;

use RedberryProducts\LaravelBogPayment\Events\TransactionStatusUpdated;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;

class HandleTransactionStatusUpdate implements ShouldQueue
{
use InteractsWithQueue;

    /**
     * Handle the event.
     *
     * @param  RedberryProducts\LaravelBogPayment\\Events\TransactionStatusUpdated  $event
     * @return void
     */
    public function handle(array $event)
    {
        // Implement your logic here
    }
```

### Setting Up the Event Listener

[](#setting-up-the-event-listener)

Setting Up the Event Listener To handle transaction status updates efficiently, you need to register an event listener that listens for the TransactionStatusUpdated event triggered by the package.

1. Generating the Listener Automatically You can generate the event listener using the Artisan command: ```
    php artisan make:listener HandleTransactionStatusUpdate --event=RedberryProducts\LaravelBogPayment\\Events\TransactionStatusUpdated
    ```

    This command will create a listener class at `app/Listeners/HandleTransactionStatusUpdate.php`, which you can customize to handle the event logic.

This approach provides flexibility by allowing dynamic event registrations at runtime without modifying the EventServiceProvider.

For more details on event handling in Laravel, refer to the official [documentation](https://laravel.com/docs/11.x/events#event-discovery).

Handling Transaction Status
---------------------------

[](#handling-transaction-status)

The package provides a convenient way to retrieve the status of a transaction using the `Transaction` Facade's `get()` method. This method sends a GET request to the Bank of Georgia payment API to retrieve the transaction status.

Here's how you can use it:

```
use RedberryProducts\LaravelBogPayment\Facades\Transaction;

$transactionDetails = Transaction::get($order_id); // Returns array of transaction details
```

See example of the response [Official Documentation](https://api.bog.ge/docs/payments/standard-process/get-payment-details)

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Nika Jorjoliani](https://github.com/nikajorjika)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance77

Regular maintenance activity

Popularity23

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 94.6% 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 ~46 days

Recently: every ~127 days

Total

13

Last Release

47d ago

Major Versions

v1.0.9 → 2.0.02026-05-18

PHP version history (2 changes)v1.0.0PHP ^8.1|^8.2

2.0.0PHP ^8.2|^8.3|^8.4|^8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/575834382d0d9a2f525665011b42db95bb50b6ed74e4a2dded51a3b77ac85873?d=identicon)[nikajorjika](/maintainers/nikajorjika)

---

Top Contributors

[![nikajorjika](https://avatars.githubusercontent.com/u/4212052?v=4)](https://github.com/nikajorjika "nikajorjika (87 commits)")[![jshar](https://avatars.githubusercontent.com/u/29817535?v=4)](https://github.com/jshar "jshar (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")[![uchm4n](https://avatars.githubusercontent.com/u/1173405?v=4)](https://github.com/uchm4n "uchm4n (1 commits)")

---

Tags

laravelRedberryProductsbog-payment

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/redberryproducts-laravel-bog-payment/health.svg)

```
[![Health](https://phpackages.com/badges/redberryproducts-laravel-bog-payment/health.svg)](https://phpackages.com/packages/redberryproducts-laravel-bog-payment)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M166](/packages/spatie-laravel-health)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[nativephp/mobile

NativePHP for Mobile

1.1k75.1k95](/packages/nativephp-mobile)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.0k](/packages/simplestats-io-laravel-client)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

44855.7k](/packages/harris21-laravel-fuse)

PHPackages © 2026

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