giorgigrdzelidze / laravel-bog-sdk
Laravel SDK for Bank of Georgia APIs: Business Online, Payments, iPay, Installment, BOG-ID, and Open Banking.
Package info
github.com/GiorgiGrdzelidze/laravel-bog-sdk
pkg:composer/giorgigrdzelidze/laravel-bog-sdk
Requires
- php: ^8.3
- illuminate/cache: ^12.0 || ^13.0
- illuminate/http: ^12.0 || ^13.0
- illuminate/support: ^12.0 || ^13.0
Requires (Dev)
- laravel/pint: ^1.18
- orchestra/testbench: ^10.0
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^11.0
README
๐ฆ Laravel BOG SDK
A comprehensive Laravel SDK for Bank of Georgia APIs. Covers all major BOG product lines with typed DTOs, automatic OAuth2 token management, and full test coverage.
๐ Supported APIs
| API | Description | Status |
|---|---|---|
| ๐ข Business Online (Bonline) | Account balances, statements, today activities, currency rates, requisites | โ Full |
| ๐ณ Payments v1 | E-commerce orders, refunds, pre-auth, saved cards, split payments | โ Full |
| ๐ Apple Pay | Apple Pay payment completion | โ Full |
| ๐ฑ Google Pay | Google Pay payment completion | โ Full |
| ๐ฐ iPay (legacy) | Orders, refunds, subscriptions, pre-auth | โ Full |
| ๐ Installment | Calculator, checkout, order details | โ Full |
| ๐งพ Billing | Payments, status, cancellation (OAuth2/Basic/API Key/HMAC) | โ Full |
| ๐ BOG-ID | OpenID Connect: redirect, code exchange, userinfo | โ Full |
| ๐ Open Banking | Identity assurance | โ Full |
| ๐ฎ PSD2 | AIS/PIS (scaffolded for future) | ๐ Planned |
๐ฆ Requirements
- PHP 8.3+
- Laravel 12.x or 13.x
๐ Installation
composer require giorgigrdzelidze/laravel-bog-sdk
The service provider is auto-discovered. To publish the config file:
php artisan vendor:publish --tag=bog-sdk-config
To publish the BOG Payments callback public key (for signature verification):
php artisan vendor:publish --tag=bog-sdk-keys
โ๏ธ Configuration
Add the following to your .env file. Only configure the APIs you plan to use:
# ๐ข Business Online (Bonline) BOG_BONLINE_CLIENT_ID=your-client-id BOG_BONLINE_CLIENT_SECRET=your-client-secret BOG_BONLINE_ACCOUNTS=GE00BG0000000000000001,GE00BG0000000000000002 BOG_BONLINE_DEFAULT_ACCOUNT=GE00BG0000000000000001 BOG_BONLINE_DEFAULT_CURRENCY=GEL BOG_BONLINE_CURRENCIES=GEL,USD,EUR # ๐ณ Payments BOG_PAYMENTS_CLIENT_ID=your-client-id BOG_PAYMENTS_CLIENT_SECRET=your-client-secret # ๐ฐ iPay (legacy) BOG_IPAY_CLIENT_ID=your-client-id BOG_IPAY_CLIENT_SECRET=your-client-secret # ๐ Installment BOG_INSTALLMENT_CLIENT_ID=your-client-id BOG_INSTALLMENT_CLIENT_SECRET=your-client-secret BOG_INSTALLMENT_SHOP_ID=your-shop-id # ๐งพ Billing BOG_BILLING_CLIENT_ID=your-client-id BOG_BILLING_CLIENT_SECRET=your-client-secret BOG_BILLING_AUTH=oauth2 # oauth2 | basic | apikey | hmac-sha256 # ๐ BOG-ID (OpenID Connect) BOG_ID_CLIENT_ID=your-client-id BOG_ID_CLIENT_SECRET=your-client-secret BOG_ID_REDIRECT_URI=https://your-app.com/auth/bog/callback # ๐ Open Banking BOG_OB_CLIENT_ID=your-client-id BOG_OB_CLIENT_SECRET=your-client-secret
๐ง Optional tuning
BOG_HTTP_TIMEOUT=15 BOG_HTTP_RETRY_TIMES=2 BOG_HTTP_RETRY_SLEEP_MS=250 BOG_TOKEN_CACHE_STORE=redis # null = default cache driver BOG_TOKEN_CACHE_PREFIX=bog-sdk:token: BOG_TOKEN_CACHE_SAFETY_TTL=60 # seconds before token expiry to refresh
โก Quick Start
Use the Bog facade or resolve BogClient from the container:
use GiorgiGrdzelidze\BogSdk\Facades\Bog; // or use GiorgiGrdzelidze\BogSdk\BogClient; $client = app(BogClient::class);
๐ข Business Online (Bonline)
๐ฐ Account Balance
$balance = Bog::bonline()->balance()->get('GE29BG0000000123456789', 'GEL'); $balance->accountNumber; // "GE29BG0000000123456789" $balance->currency; // "GEL" $balance->availableBalance; // 5432.10 $balance->currentBalance; // 5500.00 $balance->blockedAmount; // 67.90
๐ Statement (with auto-pagination)
// Single page (max 1000 records per request) $page = Bog::bonline()->statement()->forPeriod( from: new DateTimeImmutable('2026-01-01'), to: new DateTimeImmutable('2026-01-31'), currency: 'GEL', accountNumber: 'GE29BG0000000123456789', ); $page->id; // statement ID for paging $page->count; // total records across all pages $page->records; // TransactionDto[] // ๐ Stream all pages automatically (generator) foreach (Bog::bonline()->statement()->stream( from: new DateTimeImmutable('2026-01-01'), to: new DateTimeImmutable('2026-03-31'), currency: 'GEL', accountNumber: 'GE29BG0000000123456789', ) as $transaction) { echo $transaction->entryDate . ' โ ' . $transaction->entryAmount; echo $transaction->senderName() . ' โ ' . $transaction->beneficiaryName(); echo $transaction->documentNomination; }
๐ Statement Paging (manual)
Pages must be fetched sequentially โ skipping is not allowed by the API.
// Returns TransactionDto[] (flat array) $records = Bog::bonline()->statement()->page( accountNumber: 'GE29BG0000000123456789', currency: 'GEL', statementId: (int) $page->id, pageNumber: 2, );
๐ Statement Summary
// V2 โ by date range (no statement ID needed) $summary = Bog::bonline()->summary()->forPeriod('GE29BG0000000123456789', 'GEL', '2026-01-01', '2026-01-31'); $summary['GlobalSummary']['CreditSum']; $summary['GlobalSummary']['DebitSum']; $summary['DailySummaries']; // day-by-day breakdown // V1 โ by statement ID $summary = Bog::bonline()->summary()->get('GE29BG0000000123456789', 'GEL', $statementId);
๐ Today's Activities
$activities = Bog::bonline()->todayActivities()->get('GE29BG0000000123456789', 'GEL'); foreach ($activities as $tx) { echo $tx->entryAmountDebit . ' / ' . $tx->entryAmountCredit . ' โ ' . $tx->entryComment; }
๐ฑ Currency Rates
// Commercial rate for a currency $rate = Bog::bonline()->currencyRates()->commercial('USD'); echo "Buy: {$rate->buyRate}, Sell: {$rate->sellRate}"; // All major rates (USD, EUR, GBP) $rates = Bog::bonline()->currencyRates()->list(); // Cross rate between two currencies (returns float) $crossRate = Bog::bonline()->currencyRates()->crossRate('USD', 'EUR'); // NBG official rate (returns float) $nbgRate = Bog::bonline()->currencyRates()->nbg('USD');
๐ฆ Multiple Accounts & Currencies
The SDK supports managing multiple bank accounts and currencies via comma-separated env variables:
BOG_BONLINE_ACCOUNTS=GE22BG0000000541687311,GE46BG0000000498609082 BOG_BONLINE_DEFAULT_ACCOUNT=GE22BG0000000541687311 BOG_BONLINE_CURRENCIES=GEL,USD,EUR BOG_BONLINE_DEFAULT_CURRENCY=GEL
Access the configured lists in your code:
$accounts = config('bog-sdk.bonline.accounts'); // ['GE22BG0000000541687311', 'GE46BG0000000498609082'] $currencies = config('bog-sdk.bonline.currencies'); // ['GEL', 'USD', 'EUR'] // Fetch balance for all accounts and currencies foreach ($accounts as $iban) { foreach ($currencies as $currency) { $balance = Bog::bonline()->balance()->get($iban, $currency); echo "{$iban}: {$balance->availableBalance} {$currency}"; } } // Stream transactions across all accounts and currencies foreach ($accounts as $iban) { foreach ($currencies as $currency) { foreach (Bog::bonline()->statement()->stream($from, $to, $currency, $iban) as $tx) { // process each transaction } } }
default_accountis used when no specific account is provided (e.g. by CLI commands).default_currencyis the fallback whencurrenciesis not set.- When
BOG_BONLINE_CURRENCIESis configured, commands automatically iterate over all currencies for each account.
๐๏ธ Account Requisites
$requisites = Bog::bonline()->requisites()->get('GE29BG0000000123456789', 'GEL'); $requisites['BankName']; // "Bank of Georgia" $requisites['SwiftCode']; // "BAGAGE22"
๐ณ Payments v1
๐ Create an Order
use GiorgiGrdzelidze\BogSdk\Payments\Dto\CreateOrderRequestDto; use GiorgiGrdzelidze\BogSdk\Payments\Dto\BasketItemDto; use GiorgiGrdzelidze\BogSdk\Payments\Dto\BuyerDto; $order = Bog::payments()->orders()->create(new CreateOrderRequestDto( callbackUrl: 'https://your-app.com/bog/callback', externalOrderId: 'ORDER-001', currency: 'GEL', totalAmount: 49.99, basket: [ new BasketItemDto('SKU-001', 'Product name', quantity: 1, unitPrice: 49.99), ], successUrl: 'https://your-app.com/success', failUrl: 'https://your-app.com/fail', buyer: new BuyerDto('Giorgi Grdzelidze', 'giorgi@example.com', '+995599000000'), capture: 'automatic', // or 'manual' for pre-auth saveCard: false, )); $order->id; // BOG order UUID $order->redirectUrl; // redirect the customer here ๐ $order->detailsUrl; // API URL to check status
๐ Get Order Details
$details = Bog::payments()->orders()->get($orderId); $details->statusKey; // "completed", "rejected", etc. $details->totalAmount; // 49.99 $details->currency; // "GEL" $details->paymentMethod; // "card" $details->cardMask; // "4***1234" $details->rrn; // retrieval reference number $details->externalOrderId; // "ORDER-001"
โฉ๏ธ Refund / โ Cancel / โ Confirm Pre-auth
// Full refund Bog::payments()->orders()->refund($orderId); // Partial refund Bog::payments()->orders()->refund($orderId, amount: 10.00); // Cancel (before completion) Bog::payments()->orders()->cancel($orderId); // Confirm pre-auth (capture = manual) Bog::payments()->orders()->confirm($orderId, amount: 49.99);
๐พ Saved Card Charges
// Charge a saved card Bog::payments()->cardCharges()->charge($parentOrderId, 25.00, 'GEL'); // Subscription charge Bog::payments()->cardCharges()->subscription($parentOrderId, 9.99, 'GEL', 'SUB-001'); // Delete saved card Bog::payments()->cardCharges()->deleteCard($parentOrderId);
โ๏ธ Split Payments
use GiorgiGrdzelidze\BogSdk\Payments\Dto\SplitAccountDto; Bog::payments()->splitPayment()->create($orderId, [ new SplitAccountDto('GE00ACCOUNT1', 30.00), new SplitAccountDto('GE00ACCOUNT2', 19.99), ]);
๐ Apple Pay / ๐ฑ Google Pay
Bog::payments()->applePay()->complete($applePayTokenData); Bog::payments()->googlePay()->complete($googlePayTokenData);
๐ Verify Callback Signature
// In your callback controller: $callback = Bog::payments()->verifyCallback( rawBody: $request->getContent(), signatureHeader: $request->header('X-Signature'), ); $callback->id; // order ID $callback->statusKey; // "completed" $callback->externalOrderId; // your order reference $callback->totalAmount; // 49.99
๐ Publish the BOG callback public key first:
php artisan vendor:publish --tag=bog-sdk-keys
๐ฐ iPay (Legacy)
use GiorgiGrdzelidze\BogSdk\IPay\Dto\IPayOrderRequestDto; use GiorgiGrdzelidze\BogSdk\IPay\Dto\IPayItemDto; $order = Bog::ipay()->orders()->create(new IPayOrderRequestDto( intent: 'CAPTURE', amount: 25.00, currency: 'GEL', items: [new IPayItemDto('SKU-1', 'Product', 1, 25.00)], callbackUrl: 'https://your-app.com/ipay/callback', redirectUrl: 'https://your-app.com/ipay/redirect', )); $order->orderId; // iPay order ID $order->redirectUrl; // redirect customer ๐ // ๐ Check payment $details = Bog::ipay()->orders()->get($orderId); // โฉ๏ธ Refund Bog::ipay()->orders()->refund($orderId); Bog::ipay()->orders()->refund($orderId, amount: 10.00); // partial // ๐ Subscription Bog::ipay()->orders()->subscription($orderId, 9.99); // โ Pre-auth confirm Bog::ipay()->orders()->preAuthConfirm($orderId, 25.00);
๐ Installment
๐งฎ Calculate Discounts
use GiorgiGrdzelidze\BogSdk\Installment\Dto\CalculatorRequestDto; use GiorgiGrdzelidze\BogSdk\Installment\Dto\InstallmentBasketItemDto; $discounts = Bog::installment()->calculator()->discounts(new CalculatorRequestDto( clientType: 'standard', invoiceCurrency: 'GEL', basket: [new InstallmentBasketItemDto('PROD-1', 500.00, 1)], totalItemAmount: 500.00, totalAmount: 500.00, )); foreach ($discounts as $discount) { echo "{$discount->month} months: {$discount->description} (fee: {$discount->amount})"; }
๐๏ธ Checkout & Details
$result = Bog::installment()->checkout()->create([ 'shop_id' => config('bog-sdk.installment.shop_id'), 'amount' => 500.00, 'currency' => 'GEL', // ... other fields ]); $details = Bog::installment()->checkout()->details($orderId); $details->orderId; // "inst-order-123" $details->status; // "approved" โ
๐ฅ๏ธ JS SDK Config Helper
$jsConfig = Bog::installment()->jsConfig( basket: [ ['product_id' => 'P1', 'total_item_amount' => 300.00, 'total_item_qty' => 1], ['product_id' => 'P2', 'total_item_amount' => 200.00, 'total_item_qty' => 1], ], onCompleteUrl: 'https://your-app.com/installment/complete', ); // Returns: ['shop_id' => '...', 'basket' => [...], 'currency' => 'GEL', 'amount' => 500.00, ...]
๐ Validation Rules
use GiorgiGrdzelidze\BogSdk\Support\InstallmentRules; InstallmentRules::MIN_AMOUNT; // 100.00 ๐ต InstallmentRules::MAX_AMOUNT; // 10,000.00 ๐ต InstallmentRules::CURRENCY; // "GEL" InstallmentRules::ALLOWED_MONTHS; // [3, 6, 9, 12, 18, 24]
๐งพ Billing
Supports four authentication methods: oauth2, basic, apikey, hmac-sha256.
use GiorgiGrdzelidze\BogSdk\Billing\Dto\PaymentRequestDto; use GiorgiGrdzelidze\BogSdk\Billing\Dto\PaymentInfoDto; // ๐ต Create payment $response = Bog::billing()->payment(new PaymentRequestDto( amount: 100.00, currency: 'GEL', description: 'Invoice #123', externalId: 'INV-123', )); $response->paymentId; // "pay-uuid" $response->status; // "pending" $response->redirectUrl; // redirect customer ๐ // ๐ Check status $status = Bog::billing()->paymentStatus($paymentId); $status->status; // "completed" โ // โ Cancel $cancel = Bog::billing()->cancelPayment($paymentId); $cancel->status; // "cancelled" // โน๏ธ Send additional info Bog::billing()->sendPaymentInfo(new PaymentInfoDto($paymentId, ['note' => 'Extra info']));
๐ BOG-ID (OpenID Connect)
use GiorgiGrdzelidze\BogSdk\BogId\Enums\BogIdClaim; // 1๏ธโฃ Generate redirect URL $url = Bog::bogId()->redirectUrl( scopes: [BogIdClaim::FPI->value, BogIdClaim::CI->value], redirectUri: 'https://your-app.com/auth/bog/callback', state: csrf_token(), ); // Redirect user to $url ๐ // 2๏ธโฃ Exchange code for tokens (in callback controller) $tokens = Bog::bogId()->exchangeCode($request->code, 'https://your-app.com/auth/bog/callback'); $tokens->accessToken; $tokens->idToken; $tokens->refreshToken; $tokens->expiresIn; // 3๏ธโฃ Get user info $user = Bog::bogId()->userinfo($tokens->accessToken); $user->sub; // unique user ID $user->name; // "Giorgi Grdzelidze" $user->email; // "giorgi@example.com" $user->emailVerified; // true โ $user->phoneNumber; // "+995599000000" $user->personalNumber; // "01001012345"
๐ Available BOG-ID Scopes
| Scope | Description |
|---|---|
FPI |
๐ค Full personal info |
BPI |
๐ค Basic personal info |
PI |
๐ค Personal info |
DI |
๐ Document info |
BI |
๐ฆ Bank info |
CI |
๐ Contact info |
๐ Open Banking
๐ Identity Assurance
use GiorgiGrdzelidze\BogSdk\OpenBanking\Identity\Dto\IdentityRequestDto; $result = Bog::openBanking()->identity()->assure(new IdentityRequestDto( personalNumber: '01001012345', documentNumber: 'DOC123456', birthDate: '1990-01-01', )); $result->verified; // true โ $result->firstName; // "Giorgi" $result->lastName; // "Grdzelidze" $result->confidence; // "HIGH"
๐ท๏ธ Enums
The SDK ships with typed enums for all known API codes:
use GiorgiGrdzelidze\BogSdk\Payments\Enums\BogPaymentResponseCode; use GiorgiGrdzelidze\BogSdk\Payments\Enums\OrderStatus; use GiorgiGrdzelidze\BogSdk\Payments\Enums\PaymentMethod; use GiorgiGrdzelidze\BogSdk\Payments\Enums\CaptureMethod; use GiorgiGrdzelidze\BogSdk\Billing\Enums\BillingErrorCode; use GiorgiGrdzelidze\BogSdk\Bonline\Enums\BonlineResultCode; use GiorgiGrdzelidze\BogSdk\BogId\Enums\BogIdClaim; use GiorgiGrdzelidze\BogSdk\Support\CurrencyCode; // Each enum has a description() method ๐ BogPaymentResponseCode::REJECTED_INSUFFICIENT_FUNDS->description(); // "Insufficient funds" OrderStatus::COMPLETED->value; // "completed" PaymentMethod::CARD->value; // "card" CurrencyCode::GEL->value; // "GEL"
๐จ Error Handling
All exceptions extend BogSdkException, making it easy to catch everything or be specific:
use GiorgiGrdzelidze\BogSdk\Exceptions\BogSdkException; use GiorgiGrdzelidze\BogSdk\Exceptions\BogHttpException; use GiorgiGrdzelidze\BogSdk\Exceptions\BogAuthenticationException; use GiorgiGrdzelidze\BogSdk\Exceptions\BogBillingException; use GiorgiGrdzelidze\BogSdk\Exceptions\BogInvalidSignatureException; try { $balance = Bog::bonline()->balance()->get($iban, 'GEL'); } catch (BogAuthenticationException $e) { // ๐ OAuth credentials invalid or token fetch failed } catch (BogHttpException $e) { $e->status; // HTTP status code $e->body; // raw response body $e->url; // request URL $e->bogErrorCode; // BOG-specific error code (if present) } catch (BogSdkException $e) { // ๐ก๏ธ Catch-all for any SDK error }
๐ณ Exception Hierarchy
BogSdkException (abstract)
โโโ ๐ BogAuthenticationException โ OAuth2 token failures
โโโ โ๏ธ BogConfigurationException โ Missing config or keys
โโโ ๐ BogHttpException โ HTTP errors (4xx, 5xx) with metadata
โโโ ๐ BogInvalidSignatureException โ Callback signature verification failed
โโโ ๐ข BogBonlineException โ Bonline-specific errors with result codes
โโโ ๐ณ BogPaymentException โ Payment errors
โ โโโ โ BogPaymentDeclinedException โ Payment was declined
โ โโโ โ ๏ธ BogPaymentValidationException โ Validation errors
โโโ ๐งพ BogBillingException โ Billing errors with error codes and details
โโโ ๐ฐ BogIPayException โ iPay errors
โโโ ๐ BogInstallmentException โ Installment errors
โโโ ๐ BogIdException โ BOG-ID/OIDC errors
โโโ ๐ BogOpenBankingException โ Open Banking errors
๐ Token Management
The SDK automatically manages OAuth2 tokens per domain:
- ๐ง Runtime cache โ tokens are held in memory for the current request
- ๐พ Laravel cache โ tokens are persisted across requests using your configured cache driver
- โฑ๏ธ Safety TTL โ tokens are refreshed 60 seconds before expiry (configurable)
- ๐ Automatic retry โ on 401 responses, the token is refreshed and the request retried once
You can customize the cache store:
BOG_TOKEN_CACHE_STORE=redis BOG_TOKEN_CACHE_PREFIX=bog-sdk:token: BOG_TOKEN_CACHE_SAFETY_TTL=60
๐ Apple Pay Domain Verification
To set up Apple Pay, publish the domain association file:
php artisan bog-sdk:publish-apple-domain-association
This copies the merchant verification file to public/.well-known/apple-developer-merchantid-domain-association.
๐๏ธ Architecture
src/
โโโ ๐ Auth/
โ โโโ Dto/AccessToken.php โ OAuth2 token DTO
โ โโโ TokenManager.php โ Per-domain OAuth2 token management with caching
โโโ ๐งพ Billing/
โ โโโ Dto/ โ PaymentRequest, PaymentResponse, PaymentStatus, Cancel, PaymentInfo
โ โโโ Enums/BillingErrorCode.php โ Error code enum
โ โโโ BillingClient.php โ Multi-auth billing client (OAuth2/Basic/API Key/HMAC)
โโโ ๐ BogId/
โ โโโ Dto/ โ BogIdToken, BogIdUser
โ โโโ Enums/BogIdClaim.php โ OIDC scope enum
โ โโโ BogIdClient.php โ Redirect, code exchange, userinfo
โโโ ๐ข Bonline/
โ โโโ Dto/ โ Account, Balance, CurrencyRate, StatementPage, Summary, Transaction
โ โโโ Endpoints/ โ Accounts, Balance, CurrencyRates, Requisites, Statement, Summary, TodayActivities
โ โโโ Enums/BonlineResultCode.php โ Result code enum
โ โโโ BonlineClient.php โ Lazy-loaded endpoint orchestrator
โโโ ๐ฅ๏ธ Console/
โ โโโ PublishAppleDomainAssociationCommand.php
โโโ ๐ Contracts/
โ โโโ HttpClientContract.php โ Interface for HTTP client (get/post/put/patch/delete)
โโโ ๐จ Exceptions/ โ 14 exception classes with full hierarchy
โโโ ๐ Http/
โ โโโ HttpClient.php โ Token-aware HTTP client with 401 retry
โโโ ๐ Installment/
โ โโโ Dto/ โ CalculatorRequest, Discount, BasketItem, OrderDetails
โ โโโ Endpoints/ โ Calculator, Checkout
โ โโโ InstallmentClient.php โ Checkout, calculator, JS config helper
โโโ ๐ฐ IPay/
โ โโโ Dto/ โ IPayItem, IPayOrderRequest, IPayOrderResponse, IPayPaymentDetails
โ โโโ Endpoints/IPayOrdersEndpoint.php
โ โโโ IPayClient.php
โโโ ๐ OpenBanking/
โ โโโ Identity/
โ โ โโโ Dto/ โ IdentityRequest, IdentityAssurance
โ โ โโโ IdentityClient.php
โ โโโ Psd2/Psd2Client.php โ Scaffolded for future PSD2 implementation
โ โโโ OpenBankingClient.php
โโโ ๐ณ Payments/
โ โโโ Dto/ โ BasketItem, Buyer, CreateOrderRequest/Response, OrderDetails, OrderCallback, SplitAccount
โ โโโ Endpoints/ โ Orders, CardCharges, SplitPayment, ApplePay, GooglePay
โ โโโ Enums/ โ BogPaymentResponseCode, OrderStatus, PaymentMethod, CaptureMethod
โ โโโ PaymentsClient.php โ Endpoint orchestrator + callback verification
โโโ ๐ ๏ธ Support/
โ โโโ CurrencyCode.php โ Currency enum (GEL, USD, EUR, GBP)
โ โโโ InstallmentRules.php โ Installment validation constants
โ โโโ SignatureVerifier.php โ RSA SHA256 callback signature verification
โโโ BogClient.php โ Main client (bonline, payments, billing, ipay, installment, bogId, openBanking)
โโโ BogSdkServiceProvider.php โ Auto-discovery, config, singletons
โโโ Facades/Bog.php โ Facade with full PHPDoc
๐งช Testing
The SDK ships with 110 tests and 315 assertions โ
# Run tests composer test # Run PHPStan (level 6) composer phpstan # Run code style check composer pint -- --test # Run all CI checks composer ci
๐งช Testing in Your Application
The SDK works seamlessly with Http::fake():
use Illuminate\Support\Facades\Http; use GiorgiGrdzelidze\BogSdk\BogClient; Http::fake([ // Fake the OAuth token endpoint 'account.bog.ge/*' => Http::response([ 'access_token' => 'test-token', 'expires_in' => 3600, 'token_type' => 'Bearer', ]), // Fake the API endpoint 'api.businessonline.ge/api/accounts/*/GEL' => Http::response([ 'AccountNumber' => 'GE00TEST', 'Currency' => 'GEL', 'AvailableBalance' => 1000.00, 'CurrentBalance' => 1000.00, 'BlockedAmount' => 0.0, ]), ]); $balance = app(BogClient::class)->bonline()->balance()->get('GE00TEST', 'GEL'); assert($balance->availableBalance === 1000.00); // โ
๐ Changelog
See CHANGELOG.md for release history.
๐ License
MIT. See LICENSE.md.
Made with โค๏ธ for the ๐ฌ๐ช Georgian developer community