Kayıtlı Kart Listesi

Aboneye ait kayıtlı kredi kartlarının listesinin çekilebileceği servistir.

POST https://api.zotlo.com/v1/subscription/profile?subscriberId=SUBSCRIBER_ID
Bu servisten gelen cardToken değeri ile ödeme servislerinde kart bilgileri girmeden tahsilat gerçekleştirilebilmektedir.
Bu servis GET metoduyla çalışır. Abone ait bilgilerin çekilebilmesi için subscriberId parametresinin gönderilmesi zorunludur.

Profil servisi için gönderilmesi gereken parametreler şunlardır :

Alan
Açıklama
subscriberId
Kayıtlı kart listesinin dönülmesini istenildiği abonenin id'sidir.

Örnek İstek

Curl
Php
Swift
Java
Python
C#
1
curl --location --request GET 'https://api.zotlo.com/v1/subscription/card-list?subscriberId=token1' \
2
--header 'AccessKey: ***' \
3
--header 'AccessSecret: ***' \
4
--header 'ApplicationId: *' \
5
--header 'Language: tr' \
6
--header 'Content-Type: application/json' \
7
--data-raw '{
8
"subscriberId":"token-1"
9
}'
Copied!
1
$curl = curl_init();
2
3
curl_setopt_array($curl, array(
4
CURLOPT_URL => "https://api.zotlo.com/v1/subscription/card-list?subscriberId=token1",
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_POSTFIELDS =>"{\"subscriberId\":\"token-1\"\n}",
13
CURLOPT_HTTPHEADER => array(
14
"AccessKey: ***",
15
"AccessSecret: ***",
16
"ApplicationId: *",
17
"Language: tr",
18
"Content-Type: application/json"
19
),
20
));
21
22
$response = curl_exec($curl);
23
24
curl_close($curl);
25
echo $response;
Copied!
1
import Foundation
2
3
var semaphore = DispatchSemaphore (value: 0)
4
5
let parameters = "{\"subscriberId\":\"token-1\"\n}"
6
let postData = parameters.data(using: .utf8)
7
8
var request = URLRequest(url: URL(string: "https://api.zotlo.com/v1/subscription/card-list?subscriberId=token1")!,timeoutInterval: Double.infinity)
9
request.addValue("***", forHTTPHeaderField: "AccessKey")
10
request.addValue("***", forHTTPHeaderField: "AccessSecret")
11
request.addValue("*", forHTTPHeaderField: "ApplicationId")
12
request.addValue("tr", forHTTPHeaderField: "Language")
13
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
14
15
request.httpMethod = "GET"
16
request.httpBody = postData
17
18
let task = URLSession.shared.dataTask(with: request) { data, response, error in
19
guard let data = data else {
20
print(String(describing: error))
21
return
22
}
23
print(String(data: data, encoding: .utf8)!)
24
semaphore.signal()
25
}
26
27
task.resume()
28
semaphore.wait()
Copied!
1
OkHttpClient client = new OkHttpClient().newBuilder()
2
.build();
3
Request request = new Request.Builder()
4
.url("https://api.zotlo.com/v1/subscription/card-list?subscriberId=token1")
5
.method("GET", null)
6
.addHeader("AccessKey", "***")
7
.addHeader("AccessSecret", "***")
8
.addHeader("ApplicationId", "*")
9
.addHeader("Language", "tr")
10
.addHeader("Content-Type", "application/json")
11
.build();
12
Response response = client.newCall(request).execute();
Copied!
1
import requests
2
3
url = "https://api.zotlo.com/v1/subscription/card-list?subscriberId=token1"
4
5
payload = "{\"subscriberId\":\"token-1\"}"
6
headers = {
7
'AccessKey': '***',
8
'AccessSecret': '***',
9
'ApplicationId': '2',
10
'Language': 'tr',
11
'Content-Type': 'application/json'
12
}
13
14
response = requests.request("GET", url, headers=headers, data = payload)
15
16
print(response.text.encode('utf8'))
Copied!
1
var client = new RestClient("https://api.zotlo.com/v1/subscription/card-list?subscriberId=token1");
2
client.Timeout = -1;
3
var request = new RestRequest(Method.GET);
4
request.AddHeader("AccessKey", "***");
5
request.AddHeader("AccessSecret", "***");
6
request.AddHeader("ApplicationId", "*");
7
request.AddHeader("Language", "tr");
8
request.AddHeader("Content-Type", "application/json");
9
request.AddParameter("application/json", "{\"subscriberId\":\"token-1\"}", ParameterType.RequestBody);
10
IRestResponse response = client.Execute(request);
11
Console.WriteLine(response.Content);
Copied!

Servis Cevapları

Eğer Kayıtlı Kredi Kartı Varsa :

1
{
2
"meta": {
3
"requestId": "6d2989e84793-REQ-5f32aa96ac4c0",
4
"httpStatus": 200
5
},
6
"result": {
7
"cardList": [
8
{
9
"token": "cGU3eGV5TTgrOEMwYnJET1BhK1pjTGlySE5YdmJJSG9rUHZ2Rmc5RzUrYm9RZkd0L3JKWjRwTFRrek9aaVZZPQ==",
10
"cardNumber": "411111******1111",
11
"cardExpire": "12/20"
12
}
13
]
14
}
15
}
Copied!

Eğer Kayıtlı Kredi Kartı Yoksa :

1
{
2
"meta": {
3
"requestId": "MacBook-Pro.local-REQ-5e95ba883a826",
4
"httpStatus": 200
5
},
6
"result": {
7
"cardList": []
8
}
9
}
Copied!

Başarılı Cevap Parametreleri

Alan
Açıklama
token
Sistem tarafından üretilen kredi kartı token'dir. Ödeme servislerinde kredi kartı bilgileri olmadan bu token ile tahsilat yapılabilmektedir.
cardNumber
Kayıtlı kredi kartı numarasının formatlanmış hali
cardExpire
Kayıtlı kredi kartının son geçerlilik tarihi
Last modified 2mo ago