Payment Confirmation

v1/transaction/charge

The service that the credit card payment process is finalized and the relevant amount is withdrawn from the credit card.This service is initializes by Paynet.js or Paynet-custom.js in custom form and embedded form integrations. To use this service, session_id and token_id information that Paynet.js posted to your server are required.

You should perform basic authentication with secret_key to use payment service. See more

https://api.paynet.com.tr/v1/transaction/charge

In the example below, the session_id and token_id are taken and sent to the payment confirmation service.

<?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, 
 'amount' => '1500',
 'add_comission_amount' => false,
 'ratio_code' => '',
 'installments' => '',
 'no_instalment' => false,
 'tds_required' => true
);
			
$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