İşlem Listesi

Belirli kriterlere göre işlem listesini getirir.

Endpoint Bilgileri
Method: POST
URL: /api/v1/transactions
Content-Type: application/json
Kimlik Doğrulama

Bu endpoint hash tabanlı kimlik doğrulama kullanır.

hash = SHA256(apiKey + requestData + hashKey)

Parametreler

Parametre Tip Zorunlu Açıklama
ApiKey string Zorunlu API anahtarınız
Hash string Zorunlu SHA256 hash değeri

Kod Örnekleri

using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Security.Cryptography;
using Newtonsoft.Json;

public class iPosApiClient
{
    private readonly string _apiKey;
    private readonly string _hashKey;
    private readonly string _baseUrl;
    private readonly HttpClient _httpClient;

    public iPosApiClient(string apiKey, string hashKey, string baseUrl)
    {
        _apiKey = apiKey;
        _hashKey = hashKey;
        _baseUrl = baseUrl;
        _httpClient = new HttpClient();
    }

    public async Task<string> PaymentAsync(dynamic requestData)
    {
        var jsonData = JsonConvert.SerializeObject(requestData);
        var hash = GenerateHash(_apiKey + jsonData + _hashKey);
        
        requestData.ApiKey = _apiKey;
        requestData.Hash = hash;

        var content = new StringContent(
            JsonConvert.SerializeObject(requestData),
            Encoding.UTF8,
            "application/json"
        );

        var response = await _httpClient.PostAsync($"{_baseUrl}/api/v1/transactions", content);
        return await response.Content.ReadAsStringAsync();
    }

    private string GenerateHash(string input)
    {
        using (var sha256 = SHA256.Create())
        {
            var bytes = sha256.ComputeHash(Encoding.UTF8.GetBytes(input));
            return Convert.ToHexString(bytes).ToLower();
        }
    }
}

// Kullanım örneği
var client = new iPosApiClient("your-api-key", "your-hash-key", "https://your-domain.com");

var request = new
{
    CardNumber = "4111111111111111",
    CardHolder = "John Doe",
    CardMonth = "12",
    CardYear = "25",
    CardCcv = "123",
    Price = 100.00m,
    CustomerFirstname = "John",
    CustomerLastname = "Doe",
    CustomerEmail = "[email protected]",
    ProductName = "Test Product"
};

var result = await client.PaymentAsync(request);
Console.WriteLine(result);

İnteraktif Test

Demo Verilerle Test Et

Aşağıdaki formu kullanarak endpoint'i demo verilerle test edebilirsiniz.

Test ediliyor...