12. Ödeme Sorgulama
Ödeme Sorgulama
Ödeme Sorgulama
GET
{{Private Base Address}}/api/paywall/private/query
Önemli: Ödeme Sorgulama servisini kullanabilmeniz için 'Header' alanında 'apikeyprivate' ve 'apiclientprivate' parametrelerini göndermeniz gerekmektedir. PaymentPrivateAPI Adresi
Parametre | Tip | Zorunlu | Açıklama |
---|---|---|---|
apikeyprivate | string | Evet | Üye işyeri panelinden temin etmiş olduğunuz Public Key. |
apiclientprivate | string | Evet | Üye işyeri panelinden temin etmiş olduğunuz Public Client. |
merchantuniquecode | string | Evet | Ödeme'ye ait sizin tarafınızdan verilmiş olan tekil takip kodu |
Örnek kodlar:
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Newtonsoft.Json;
public class Program
{
private static readonly HttpClient client = new HttpClient();
private static async Task Main()
{
client.DefaultRequestHeaders.Add("apikeyprivate", "%PRIVATEKEY%");
client.DefaultRequestHeaders.Add("apiclientprivate", "%PRIVATECLIENT%");
client.DefaultRequestHeaders.Add("merchantuniquecode", "%MerchantUniqueCode%");
var response = await client.GetAsync("{{Private Base Address}}/api/paywall/private/query");
var responseString = await response.Content.ReadAsStringAsync();
var responseObject = JsonConvert.DeserializeObject<Response>(responseString);
Console.WriteLine(responseObject.Body.Paywall.StatusName);
}
public class Response
{
public int ErrorCode { get; set; }
public bool Result { get; set; }
public string Message { get; set; }
public Body Body { get; set; }
}
public class Body
{
public Paywall Paywall { get; set; }
}
public class Paywall
{
public int PaymentId { get; set; }
public int ActivityId { get; set; }
public bool Status { get; set; }
public string StatusName { get; set; }
// Define other properties as needed...
}
}
package main
import (
"fmt"
"io/ioutil"
"net/http"
"encoding/json"
)
type Response struct {
ErrorCode int `json:"ErrorCode"`
Result bool `json:"Result"`
Message string `json:"Message"`
Body struct {
Paywall struct {
PaymentId int `json:"PaymentId"`
// Add the other fields as necessary...
} `json:"Paywall"`
} `json:"Body"`
}
func main() {
url := "{{Private Base Address}}/api/paywall/private/query"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("apikeyprivate", "%PRIVATEKEY%")
req.Header.Set("apiclientprivate", "%PRIVATECLIENT%")
req.Header.Set("merchantuniquecode", "%MerchantUniqueCode%")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
var response Response
json.Unmarshal(body, &response)
fmt.Println(response.Body.Paywall.PaymentId)
}
import java.net.http.HttpClient;
import java.net.http.HttpHeaders;
import java.net.http.HttpRequest;
import java.net.URI;
import java.net.http.HttpResponse.BodyHandlers;
import java.util.HashMap;
import java.util.Map;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
class Response {
@SerializedName("ErrorCode")
int errorCode;
@SerializedName("Result")
boolean result;
@SerializedName("Message")
String message;
@SerializedName("Body")
Body body;
}
class Body {
@SerializedName("Paywall")
Paywall paywall;
}
class Paywall {
@SerializedName("PaymentId")
int paymentId;
// Add the other fields as necessary...
}
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(new URI("{{Private Base Address}}/api/paywall/private/query"))
.setHeader("apikeyprivate", "%PRIVATEKEY%")
.setHeader("apiclientprivate", "%PRIVATECLIENT%")
.setHeader("merchantuniquecode", "%MerchantUniqueCode%")
.GET()
.build();
var response = client.send(request, BodyHandlers.ofString());
Gson gson = new Gson();
Response responseObject = gson.fromJson(response.body(), Response.class);
System.out.println(responseObject.body.paywall.paymentId);
}
}
<?php
$options = array(
'http' => array(
'header' => "Content-type: application/json\r\n" .
"apikeyprivate: %PRIVATEKEY%\r\n" .
"apiclientprivate: %PRIVATECLIENT%\r\n" .
"merchantuniquecode: %MerchantUniqueCode%\r\n",
'method' => 'GET',
),
);
$url = '{{Private Base Address}}/api/paywall/private/query';
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) { /* Handle error */ }
// Decode
$response = json_decode($result);
// Print PaymentId
echo "PaymentId: " . $response->Body->Paywall->PaymentId . "\n";
?>
import requests
import json
headers = {
'apikeyprivate': '%PRIVATEKEY%',
'apiclientprivate': '%PRIVATECLIENT%',
'merchantuniquecode': '%MerchantUniqueCode%',
'Content-Type': 'application/json',
}
response = requests.get('{{Private Base Address}}/api/paywall/private/query', headers=headers)
response_json = response.json()
# Print PaymentId
print('PaymentId:', response_json['Body']['Paywall']['PaymentId'])
require 'net/http'
require 'json'
uri = URI('{{Private Base Address}}/api/paywall/private/query')
req = Net::HTTP::Get.new(uri)
req['apikeyprivate'] = '%PRIVATEKEY%'
req['apiclientprivate'] = '%PRIVATECLIENT%'
req['merchantuniquecode'] = '%MerchantUniqueCode%'
res = Net::HTTP.start(uri.hostname, uri.port, :use_ssl => uri.scheme == 'https') {|http|
http.request(req)
}
# Parse and print PaymentId
response_json = JSON.parse(res.body)
puts "PaymentId: #{response_json['Body']['Paywall']['PaymentId']}"
import axios, { AxiosResponse } from 'axios';
interface Response {
ErrorCode: number;
Result: boolean;
Message: string;
Body: {
Paywall: {
PaymentId: number;
// Add other properties as needed...
}
}
}
const headers = {
'apikeyprivate': '%PRIVATEKEY%',
'apiclientprivate': '%PRIVATECLIENT%',
'merchantuniquecode': '%MerchantUniqueCode%',
};
axios.get<Response>('{{Private Base Address}}/api/paywall/private/query', { headers })
.then((response: AxiosResponse<Response>) => {
console.log(response.data.Body.Paywall.PaymentId);
});
curl -X GET '{{Private Base Address}}/api/paywall/private/query' \
-H 'apikeyprivate: %PRIVATEKEY%' \
-H 'apiclientprivate: %PRIVATECLIENT%' \
-H 'merchantuniquecode: %MerchantUniqueCode%' \
Servisten dönen cevap:
Parametre | Tip | Açıklama |
---|---|---|
PaymentId | int | Ödeme kimliği |
ActivityId | int | Ödeme son hareket kimliği |
Status | boolean | Son hareketin durumu, true: başarılı / false: başarısız |
StatusName | string | Ödeme durumu |
StatusId | int | Ödeme durum kimliği |
TypeName | string | Ödeme son hareket tipi |
TypeId | int | Ödeme son hareket tipinin kimliği |
Installment | int | Taksit bilgisi |
CurrencyId | int | Ödeme para birimi kimliği |
CurrencyName | string | Ödeme para birimi |
PaymentMethodId | int | Ödeme yöntemi kimliği |
PaymentMethodName | string | Ödeme yöntemi |
PaymentChannelId | int | Ödeme kanal kimliği |
PaymentChannelName | string | Ödeme kanalı |
PaymentTagId | int | Ödeme etiket kimliği |
PaymentTagName | string | Ödeme etiketi |
{
"ErrorCode": 0,
"Result": true,
"Message": "",
"Body": {
"Paywall": {
"PaymentId": 1903059,
"ActivityId": 3773167,
"PaymentGatewayId": 1445,
"PaymentGatewayName": "ProviderConnectionName",
"PaymentGatewayProviderName": "ProviderName",
"AnySuccessPayment": true,
"AnySuccessRefund": true,
"AnySuccessPartialRefund": false,
"AnySuccessCancel": false,
"Status": true,
"StatusName": "Başarılı",
"StatusId": 4,
"TypeName": "İade",
"TypeId": 2,
"Installment": 1,
"CurrencyId": 1,
"CurrencyName": "TRY",
"PaymentMethodId": 2,
"PaymentMethodName": null,
"PaymentChannelId": 0,
"PaymentChannelName": null,
"PaymentTagId": 0,
"PaymentTagName": null,
"CardNumber": "415565******6111",
"CardOwnerName": "Qnb Finansbank",
"CardBankName": "FİNANS BANK A.Ş.",
"CardBrandName": "Visa",
"CardTypeName": "Credit",
"CardFamilyName": "Cardfinans",
"LastActivityDateTime": "2024-05-14T22:19:34.8822565",
"PaymentAmount": 5.44,
"ActivityAmount": 5.44,
"IP": "::1",
"AppliedInterest": false,
"InterestRate": 0.00,
"CommissionRate": 0.00,
"OriginalAmount": 5.44,
"InterestAmount": 0.00,
"CommissionAmount": 0.00
}
}
}
Last updated