3D Secure Başlatma (Init 3Ds)
Bu method HTTP Form POST methodu ile çalışmaktadır. Bu methoda özel kimlik doğrulama esnasında anlatılan bilgiler header üzerinde değil doğrudan form-data şeklinde gönderilmelidir.
POSThttps://pf-apigateway.pt.linktera.xyz/v1/ThreeDS/init3ds
Request
Headers
ClientIpAddress array[string]
ConversationId string
MerchantNumber string
Nonce string
PublicKey string
Signature string
ConversationId string
MerchantNumber string
Nonce string
PublicKey string
Signature string
Body
Dikkat
Bilgiler multipart/form-data formatında gönderilmelidir!
{
"threeDSessionId": "string",
"callbackUrl": "string",
"languageCode": "string",
"clientIpAddress": "string",
"publicKey": "string",
"nonce": "string",
"signature": "string",
"conversationId": "string",
"merchantNumber": "string",
}
Response
Body
{
"isSucceed": "boolean",
"errorCode": "string or null",
"errorMessage": "string or null",
"conversationId": "string or null",
"htmlContent": "string or null"
}
Örnek Kodlar
- Axios
- Java
- PHP
- C#
- Go
- Python
- cURL
const axios = require('axios'); const FormData = require('form-data'); let data = new FormData(); data.append('ThreeDSessionId', ''); data.append('CallbackUrl', 'https://www.google.com'); data.append('LanguageCode', 'TR'); data.append('ClientIpAddress', '192.1.1.0'); data.append('PublicKey', 'oSJEm5GV3nR6ZeWwOB5pig=='); data.append('Nonce', ''); data.append('Signature', ''); data.append('ConversationId', 'test123456'); data.append('MerchantNumber', '1100000204'); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://pf-apigateway.pt.linktera.xyz/v1/threeds/init3ds', headers: { 'Content-Type': 'multipart/form-data' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); });
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("ThreeDSessionId","")
.addFormDataPart("CallbackUrl","https://www.google.com")
.addFormDataPart("LanguageCode","TR")
.addFormDataPart("ClientIpAddress","192.1.1.0")
.addFormDataPart("PublicKey","oSJEm5GV3nR6ZeWwOB5pig==")
.addFormDataPart("Nonce","")
.addFormDataPart("Signature","")
.addFormDataPart("ConversationId","test123456")
.addFormDataPart("MerchantNumber","1100000204")
.build();
Request request = new Request.Builder()
.url("https://pf-apigateway.pt.linktera.xyz/v1/threeds/init3ds")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://pf-apigateway.pt.linktera.xyz/v1/threeds/init3ds',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('ThreeDSessionId' => '','CallbackUrl' => 'https://www.google.com','LanguageCode' => 'TR','ClientIpAddress' => '192.1.1.0','PublicKey' => 'oSJEm5GV3nR6ZeWwOB5pig==','Nonce' => '','Signature' => '','ConversationId' => 'test123456','MerchantNumber' => '1100000204'),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://pf-apigateway.pt.linktera.xyz/v1/threeds/init3ds");
var content = new MultipartFormDataContent();
content.Add(new StringContent(""), "ThreeDSessionId");
content.Add(new StringContent("https://www.google.com"), "CallbackUrl");
content.Add(new StringContent("TR"), "LanguageCode");
content.Add(new StringContent("192.1.1.0"), "ClientIpAddress");
content.Add(new StringContent("oSJEm5GV3nR6ZeWwOB5pig=="), "PublicKey");
content.Add(new StringContent(""), "Nonce");
content.Add(new StringContent(""), "Signature");
content.Add(new StringContent("test123456"), "ConversationId");
content.Add(new StringContent("1100000204"), "MerchantNumber");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
package main
import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)
func main() {
url := "https://pf-apigateway.pt.linktera.xyz/v1/threeds/init3ds"
method := "POST"
payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("ThreeDSessionId", "")
_ = writer.WriteField("CallbackUrl", "https://www.google.com")
_ = writer.WriteField("LanguageCode", "TR")
_ = writer.WriteField("ClientIpAddress", "192.1.1.0")
_ = writer.WriteField("PublicKey", "oSJEm5GV3nR6ZeWwOB5pig==")
_ = writer.WriteField("Nonce", "")
_ = writer.WriteField("Signature", "")
_ = writer.WriteField("ConversationId", "test123456")
_ = writer.WriteField("MerchantNumber", "1100000204")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
import requests
url = "https://pf-apigateway.pt.linktera.xyz/v1/threeds/init3ds"
payload = {'ThreeDSessionId': '',
'CallbackUrl': 'https://www.google.com',
'LanguageCode': 'TR',
'ClientIpAddress': '192.1.1.0',
'PublicKey': 'oSJEm5GV3nR6ZeWwOB5pig==',
'Nonce': '',
'Signature': '',
'ConversationId': 'test123456',
'MerchantNumber': '1100000204'}
files=[
]
headers = {}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
curl --location 'https://pf-apigateway.pt.linktera.xyz/v1/threeds/init3ds' --form 'ThreeDSessionId=""' --form 'CallbackUrl="https://www.google.com"' --form 'LanguageCode="TR"' --form 'ClientIpAddress="192.1.1.0"' --form 'PublicKey="oSJEm5GV3nR6ZeWwOB5pig=="' --form 'Nonce=""' --form 'Signature=""' --form 'ConversationId="test123456"' --form 'MerchantNumber="1100000204"'