Notifications

Notifications are the basic web services for the Payguru API integration. They are used to transmit the information to the merchant for all the "accepted payments" from the Payguru Platform. The merchant receives all the information about payments done by their customers through those notifications.

>URL
 http://yoursite.com/PhsNotifyService
>HTTP Method
GET yada POST/JSON

If request true then only give response "OK".

Notify Key: md5( Service code + Merchant ID + Transaction ID + Transaction Code + Order RefNo + Amount + Merchant Private Key + Service Private Key)

>Parameters
FieldTypeDescription
txidInteger - RequiredTransaction ID
codeString - RequiredPayguru Order
orderString - RequiredMerchant Order
statusInteger - RequiredTransaction Status #See Transaction Status
amountFloat - RequiredTransaction Amount
transaction_dateDate - RequiredTransaction Time
bankString - RequiredBank Code
keyString - RequiredNotify Key #See Notify Key

GET

>Sample Codes
<?
$data = $_GET;
//$data["txid"] = Transaction ID
//$data["code"] = Transaction Code
//$data["order"] = Order Refno
//$data["status"] = Transaction Status
//$data["amount"] = Transaction amount
//$data["transaction_date"] = Transaction Date
//$data["bank"] = Bank Code
//$data["key"] = Notify Key
$localKey = md5("Service Code"."Merchant ID".$data["txid"].$data["code"].$data["order"].$data["amount"]."Merchant Private Key"."Service Private Key");
if($localKey = $data["key"] && $data["status"] == "3"){
     echo "OK";//If you accept this request, you must response with "OK"
//find transaction with order
}else{
    echo "Wrong Data";
}

POST/JSON

>Örnek Kodlar
<?
$data = json_decode(file_get_contents("php://input"),true);
//$data["txid"] = Transaction ID
//$data["code"] = Transaction Code
//$data["order"] = Order Refno
//$data["status"] = Transaction Status
//$data["amount"] = Transaction amount
//$data["transaction_date"] = Transaction Date
//$data["bank"] = Bank Code
//$data["key"] = Notify Key
$localKey = md5("XXX".123.$data["txid"].$data["code"].$data["order"].$data["amount"]."Merchant Key + Service Key");
if($localKey = $data["key"] && $data["status"] == "3"){
     echo "OK";//If you accept this request, you must response with "OK"
//find transaction with order
}else{
echo "Wrong Data";
}

TCKN Verify Service

>URL
 http://yoursite.com/TCKNVerifyService
>HTTP Method
GET or POST/JSON
>Response
JSON => {status:true,tckn:md5(TCKN + ServicePrivateKey)}

TCKN Verification Notify Key: md5( Service code + Merchant ID + Order RefNo + Merchant Private Key + Service Private Key)

>Parameters
FieldTypeDescription
txidIntegerTransaction ID
codeStringPayguru Order
orderStringMerchant Order
amountFloatTransaction Amount
transaction_dateDateTransaction Time
bankStringBank Code
bank_noStringBank No
keyStringNotify Key #See TCKN Verification Notify Key
notification_typeStringNotification Type (LoV: verify, verified, unverified)

GET

>Sample Codes
<?
$data = $_GET;
//$data["txid"] = Transaction ID
//$data["code"] = Transaction Code
//$data["order"] = Order Refno
//$data["amount"] = Transaction amount
//$data["transaction_date"] = Transaction Date
//$data["bank"] = Bank Code
//$data["bank_no"] = Bank ID
//$data["key"] = Notify Key
//$data["notification_type"]="verify"; //Notification Type
$localKey = md5("Service Code" . "Merchant ID" . $data["order"] . "Merchant Key" . "Service Key");
if ($localKey = $data["key"]) {
    //$relevantTckn="";
    $responseArr = array("status" => true, "tckn" => md5($relevantTckn . "Service Key"));
} else {
    $responseArr = array("status" => false, "tckn" => null);
}
echo json_encode($responseArr);

POST/JSON

>Sample Request

<?
$data = json_decode(file_get_contents("php://input"), true);
//$data["txid"] = Transaction ID
//$data["code"] = Transaction Code
//$data["order"] = Order Refno
//$data["amount"] = Transaction amount
//$data["transaction_date"] = Transaction Date
//$data["bank"] = Bank Code
//$data["bank_no"] = Bank ID
//$data["key"] = Notify Key
//$data["notification_type"]="verify"; //Notification Type
$localKey = md5("Service Code" . "Merchant ID" . $data["order"] . "Merchant Key" . "Service Key");
if ($localKey = $data["key"]) {
    //$relevantTckn="";
    $responseArr = array("status" => true, "tckn" => md5($relevantTckn . "Service Key"));
} else {
    $responseArr = array("status" => false, "tckn" => null);
}
echo json_encode($responseArr);

Test Transaction

You can try this method for testing a transaction. You receives a notification. It only works on sandbox mod.

>URL
 https://sandbox.payguru.com/phs/transaction/test
>HTTP Method
GET or POST
>Headers
FieldTypeDescription
merchantInteger - RequiredMerchant ID
tokenString - RequiredToken
>Parameters
FieldTypeDescription
codeString - RequiredService Code
refString - RequiredPayguru Reference Code(You can get orderLookup/Check)
amountAmount - RequiredAmount of Transaction
nameString - OptionalUser name
descriptionString - OptionalDescription of Transaction
ibanString - OptionalIBAN
tcknoNumeric - OptionalT.C No

>Success

Gives Your Response