AgentSkillsCN

bog-payment-gateway

为接受在线支付,集成格鲁吉亚银行(BOG)支付网关 API。当您需要实现 BOG 支付处理、创建支付订单、处理退款、查询支付状态,或与 BOG 的 OAuth 认证进行集成时,可使用此技能。触发条件包括提及 BOG、格鲁吉亚银行、格鲁吉亚支付、ipay.ge,或在格鲁吉亚寻求支付网关集成时的请求。

SKILL.md
--- frontmatter
name: bog-payment-gateway
description: Bank of Georgia (BOG) Payment Gateway API integration for accepting online payments. Use this skill when implementing BOG payment processing, creating payment orders, handling refunds, checking payment status, or integrating with BOG's OAuth authentication. Triggers include mentions of BOG, Bank of Georgia, Georgian payments, ipay.ge, or requests for payment gateway integration in Georgia.

BOG Payment Gateway Integration

This skill provides guidance for integrating with the Bank of Georgia (BOG) Online Payment API.

Quick Reference

ItemValue
Auth URLhttps://oauth2.bog.ge/auth/realms/bog/protocol/openid-connect/token
API Basehttps://api.bog.ge/payments/v1
Auth MethodOAuth 2.0 Client Credentials
Data FormatJSON

IMPORTANT:

  • All callback URLs MUST use HTTPS
  • All API requests MUST include Accept-Language: ka or Accept-Language: en header

Integration Flow

  1. Authenticate - Get access token using client credentials
  2. Create Order - Submit order with basket items and callbacks
  3. Redirect - Send customer to payment page (URL from response)
  4. Handle Callback - Receive payment result at callback URL
  5. Verify - Check payment status via API

Authentication

typescript
const getAccessToken = async (clientId: string, clientSecret: string) => {
  const credentials = Buffer.from(`${clientId}:${clientSecret}`).toString('base64');

  const response = await fetch(
    'https://oauth2.bog.ge/auth/realms/bog/protocol/openid-connect/token',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Basic ${credentials}`
      },
      body: 'grant_type=client_credentials'
    }
  );

  const { access_token, expires_in } = await response.json();
  return { access_token, expires_in };
};

Core Endpoints

Create Order

code
POST https://api.bog.ge/payments/v1/ecommerce/orders
Authorization: Bearer {access_token}
Content-Type: application/json

Request body:

json
{
  "callback_url": "https://example.com/callback",
  "external_order_id": "ORDER-123",
  "purchase_units": {
    "currency": "GEL",
    "total_amount": 100.00,
    "basket": [
      {
        "product_id": "PROD-1",
        "quantity": 1,
        "unit_price": 100.00
      }
    ]
  },
  "redirect_urls": {
    "success": "https://example.com/success",
    "fail": "https://example.com/fail"
  }
}

Response includes _links.redirect.href for payment page URL.

Get Payment Details

code
GET https://api.bog.ge/payments/v1/receipt/{order_id}
Authorization: Bearer {access_token}

Refund Payment

code
POST https://api.bog.ge/payments/v1/payment/refund/{order_id}
Authorization: Bearer {access_token}
Content-Type: application/json

{"amount": 50.00}  // Optional - omit for full refund

Response Codes

CodeMeaning
100Successful payment
200Successful preauthorization
101Card usage limited
102Saved card not found
103Invalid card
104Transaction limit exceeded
105Card expired
106Amount limit exceeded
107Insufficient funds
108Authentication declined
109Technical issue
110Transaction expired
111Authentication timeout
112General error

Detailed References

Implementation Checklist

  1. Store client_id and client_secret securely (env vars)
  2. Implement token caching with expiry handling
  3. Use HTTPS for all callback URLs
  4. Implement idempotency keys for order creation
  5. Handle all response codes appropriately
  6. Log transaction IDs for debugging