What I need ?
Secret Key
Authorization: Basic sck_pcs_jECRyoZq0khnsV9elaF/SIBVvxQI+bIW
<?php
$secret_key = "sck_pcs_rMnxDSW/43243434/YAzXXXXXXXXXXXX";
$PostURL = "https://pts-api.paynet.com.tr/v1/transaction/charge";
$session_id = $_REQUEST["session_id"];
$token_id = $_REQUEST["token_id"];
$params = array(
'session_id' => $session_id,
'token_id' => $token_id,
'transaction_type' => 1,
);
$options = array(
'http' => array(
'header' =>"Accept: application/json; charset=UTF-8\r\n".
"Content-type: application/json; charset=UTF-8\r\n".
"Authorization: Basic ".$secret_key,
'method' => 'POST',
'content' => json_encode($params),
'ignore_errors' => true
),
);
$context = stream_context_create($options);
$result = json_decode(@file_get_contents($PostURL, false, $context));
if($result->is_succeed == true)
{
echo "Başarılı";
}
else
{
echo "Başarısız";
}
?>Last updated