Ödeme Sorgulama

Bir transactionId değerine ait ödeme detaylarını sorgulamak için kullanılır..

GET https://api.zotlo.com/v1/transaction/detail?transactionId=TRANSACTION_ID
Satın alma işlemlerinden sonra bu servis kullanılarak ödeme işlemi doğrulabilir. Bu servis ile satın almaya ait detaylar ya da işlem logları kontrol edilebilir.

Ödeme sorgulama servisi için gönderilmesi gereken parametreler şunlardır.

Alan
Açıklama
transactionId
Cevabının kontrol edilmesi istenilen transactionId değeridir.

Örnek İstek

Curl
Php
Swift
Java
Python
C#
1
curl --location --request GET 'https://api.zotlo.com/v1/transaction/detail?transactionId=5e6b9a02e71dd803d6420663' \
2
--header 'AccessKey: ***' \
3
--header 'AccessSecret: ***' \
4
--header 'ApplicationId: 2' \
5
--header 'Language: tr'
Copied!
1
$curl = curl_init();
2
3
curl_setopt_array($curl, array(
4
CURLOPT_URL => "https://api.zotlo.com/v1/transaction/detail?transactionId=5e6b9a02e71dd803d6420663",
5
CURLOPT_RETURNTRANSFER => true,
6
CURLOPT_ENCODING => "",
7
CURLOPT_MAXREDIRS => 10,
8
CURLOPT_TIMEOUT => 0,
9
CURLOPT_FOLLOWLOCATION => true,
10
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
11
CURLOPT_CUSTOMREQUEST => "GET",
12
CURLOPT_HTTPHEADER => array(
13
"AccessKey: ***",
14
"AccessSecret: ***",
15
"ApplicationId: 2",
16
"Language: tr"
17
),
18
));
19
20
$response = curl_exec($curl);
21
22
curl_close($curl);
23
echo $response;
Copied!
1
import Foundation
2
3
var semaphore = DispatchSemaphore (value: 0)
4
5
var request = URLRequest(url: URL(string: "https://api.zotlo.com/v1/transaction/detail?transactionId=5e6b9a02e71dd803d6420663")!,timeoutInterval: Double.infinity)
6
request.addValue("***", forHTTPHeaderField: "AccessKey")
7
request.addValue("***", forHTTPHeaderField: "AccessSecret")
8
request.addValue("2", forHTTPHeaderField: "ApplicationId")
9
request.addValue("tr", forHTTPHeaderField: "Language")
10
11
request.httpMethod = "GET"
12
13
let task = URLSession.shared.dataTask(with: request) { data, response, error in
14
guard let data = data else {
15
print(String(describing: error))
16
return
17
}
18
print(String(data: data, encoding: .utf8)!)
19
semaphore.signal()
20
}
21
22
task.resume()
23
semaphore.wait()
Copied!
1
OkHttpClient client = new OkHttpClient().newBuilder()
2
.build();
3
Request request = new Request.Builder()
4
.url("https://api.zotlo.com/v1/transaction/detail?transactionId=5e6b9a02e71dd803d6420663")
5
.method("GET", null)
6
.addHeader("AccessKey", "***")
7
.addHeader("AccessSecret", "***")
8
.addHeader("ApplicationId", "2")
9
.addHeader("Language", "tr")
10
.build();
11
Response response = client.newCall(request).execute();
Copied!
1
import requests
2
3
url = "https://api.zotlo.com/v1/transaction/detail?transactionId=5e6b9a02e71dd803d6420663"
4
5
payload = {}
6
headers = {
7
'AccessKey': '***',
8
'AccessSecret': '***',
9
'ApplicationId': '2',
10
'Language': 'tr'
11
}
12
13
response = requests.request("GET", url, headers=headers, data = payload)
14
15
print(response.text.encode('utf8'))
Copied!
1
var client = new RestClient("https://api.zotlo.com/v1/transaction/detail?transactionId=5e6b9a02e71dd803d6420663");
2
client.Timeout = -1;
3
var request = new RestRequest(Method.GET);
4
request.AddHeader("AccessKey", "***");
5
request.AddHeader("AccessSecret", "***");
6
request.AddHeader("ApplicationId", "2");
7
request.AddHeader("Language", "tr");
8
IRestResponse response = client.Execute(request);
9
Console.WriteLine(response.Content);
Copied!

Servis Cevapları

Eğer Satın Alma Başarılı İse :

