Download the PHP package nikajorjika/bog-payment without Composer
On this page you can find all versions of the php package nikajorjika/bog-payment. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nikajorjika/bog-payment
More information about nikajorjika/bog-payment
Files in nikajorjika/bog-payment
Package bog-payment
Short Description This is my package bog-payment
License MIT
Homepage https://github.com/nikajorjika/bog-payment
Informations about the package bog-payment
Deprecated
⚠️ Deprecation Warning
This package is deprecated and will no longer receive updates, bug fixes, or security patches.
🔄 Recommended Alternatives
The package has been moved to a new vendor. To continue receiving updates, please switch to the new package.
- RedberryProducts/laravel-bog-payment – Maintained and actively supported.
❓ What This Means
- No new features will be added.
- No bug fixes or security patches will be provided.
- No support for future Laravel versions.
- The repository may be archived in the near future.
🚀 Migration Guide
- In composer.json, replace
"nikajorjika/bog-payment": "^1.0"
with"redberryproducts/laravel-bog-payment": "^1.0"
- Run
composer update
- Replace
Jorjika\BogPayment\Facades\Pay
withRedberryProducts\LaravelBogPayment\Facades\Pay
- Replace
Jorjika\BogPayment\Facades\Transaction
withRedberryProducts\LaravelBogPayment\Facades\Transaction
- In your Listener, replace
Nikajorjika\BogPayment\Events\TransactionStatusUpdated
withRedberryProducts\LaravelBogPayment\Events\TransactionStatusUpdated
❤️ Thank You
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.
Demo
You can find a demo project here
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
You can install the package via composer:
You can publish the config file with:
Once published, the configuration file will be available at:
Environment Variables
Add the following variables to your .env
file to configure the package:
You can find up to date BOG_PUBLIC_KEY
in the Bank of Georgia's API documentation.
You can also configure additional environment variables as needed. But this is the minimum that you need to implement.
Usage
Usage Example: Simple Payment Processing
To initiate a payment, use the Pay
facade to set the order details and process the transaction:
here's an example of the response:
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:
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.
Payment with Saved Card
Once you have saved new payment method id in your database, you can initiate payments on saved cards like so:
Functionality above will charge saved card without the user interaction.
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:
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:
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 Nikajorjika\BogPayment\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:
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.
-
Generating the Listener Automatically You can generate the event listener using the Artisan command:
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.
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:
See example of the response Official Documentation
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Nika Jorjoliani
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of bog-payment with dependencies
guzzlehttp/guzzle Version ^7.9
illuminate/contracts Version ^10.0 || ^11.0
spatie/laravel-package-tools Version ^1.16