Paynet API
Search…
What I need ?
It is necessary to has "Paynet API KEY" to use Paynet payment method and access services. If you are Paynet customer you can request Paynet API keys from odeme.paynet.com.tr address. If you are not Paynet customer yet, you can request Paynet API key from [email protected] mail address.
It's necessary to has an static IP address to access Paynet services.
Both test system and live system support only TLS 1.1 and TLS 1.2 as security communication rule.
Use live system's URL and API Keys for using the live system.

Secret Key

It is using for authenticate Paynet API Rest Services. The authentication type is HTTP Basic Authentication. Secret key is sent in the Authentication header of the HTTP Request. All sent requests must have an authentication header.
1
Authorization: Basic sck_pcs_jECRyoZq0khnsV9elaF/SIBVvxQI+bIW
Copied!
In the following example you can see how to perform basic authentication ;
1
<?php
2
3
$secret_key = "sck_pcs_rMnxDSW/43243434/YAzXXXXXXXXXXXX";
4
$PostURL = "https://pts-api.paynet.com.tr/v1/transaction/charge";
5
6
$session_id = $_REQUEST["session_id"];
7
$token_id = $_REQUEST["token_id"];
8
9
10
$params = array(
11
'session_id' => $session_id,
12
'token_id' => $token_id,
13
'transaction_type' => 1,
14
);
15
16
$options = array(
17
'http' => array(
18
'header' =>"Accept: application/json; charset=UTF-8\r\n".
19
"Content-type: application/json; charset=UTF-8\r\n".
20
"Authorization: Basic ".$secret_key,
21
'method' => 'POST',
22
'content' => json_encode($params),
23
'ignore_errors' => true
24
),
25
);
26
27
$context = stream_context_create($options);
28
$result = json_decode(@file_get_contents($PostURL, false, $context));
29
30
if($result->is_succeed == true)
31
{
32
echo "Başarılı";
33
}
34
else
35
{
36
echo "Başarısız";
37
}
38
39
?>
Copied!
Last modified 10mo ago
Copy link
Contents
Secret Key