Helix.BankOfGeorgia.IpayClient is a .NET client library for using Bank of Georgia iPay Visa, Master Card and Americal Express payments gateway.
Official API reference can be found here:
https://api.bog.ge/docs/en/ipay/introduction
See ASP.NET Core integration guide below
var clientOptions = new BankOfGeorgiaIpayClientOptions()
{
ClientId = "your-ipay-client-id",
SecretKey = "your-ipay-client-secret",
};
var client = new BankOfGeorgiaIpayClient(clientOptions);
To integrate the client with ASP.NET Core dependency injection pipeline, use the following steps:
-
Add an entry in your appSettings.json file and specify your iPay
ClientId
andSecretKey
):{ //...other options "iPay": { "ClientId": "your-ipay-client-id", "SecretKey": "your-ipay-client-secret", } //...other options }
If you want to play with the DEMO mode, you can use the following configuration parameters:
{ //...other options "iPay": { "ClientId": "1006", "SecretKey": "581ba5eeadd657c8ccddc74c839bd3ad", "BaseUrl": "https://dev.ipay.ge/opay/api/v1" } //...other options }
⚠️ BaseUrl is NOT required for production use. If you leave this parameter empty or remove it completely, the default production URL will be used: https://ipay.ge/opay/api/v1 -
Call
AddBankOfGeorgiaIpay
inConfigureServices
method ofStartup.cs
and specify the configuration parameter name containing the options array (for this example we called the entryiPay
):services.AddBankOfGeorgiaIpay( Configuration.GetBankOfGeorgiaIpayClientOptions("iPay") );
Make sure you have access to
Configuration
. If you are missing configuration, you can inject it in yourStartup
):public class Startup { public IConfiguration Configuration { get; } public Startup(IConfiguration configuration) { Configuration = configuration; } }
-
Inject
IBankOfGeorgiaIpayClient
and use in your code:public class HomeController : Controller { private readonly IBankOfGeorgiaIpayClient _iPayClient; public HomeController(IBankOfGeorgiaIpayClient iPayClient) { _iPayClient = iPayClient; } }
No manual authentication is required. Access token will be requested when needed and when it expires automatically.
-
MakeOrderAsync
Place an one-time orderThis method encapsulates a /api/v1/checkout/orders endpoint and simplifies the request model.
-
MakeRecurringOrderAsync
Place an order for a recurring payments without user's interraction. You need to create an initial order to use recurring payments, where the user will enter their credit card details for the Bank to remember. You will need an ID of an existing order to perform additional reocurring orders.
If you don't want to charge the user for the first time and want the Bank to remember the card details for future use, you will still have to create an initial order for the minimum amount of 0.10 GEL and then you refund it.This method encapsulates a /api/v1/checkout/payment/subscription.
-
MakeRecurringOrderAsync There are two ways the transaction can be processed, called the
capture_method
:
- AUTOMATIC
- MANUAL
See this for more details https://api.bog.ge/docs/en/ipay/create-order
If the transaction was created usingMANUAL
capture method, it needs to be confirmed by calling this method.This method encapsulates a /api/v1/checkout/payment/{order_id}/pre-auth/completion.
-
RefundAsync Refund the transaction fully or partially
This method encapsulates a /api/v1/checkout/refund.