1
{
2
"meta": {
3
"requestId": "MacBook-Pro.local-REQ-5ead62f83fff3",
4
"httpStatus": 200
5
},
6
"result": {
7
"transaction": {
8
"id": 169,
9
"payment_type": "subscription",
10
"original_transaction_id": "f1ebc9a8-b1ed-43a7-bcad-e196515599f3",
11
"transaction_id": "87999971-702d-46e0-8086-2be89cd0691f",
12
"provider_transaction_id": 1.16631000000105e+24,
13
"package_id": "ZotloTest",
14
"status": "trial_to_paid",
15
"purchase_date": "2020-05-02 00:29:55",
16
"expire_date": "2020-05-29 21:18:03",
17
"original_purchase_date": "2020-04-26 21:18:03",
18
"price": 1,
19
"currency": "USD",
20
"country": "US",
21
"provider_name": "Zotlopay",
22
"refund": null
23
},
24
"transactionLog": [
25
{
26
"id": 226,
27
"team_id": 3,
28
"provider_id": 5,
29
"app_id": 2,
30
"create_date": "2020-05-02 00:29:55",
31
"request_type": "renewal",
32
"status": "success",
33
"request_data": "{\"cardPaymentMethodSpecificInput\":{\"paymentProductId\":1,\"token\":\"7c2cd83e-0dc3-49f6-a628-e774f8d5be3f\",\"unscheduledCardOnFileRequestor\":\"merchantInitiated\",\"unscheduledCardOnFileSequenceIndicator\":\"subsequent\"},\"fraudFields\":{\"customerIpAddress\":\"127.0.0.1\",\"userData\":[{\"Retry\":\"Y\"}]},\"order\":{\"amountOfMoney\":{\"amount\":100,\"currencyCode\":\"USD\"},\"customer\":{\"merchantCustomerId\":1588379394,\"billingAddress\":{\"countryCode\":\"US\"}}}}",
34
"response_data": "{\"hostedCheckoutSpecificOutput\":null,\"paymentOutput\":{\"amountPaid\":null,\"amountReversed\":null,\"bankTransferPaymentMethodSpecificOutput\":null,\"cardPaymentMethodSpecificOutput\":{\"authorisationCode\":\"654321\",\"card\":{\"cardNumber\":\"************1111\",\"expiryDate\":\"1220\"},\"fraudResults\":{\"avsResult\":\"0\",\"cvvResult\":\"0\",\"fraugster\":null,\"retailDecisions\":{\"fraudCode\":\"0100\",\"fraudNeural\":null,\"fraudRCF\":null},\"fraudServiceResult\":\"accepted\",\"inAuth\":null},\"initialSchemeTransactionId\":null,\"schemeTransactionId\":null,\"threeDSecureResults\":null,\"token\":\"7c2cd83e-0dc3-49f6-a628-e774f8d5be3f\",\"paymentProductId\":1},\"cashPaymentMethodSpecificOutput\":null,\"directDebitPaymentMethodSpecificOutput\":null,\"eInvoicePaymentMethodSpecificOutput\":null,\"invoicePaymentMethodSpecificOutput\":null,\"mobilePaymentMethodSpecificOutput\":null,\"paymentMethod\":\"card\",\"redirectPaymentMethodSpecificOutput\":null,\"sepaDirectDebitPaymentMethodSpecificOutput\":null,\"amountOfMoney\":{\"amount\":100,\"currencyCode\":\"USD\"},\"references\":{\"merchantOrderId\":null,\"merchantReference\":null,\"paymentReference\":\"0\",\"providerId\":null,\"providerReference\":null,\"referenceOrigPayment\":null}},\"status\":\"CAPTURE_REQUESTED\",\"statusOutput\":{\"isAuthorized\":true,\"isRefundable\":false,\"threeDSecureStatus\":null,\"errors\":null,\"isCancellable\":true,\"statusCategory\":\"PENDING_CONNECT_OR_3RD_PARTY\",\"statusCode\":800,\"statusCodeChangeDateTime\":\"20200502022955\"},\"id\":\"000001166310000001050000100001\"}",
35
"subscriber_id": "adassdfsdfdsfsdfdasd22",
36
"transaction_id": "87999971-702d-46e0-8086-2be89cd0691f",
37
"payment_type": "non3d"
38
}
39
]
40
}
41
}
Copied!

Eğer Satınalma Başarısız İse :

1
{
2
"meta": {
3
"requestId": "MacBook-Pro.local-REQ-5eb025e96f806",
4
"httpStatus": 200
5
},
6
"result": {
7
"transaction": null,
8
"transactionLog": [
9
{
10
"id": 98,
11
"team_id": 3,
12
"provider_id": 3,
13
"app_id": 2,
14
"create_date": "2020-04-06 06:10:11",
15
"request_type": "transaction",
16
"status": "fail",
17
"request_data": "\nCCProxySale20386ECCB3531A727428EBF394531********2283Test Test22115921a8b3951b512d54e1a880b57b30a1b321TRY159.146.13.1721ZotloTestZotloTest1zotlo-test-10\n",
18
"response_data":"{\"StatusCode\":\"1\",\"ResultCode\":\"59\",\"ResultMessage\":\"Doland?r?c?l?k ?\üphesi.\",\"OrderObjectId\":\"3fb29aed-f64a-4101-bd47-a35d670ee251\",\"LastTransactionDate\":\"4\\/6\\/2020 9:10:11 AM\",\"MaskedCreditCardNumber\":\"4531 44** **** 2283\",\"MPAY\":\"a8b3951b512d54e1a880b57b30a1b321\",\"CCTokenId\":\"00000000-0000-0000-0000-000000000000\",\"SubscriberId\":\"00000000-0000-0000-0000-000000000000\",\"SubscriberStarterDate\":\"1\\/1\\/0001 12:00:00 AM\",\"SubscriptionRequestId\":\"00000000-0000-0000-0000-000000000000\"}",
19
"subscriber_id": "zotlo-test-1",
20
"transaction_id": "3fb29aed-f64a-4101-bd47-a35d670ee251",
21
"payment_type": "non3d"
22
}
23
]
24
}
25
}
Copied!
Servislerinden HTTP status code olarak başarılı durumlarda 200 dönmektedir. Başarısız durumlarda ise 400 ya da 500 Http StatusCode dönmektedir. Örnek hata cevabı aşağıdaki şekildedir.
1
{
2
"meta": {
3
"requestId": "app2.localdomain-REQ-5e7da3a811d5d",
4
"httpStatus": 400,
5
"errorMessage": "Kullanıcı abonelik profili bulunamadı.",
6
"errorCode": 400009
7
},
8
"result": []
9
}
Copied!
Cevap
Açıklama
requestId
Her istek için sistem tarafından atanan id değeridir. Sistemsel hatalarda log'lardan hata yakalamak için kullanılır.
httpStatus
Hatanın HTTP durum kodu değeri
errorMessage
Hata mesajı. Tüm hata kodlarına "Hata Kodları" menüsünden ulaşabilirsiniz.
errorCode
İlgili hata için Zotlo tarafından verilen hata kodu
Last modified 2mo ago