Receiving Transfer Instruction Results (Optional)

PAYTR system informs the URL determined by the Merchant after the transfer operations are concluded.

Request (REQUEST) URL: Platform Transfer Result Notification URL (Must be entered by the Merchant on the Merchant Panel > Settings page)

Values to be sent in POST REQUEST:

Field Name / Type Description Mandatory Limitations & Notes
trans_id JSON string containing the trans_id values you specified in the transfer request Yes -
merchant_salt A value specific to your store, which you can access through the PayTR Merchant Panel > Information page. Yes -
merchant_key A value specific to your store, which you can access through the PayTR Merchant Panel > Information page. Yes -


Values to be sent in POST REQUEST:

Field Name / Type Token Mandatory Description Limitations & Notes
trans_ids (JSON string) Yes Yes JSON string containing the trans_id values you specified in the transfer request
hash (string) No Yes paytr_token: The value created to make sure that the request comes from PAYTR and that the content has not changed Please check the sample codes for calculation and control


Example POST:

[hash] => Of0/yvgTii/+lGD3o+J0u8xXriVqlPIrvsZsv4cLhM4= 
[trans_ids] => ["dcbbe0b9fd25154d73c","dc8c509efc6450d30","9310d84d3bf"] 

Response (RESPONSE):

You need to respond with OK to the request you will receive on your screen from PAYTR. If this response is not received, the request will be repeated.

<?php

    $post = $_POST;

    $merchant_key   = 'YYYYYYYYYYYYYY';
    $merchant_salt  = 'ZZZZZZZZZZZZZZ';

    $post["trans_ids"]=str_replace("\\", "", $post["trans_ids"]);
    $hash = base64_encode( hash_hmac('sha256', $post['trans_ids'].$merchant_salt, $merchant_key, true) );

    if( $hash != $post['hash'] )
        die('PAYTR notification failed: bad hash');

    $trans_ids = json_decode($post['trans_ids'],1);
    foreach($trans_ids as $trans_id)
    {

    }

    echo "OK";
    exit;
?>

Receiving Transfer Instruction Results click to download